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

cancel / void previous pending payments #58

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

peterberkenbosch
Copy link
Collaborator

@peterberkenbosch peterberkenbosch commented Feb 17, 2020

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.

  • add additional specs

@peterberkenbosch peterberkenbosch self-assigned this Feb 17, 2020
@peterberkenbosch peterberkenbosch changed the title void previous pending payments cancel / void previous pending payments Feb 17, 2020
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.
@peterberkenbosch peterberkenbosch force-pushed the phb/void-old-payments-before-redirection branch from f9ab659 to 80d2c71 Compare February 17, 2020 18:35
trying to find the best place to put this code
@peterberkenbosch
Copy link
Collaborator Author

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

@seandawes
Copy link

Another thing I think you have to consider is if the flow not only contains more than 1 affirm loan but another payment source as stores will have at least 1 other payment method in their checkout outside of affirm

As here are two use cases. 2 affirms. Where customer exited after getting approved to change his address so we had to void the first affirm and capture second
image

Customer uses 2 payment methods. Affirm + Stripe.
Took me a bit to find a use case but here is an example . Customer goes through affirm, gets approved and than manages to add credit card as well. Thinks he paid with affirm but paid with credit card as it was the final step of checkout on our site

image

We also have the reverse where customer changes their mind and will have 1 stripe ready to capture and 1 affirm ready to capture. We manually than have to reach out to clarify what the customer wishes to pay with.

I think the overall Solidus logic needs to be addressed where multiple full totals can exist. Of course this adds complexity for those who handle partial payments which gateways such as stripe now facilitate.

@peterberkenbosch
Copy link
Collaborator Author

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.

@stale
Copy link

stale bot commented Nov 11, 2022

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.

@stale stale bot added the wontfix label Nov 11, 2022
@seandawes
Copy link

This issue is still present unless others have a fix

@stale stale bot removed the wontfix label Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants