#arpit-gupta_cashapp-subscription-behavior

1 messages ยท Page 1 of 1 (latest)

spice tokenBOT
#

๐Ÿ‘‹ 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.

vagrant helm
#

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?

buoyant kraken
#

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

vagrant helm
#

Do you have an example Payment Intent confirm request with that error?

buoyant kraken
#

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' }
}

vagrant helm
buoyant kraken
#

This is the sample request for confirming payment intent in 2nd case

vagrant helm
#

Okay yep that is basically the same flow

buoyant kraken
#

So what is expected here?

#

How would I successfully confirm the payment intent?

vagrant helm
#

How are you collecting the Cashapp payment method details? These are already saved to the Customer, right?

buoyant kraken
#

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?

vagrant helm
#

No, I can see that already

buoyant kraken
#

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?

vagrant helm
buoyant kraken
#

So what's the solution here? Why in my case it is not confirming.

vagrant helm
#

I'm still looking

buoyant kraken
#

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.

vagrant helm
buoyant kraken
#

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

vagrant helm
#

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

buoyant kraken
#

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.

vagrant helm
#

Can you share the request ID for the confirmation request?

buoyant kraken
#

{
id: 'pi_3QmfDhGmD7nFHqiY014SgBtv',
params: '{"expand":["payment_method","latest_charge"]}',
options: { stripeAccount: 'acct_1QlyAGGmD7nFHqiY' }
}

vagrant helm
#

The IP address for this request is still showing as coming from India

buoyant kraken
#

req_SbEpWr0S8kBGwq

vagrant helm
#

Still India

buoyant kraken
#

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

vagrant helm
buoyant kraken
#

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

vagrant helm
#

But your node code doesn't appear to be using the VPN

#

So that is causing this conflict

buoyant kraken
#

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

vagrant helm
#

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"?

buoyant kraken
#

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

vagrant helm
#

That is something I am still digging into

buoyant kraken
#

Okay let me know once you have answer

vagrant helm
#

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.

buoyant kraken
#

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?

vagrant helm
#

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

buoyant kraken
#

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?

vagrant helm
#

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

buoyant kraken
#

Got it.

#

Thanks a lot

vagrant helm
#

Happy to shed what ๐Ÿ’ก I can ๐Ÿ™‚

spice tokenBOT