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

[Stripe] Cannot confirm this PaymentIntent because it has already succeeded #364

Closed
mvanio opened this issue Nov 3, 2020 · 5 comments
Closed

Comments

@mvanio
Copy link

mvanio commented Nov 3, 2020

I’m implementing the latest release of spree_gateway (3.9.0) but am having an issue with the checkout process not moving to the confirm stage. At verify stage an infobox appears requesting wait for a popup, but there is no popup. The payment is sent to Stripe as uncaptured (as wished) but the customer is not moved beyond the verify payment stage to complete.
When payments are requiring capture I see an error as below in the Stripe logs while using a Stripe test card;

"message": "You cannot confirm this PaymentIntent because it has a status of requires_capture. Only a PaymentIntent with one of the following statuses may be confirmed: requires_confirmation, requires_action."
"type": "invalid_request_error"

After changing the 'Requires Capture' status of newly submitted payments, the Stripe logs show a different error;

"message": "You cannot confirm this PaymentIntent because it has already succeeded after being previously confirmed."
"type": "invalid_request_error"

How can I support the requirement for separate payment capture, or if I must capture payments automatically how are they being confirmed in a previous step?

After searching the codebase I am unable to find a specific answer to either of these questions.
I'm using spree 3.7.8 and spree_gateway v3.9.0

@mvanio mvanio changed the title Cannot confirm this PaymentIntent because it has already succeeded [StripeCannot confirm this PaymentIntent because it has already succeeded Nov 3, 2020
@mvanio mvanio changed the title [StripeCannot confirm this PaymentIntent because it has already succeeded [Stripe] Cannot confirm this PaymentIntent because it has already succeeded Nov 3, 2020
@mvanio
Copy link
Author

mvanio commented Nov 13, 2020

Further info after a discussion with Stripe on this issue.

The first error message above;You cannot confirm this PaymentIntent because it has a status of requires_capture. Only a PaymentIntent with one of the following statuses may be confirmed: requires_confirmation, requires_action." occurs because
when Stripe accounts are using the two step payment flow, 'Authorization and Capture', the PaymentIntent is already confirmed and just needs to be captured.

It would seem then that spree_gateway should allow for users who need to use PaymentIntents but also limit the gem functionality to avoid Confirmation of the payment when this will be done by the Spree admin user later either from within Spree, or on the Stripe dashboard.

The next error, You cannot confirm this PaymentIntent because it has already succeeded after being previously confirmed. is normal Stripe behaviour when payment are automatically captured. So the gem should probably not attempt to confirm PaymentIntents when they are captured automatically.

Relevant Stripe API references:
Separate authorization and capture to create a charge now, but capture funds later.
Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture.

@mvanio
Copy link
Author

mvanio commented Nov 30, 2020

Does PR #368 resolve this issue and what is the process for using the updated gem version in Spree 3.7.8 please?

@damianlegawiec
Copy link
Member

@mvanio could you re-test this with 3.9.2?

@mvanio
Copy link
Author

mvanio commented Jan 20, 2021

@damianlegawiec I haven't been able to just yet but Stripe payments transfer fine with 3.9.0.

@elixirdev13
Copy link

To resolve this issue, I recommend taking the following steps:

Double-check your credit card information: Ensure that you entered your credit card details correctly, including the card number, expiration date, CVV code, and billing address. Even a small mistake can cause a transaction to be declined.

Contact your credit card issuer: Reach out to the customer service department of your credit card provider to inquire about the specific reason for the declined transaction. They may be able to provide you with additional information or resolve any issues on their end.

Retry the transaction: After verifying your credit card details and speaking with your credit card issuer, attempt the transaction again. Make sure you follow all the necessary steps and provide accurate information.

Alternative payment methods: If the issue persists, consider using an alternative payment method, such as a different credit card or a different payment service if it is available.

Contact the service provider: If the problem persists even after following the above steps, reach out to the company or service you were trying to sign up for. They may be able to assist you further, provide alternative payment options, or address any technical issues on their platform.

Remember, I can provide general guidance, but for specific account or transaction issues, it's best to reach out to the appropriate customer support channels for the service you were attempting to sign up for or your credit card issuer for further assistance.

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

No branches or pull requests

3 participants