#facu_code

1 messages · Page 1 of 1 (latest)

tacit urchinBOT
#

đź‘‹ 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/1285984673054593034

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

cedar island
#

That is surprising. Can you send me the ID of an android payment that you saw this issue on?

pseudo vigil
#

Hi Pompey, this is the last payment intent ID I just tried to pay

#

payment_intent": {
"id": "pi_3Q0PnMFzbHzjdKYx1TSh4VRh",
"object": "payment_intent",
"amount": 400,
"amount_details": {
"tip": {
}
},

cedar island
#

Can you show me the code for that specific confirm call? It looks to be different than the one you provided code for (type isn't card and such)

#

I thought that you didn't need to pass mandate data for an already saved ACH PM. Trying to think of what may be happening here

pseudo vigil
#

The code I use is the same for both card and ach

#

confirmPayment(getIntentByInvoice[0].stripeClientSecret, {
paymentMethodType: 'Card',
paymentMethodData: {
paymentMethodId: selectedPaymentMethod.stripeId,
mandateData: {
customerAcceptance: {
online: {
userAgent: userAgent,
ipAddress: ipAddress!,
},
},
},
},
}, {
setupFutureUsage: 'OffSession',
});

#

I’m sharing the same request, but this time made from iOS, where the payment is processed correctly and it doesn’t return the Android error.

#

"id": "pi_3Q0PMFFzbHzjdKYx10Z3RJkU",
"object": "payment_intent",
"amount": 300,
"amount_details": {
"tip": {
}
},

#

The error that appears in the console when I try to pay with Android and the error occurs is this

{"error": {"code": "Failed", "declineCode": null, "localizedMessage": "When confirming a PaymentIntent with a us_bank_account PaymentMethod and setup_future_usage, mandate_data is required.", "message": "When confirming a PaymentIntent with a us_bank_account PaymentMethod and setup_future_usage, mandate_data is required.", "stripeErrorCode": null, "type": "invalid_request_error"}}

tacit urchinBOT
covert cloak
#

Hello! I'm taking over and catching up...

#

Can you remove paymentMethodType: 'Card', from your code and try again? You shouldn't specify Card for an ACH transaction.

#

I think specifying Card might be causing the Android SDK to drop some of those parameters.

pseudo vigil
#

Hello Rubeus!

#

The problem is that when I set ACH, it asks for data that I can’t access, as these are saved payment methods in Stripe, and I can’t access them fully

paymentMethodData: {
accountNumber: '',
routingNumber: '',
billingDetails: {
name: ''
}

covert cloak
#

Right... I'm not saying to change it, I'm saying to remove that line entirely. Does that not work?

pseudo vigil
#

Ahhh okay, let me try it

#

I can’t, it necessarily asks me for a paymentMethodType

#

{"error": {"code": "Failed", "declineCode": null, "localizedMessage": "You must provide paymentMethodType", "message": "You must provide paymentMethodType", "stripeErrorCode": null, "type": null}}

covert cloak
#

Hm, interesting. I wouldn't have expected that to be required when you're also specifying a specific, existing Payment Method. Hang on...

#

Wait, how are you creating the Payment Method? Where is it coming from?

pseudo vigil
#

From Stripe, I create it beforehand and then the data is used to attempt to charge the payment

covert cloak
#

How did you create it?

pseudo vigil
#

await initPaymentSheet({
merchantDisplayName: 'Cinch',
customerId: profile.stripeCustomerId,
setupIntentClientSecret: createIntent.stripeClientSecret,
allowsDelayedPaymentMethods: true,
primaryButtonLabel: t('ADD_PAYMENT_METHOD'),
});

    // ===== Show payment sheet ===== //
    const {error} = await presentPaymentSheet();
covert cloak
#

So that happens at some point in the past, then days/weeks later you're trying to pay an Invoice using that previously saved ACH Payment Method?

#

Or is that happening immediately before the Invoice payment?

pseudo vigil
#

Both cases can happen, the result is the same on Android, but on iOS it always works

covert cloak
#

I understand it works on iOS, but frankly that seems to be a fluke.

#

What happens if you only call confirmPayment(getIntentByInvoice[0].stripeClientSecret) with no additional arguments?

#

Oh, wait, the Payment Method isn't associated with the Invoice yet, right?

#

If you wanted to use an existing saved Payment Method that's where I'm getting a bit stuck, because the React Native SDK doesn't allow you to pass the correct options for that...

#

You might have to update the Payment Intent server side to add the Payment Method before calling confirmPayment in your app.

pseudo vigil
pseudo vigil
covert cloak
#

You shouldn't need to specify mandate data for an already collected and saved ACH account. It should use the mandata data from the initial setup.

pseudo vigil
#

Right, okay, I’ll try this. Give me a few minutes to check if the backend team has already tried this before and if we can do it right away?

covert cloak
#

Sounds good.

#

We do close idle threads after a bit, but you can always create a new thread from #help if that happens. 🙂