-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
cancel / void previous pending payments #58
base: main
Are you sure you want to change the base?
cancel / void previous pending payments #58
Conversation
we only have a hook to connect to when we render the order payload for Affirm, this commit adds additional logic to returning the order payload. Before returning the payload, we make sure there are no pending Affirm payments anymore.
f9ab659
to
80d2c71
Compare
trying to find the best place to put this code
We have to do this before we redirect, since Affirm only accepts 1 Authorized loan. Right now the cancelations are done on the creation of the json payload, and that feels a bit dirty. Other option I thought off was to have this in the javascript helper, before submitting the Affirm form we can do an ajax request if there are pending payments present |
Thanks Sean, The first sample is fixed with this PR, the second sample is more complex indeed and needs to be addressed in core. Multiple pending payments with same amounts as total order amount to automatically be voided. Writing up a RFC on the main repo today for that one. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue is still present unless others have a fix |
we only have a hook to connect to when we render the order payload for Affirm, this commit adds additional logic to returning the order payload. Before returning the payload, we make sure there are no pending Affirm payments anymore.
NB: Not really happy where this logic lives right now, input about this is appreciated! With using the Affirm.js for initiating the checkout we have to hook into the existing payments, this needs a bit more documentation and work around already captured affirm payments since it looks that multiple authorized / started payments seem to be no problem. We have to be sure to cancel all previous transactions with Affirm.