Integration of the Shopify Active Merchant Logic#1
Open
thisiscab wants to merge 9 commits into
Open
Conversation
Previously that code was residing in the Spree Gateway itself, but in the end it made more sense to have it there.
We required "login" when it doesn't even exists in our scenario
Bleeding edge, they say...
We had trouble with the gem not being usable due to not requiring the gem at the top of the Shopify Gateway.
We want to make sure that the order gets correctly refunded or voided when calling the respective methods.
We are still receiving an error in the API response which makes the test fail, but in Shopify we see that the order has no errors and has been correctly refunded. I want to see if this implementation still works when doing the full cycle.
The amount that is given by solidus is always in cents, we were not taking that in consideration previously.
For a yet unknown reason, Shopify can return an error object without an actual error. In that case, we have to check if there is an error message associated with that object, if there is no error message then we assume that it has successfully did it's thing.
Since Shopify-Payment gateway uses Stripe and Stripe doesn't support voiding, we simply use our Refunder object and refund for the total amount of the order.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the logic required for the ShopifyGateway (DynamoMTL/solidus_gateway#1) to be able to void / refund an order.
This will make call the proper calls to the ShopifyAPI and refund / void the order that are there with what is being passed to the Gateway.