boomerdigital / solidus_amazon_payments

Add Pay with Amazon to your Spree Commerce solution
Apache License 2.0
7 stars 8 forks source link

Remove `CaptureNow` from authorize #21

Closed jordan-brough closed 8 years ago

jordan-brough commented 8 years ago

When Spree::Config[:auto_capture] is enabled then Spree::Gateway::Amazon#purchase will get called, which does this:

authorize(amount, amazon_checkout, gateway_options)
capture(amount, amazon_checkout, gateway_options)

So we don't want authorize to perform a capture, because we'll be capturing immediately afterward and the second capture would fail.

Note: The best way I can think of to test something like this would be via an integration test (with some VCR cassettes perhaps) and we don't have that yet. It would be great to start making some integration specs at some point.

manmartinez commented 8 years ago

Nice find! As for the integration tests I agree with using something like VCR, however if we're considering getting rid of the AmazonMws and replace it with the pay_with_amazon gem we should probably do that first before writing the tests