Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deferred payment flow bug #40

Open
vassalloandrea opened this issue Oct 27, 2021 · 2 comments
Open

Deferred payment flow bug #40

vassalloandrea opened this issue Oct 27, 2021 · 2 comments
Assignees
Labels

Comments

@vassalloandrea
Copy link
Contributor

From the documentation: https://developers.afterpay.com/afterpay-online/docs/api-calls-and-payment-flows I'm expecting that the correct behavior is:

  • With the deferred flow, when a user makes an order, the payment is not captured and the installments plan is not started until the admin user goes to the order payments and makes the payment as captured. (auto-capture off)
  • With the immediate flow, when a user makes an order, the payment is captured and the installments plan is started. (auto-capture on)

Actual behavior:

  • With the auto-capture enabled, the payment is captured using the immediate flow and the installment plan is starting (correct)
  • With the auto-capture disabled, the payment is not captured - Solidus side - but is captured Afterpay side with the deferred payment flow starting the installments flow and charging the user with the first installment (WRONG)

I think that the problem is related to this line: https://github.com/nebulab/solidus_afterpay/blob/65346f79f49e2d119a747718e63f1395b170a9dd/app/models/solidus_afterpay/gateway.rb#L68

What do you think? @mtylty @ChristianRimondi @garciajordy

@vassalloandrea vassalloandrea self-assigned this Oct 27, 2021
@ChristianRimondi
Copy link
Collaborator

@vassalloandrea I don't think it's an issue related to the purchase method. As you can see in the solidus codebase, the purchase method is only called if the auto_capture is set to true. Otherwise, it calls only the authorize method. We should investigate further if it's an "issue" with how Afterpay handles the authorization of the payment or if it's a bug in the gem.

@stale
Copy link

stale bot commented Jan 7, 2023

This issue has been automatically marked as stale because it has not had recent activity. It might be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants