#harshitbhargava
1 messages · Page 1 of 1 (latest)
Hello! The Payment Element will handle the mandate data for you. Have you had a look at this guide? https://stripe.com/docs/payments/cash-app-pay/accept-a-payment?platform=web&ui=elements#web-collect-payment-details
Actually we are not using PaymentElement in this flow, we have paymentMethod already so I am directly confirming the payment
Ah, okay, so you want the Direct API version of the guide: https://stripe.com/docs/payments/cash-app-pay/accept-a-payment?platform=web&ui=API
so in that I am getting error mandate_data is required
https://stripe.com/docs/api/payment_intents/confirm#confirm_payment_intent-mandate_data
what does online/offline mean
In what context?
mandate_data.customer_acceptance.type
In this what does online /offline mean?
Can you give me the request ID where you're seeing the error? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Offline means they didn't do it online. Maybe they were standing in your store talking to your clerk, for example. Online means they provided the mandate online, so you have an IP and user agent to provide to the API.
//Removing code
so this is my code, and when I am trying to pay through this it is giving me error, mandate is required
So you're trying to use a previously-saved CashApp Payment Method?
Or are you trying to set up a CashApp Payment Method for future use and also take a payment at the same time?
The main issue is that you're setting SetupFutureUsage. That's telling the API that you want to set this Payment Method up for future use, which requires a mandate, but that should have already been done. I think what you need is here: https://stripe.com/docs/payments/cash-app-pay/set-up-payment?platform=web&ui=API#web-create-payment-intent
This thing will work with card /google pay/ apple pay also?
I think setup_future_usage is not needed in above code , if payment method is already in customer account, right?
Correct.
And yes, this will work with cards and other wallets in basically the same way.
and just want to confirm one thing, why apple pay and google pay is not present in payment_method_types?
Apple Pay and Google Pay are subsets of the card type.
ok
You must provide a return_url when confirming a PaymentIntent with the payment method type cashapp.
Now I am getting this error
Can you give me the request ID so I can take a look?
deleting
You didn't specify off_session in that request. Compare your request to the code snippet here: https://stripe.com/docs/payments/cash-app-pay/set-up-payment?platform=web&ui=API#web-create-payment-intent
I have removed setup_future_usage, as what we have discussed
That's a separate thing.
got it my bad
There's a setup_future_usage property which takes values of off_session and on_session. Separately there's an off_session property that takes values of true and false.
btw what does off session means?
This PaymentIntent requires a mandate, but no existing mandate was found. Collect mandate acceptance from the customer and try again, providing acceptance data in the mandate_data parameter.
Can you give me the request ID for that one?
//Deleting
Looking...
Oh, the mandate status is pending. It looks like the original Payment Intent with setup_future_usage was never completed.
That Payment Intent's status is requires_action.
So the Payment Method was never set up for future use properly.
I am not getting you, where i have to make chnages for this
Have a look at this request: https://dashboard.stripe.com/test/logs/req_MLDtOp6Ac4Vvfb
That's the last request made on the original Payment Intent, when the Payment Intent confirmation was attempted, but in the response you can see a next action is required. That next action was never taken, so the Payment Intent never succeeded, and the set up for future use was never performed, and the mandate is not usable.
For CashApp to work for future, off-session payments you need to set up the Payment Method with either a Setup Intent or a Payment Intent with setup_future_usage. You started the process with the Payment Intent, but never finished.
oh got it
Thanks for the support