#arpit-gupta_cashapp-subscription-behavior
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1334208932876517457
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- arpit-gupta_code, 5 hours ago, 27 messages
- arpit-gupta_unexpected, 2 days ago, 44 messages
Hi ๐
I"m taking a look here.
The error message is pretty explicit here
message: "mandate_data is not allowed because this payment intent already has a reusable Cash App Pay payment method attached to it.",
Can you share an example of the other error you are seeing?
When confirming a PaymentIntent with a cashapp PaymentMethod and setup_future_usage, mandate_data is required.
This is other error message on not passing mandate_data
Do you have an example Payment Intent confirm request with that error?
Basically when I'm not passing it is saying to pass mandate_data and when I'm passing then it says it is already attached to the payment intent
Yes I'll shar that
{
id: 'pi_3QmejVGmD7nFHqiY1Gg6uTux',
params: '{"expand":["payment_method","latest_charge"]}',
options: { stripeAccount: 'acct_1QlyAGGmD7nFHqiY' }
}
Not to the payment intent, to the payment method. This confirmation request: https://dashboard.stripe.com/test/logs/req_HnascJLR1BPt6l shows a saved Payment Method already attached
This is the sample request for confirming payment intent in 2nd case
Okay yep that is basically the same flow
How are you collecting the Cashapp payment method details? These are already saved to the Customer, right?
beacause in both the cases when I'm passing mandate_data and when I'm not passing, I'm unable to confirm payment
Yes details are already saved
Should I send you how I'm creating subscription?
No, I can see that already
I'm not passing specific payment method type.
basically automatic_payment_method is enabled
Anything else is required from my side to reach the solution?
Not that I can see, no. https://docs.stripe.com/payments/cash-app-pay/accept-a-payment?web-or-mobile=web&payments-ui-type=elements
We don't document any additional requirements here
So what's the solution here? Why in my case it is not confirming.
I'm still looking
The only difference is that I'm using already saved payment method id to attach with the payment intent. And that too we are trying to sell an upsell product on a single click from the previous saved payment method of the cashapp.
Unfortunately, it looks like the failed requests are coming from India and the Customers are not based in the US. Cashapp is only supported for US customers: https://docs.stripe.com/payments/cash-app-pay
Then how the payment for the first product went through from cashapp only.
I'm trying to test it in test mode. I can change my location to US also using VPN
But first you have to be confirm that do I need to pass mandate_data while confirming payment intent or not. Because the error message is confusing in both the cases
I recommend trying that AND also saving the Customer address as in the US
Sorry but no, that order of operations is reversed. This may be a poorly worded error message and we must start with determining if using a customer in the correct country will work
Okay let me try with the VPN
Again the same error: When confirming a PaymentIntent with a cashapp PaymentMethod and setup_future_usage, mandate_data is required.
Can you share the request ID for the confirmation request?
{
id: 'pi_3QmfDhGmD7nFHqiY014SgBtv',
params: '{"expand":["payment_method","latest_charge"]}',
options: { stripeAccount: 'acct_1QlyAGGmD7nFHqiY' }
}
The IP address for this request is still showing as coming from India
req_SbEpWr0S8kBGwq
Still India
That is because I'm developing from my local
But the VPN is active and I can see BNPL payment methods like klarna, afterpay loading in the payment element which are not visible when VPN is off
The IP address for the request that attached the PM is based in the US https://dashboard.stripe.com/test/logs/req_4POMI86KDn7Lp9. so that is why Cashapp worked.
Now when I'm passing mandate data againe this error: mandate_data is not allowed because this payment intent already has a reusable Cash App Pay payment method attached to it
But your node code doesn't appear to be using the VPN
So that is causing this conflict
Then how it would be possible to test it from server side
Because this confirm request I'm hitting from backend
From server side only, I'm able to purchase one-time product. Because I'm passing confirm: true while creating payment intent
There I didn't use any VPN
But in purchasing recurring product, we create subscription with the fields which attaches an invoice to the subscription. And to that invoice this payment intent is attached. So here we cannot pass confirm: true as payment intent is automatically getting attached to the subscription on creating the subsciption
Whereas for one time product, we can controll confirm field while creating payment intent and hence it is going through succesfully
But in cas of subscription we can't
I notice you are creating the Subscription with payment_behavior: "default_incomplete". Since you have a saved payment method and you are specifying the default paymen method, can you try using payment_behavior: "allow_incomplete"?
I can try that but will need to check how it will effect the subscription behaviour
It worked. But my question is how my subscription will behave differently now on chaging this field
Because for other payment methods, payment_behavior: "default_incomplete" worked
Why for cashapp changing payment_behaviour to "allow_incomplete" is required
That is something I am still digging into
Okay let me know once you have answer
Okay so the issue is that using the default_incomplete behavior requires that you manually confirm the created payment intent. This payment intent is configured to save the associated payment method and set it up for future usage. For this, we require mandate data.
There is a separate checker that looks to see if you are attempting to overwrite an existing active mandate by passing in mandate data and blocks that action. This is the error you are hitting when you attempt to confirm with mandate data.
This all "just works" when you pass allow_incomplete because that payment behavior is what is recommended for off-session subscription creation. It assumes you already have a saved payment method configured for off-session usage so it doesn't create a Payment Intent with those properties. Instead it just confirms the payment intent.
So, the status and behaviour of subscription will remain as it is right? No change in the behaviour of subscription with respect to its status and cycle?
allow_incomplete and default_incomplete are configuration options for how the Subscription will start (whether we start in an active status and attempt payment immediately or start in an incomplete status and wait for payment to be confirmed).
Once the Subscription is created and the first payment is made, they behave the same
I recommend you review our descriptions of each behavior here: https://docs.stripe.com/api/subscriptions/create#create_subscription-payment_behavior
Sure Thanks. So just to be clear, in my previous approach a subscription was created in an active state and then if payment would fail subscription would change to incomplete. But in the new approach, a subscription would be created in an incomplete state and will remain incomplete if the payment is not confirmed. But if confirmed will move to active state. Am I right?
I think this behaviour would be reverse right?
The key difference is that allow_incomplete will attempt to confirm the Payment immediately and avoid passing the setup_future_usage parameter that is causing you to hit this error
allow_incomplete attempts to confirm the payment and become active immediately, default_incomplete waits for you to confirm the payment
Happy to shed what ๐ก I can ๐