Add config to allow processing to be authorized in stripe base payments#13849
Conversation
…logic of how other payments are handled
|
|
@scherddel is attempting to deploy a commit to the medusajs Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
push |
|
TYSM for providing this. Im not sure about what exactly might brick, but as a quick fix it totally did the job. IMHO Medusa should support a afterpay method, as this is a super common usecase. For me, it even registeres the orders but does mark the payment as pending / ready to capure by payment with sepa, which is totally fine for me, as there is a capture integration /webhook for that. Love to you |
|
@danielgran Thank you so much for your feedback. Ultimately, it comes down to balancing the risk of introducing a 'quick fix' that is difficult to deprecate later versus building a robust solution that handles complex payment event combinations. This is a specific pain point regarding European compliance, where we must place orders on 'hold' to defer contract acceptance while still acknowledging the payment request via email. Medusa doesn't support this workflow out of the box, necessitating significant customization. I view this as a major functional gap, as it currently blocks 20% of available Stripe payment methods. What do you think @olivermrbl ? |
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
NOT agree to be stale. This is a major issue. |
|
@shahednasser May we ask you to triage this issue? |
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
. |
|
Thank you for your contribution! After reviewing this PR, we need a few things addressed before we can move forward: Required changes:
case "payment_intent.created":
case "payment_intent.processing":
return {
action: PaymentActions.PENDING,
...
}When |
Summary
What — What changes are introduced in this PR?
Added a configurable option
authorizeOnProcessingto thepayment-stripeprovider that allows transactions in Stripe that may take longer to be processed by the complete cart workflow.Configuration example:
When enabled, the payment can be automatically captured through the webhook or manually captured in the admin backend. The order remains in a pending/authorized state (shown as "orange") until Stripe changes the payment intent status to
succeeded.The solution treats payment intents with status
processingasauthorizedwhen theauthorizeOnProcessingflag is set totrue. Whenfalse, it falls back to the previous behavior.Why — Why are these changes relevant or necessary?
Stripe-based payments that have a delayed capturing cycle currently cause cart completion to fail. This feature provides a workaround for users who need to support such payment methods by explicitly enabling this behavior through configuration.
Testing — How have these changes been tested, or how can the reviewer test the feature?
I tested approximately 5 different payment methods in Stripe to ensure existing functionality works as expected. The changes now allow delayed payment methods to function properly during cart completion.
Checklist
Please ensure the following before requesting a review:
yarn changesetand follow the promptsAdditional Comments
I recognize that an ideal solution would introduce a more robust way of handling carts or orders with pending payments (e.g., a "parking" mechanism). However, this PR serves as a pragmatic workaround until a more comprehensive solution can be developed. In the meantime, this feature enables support for payment methods that would otherwise block cart completion.