#chunyu-ach-verification

1 messages · Page 1 of 1 (latest)

frosty driftBOT
scarlet flame
#

@jade silo what's your question?

#

chunyu-ach-verification

#

Please don't send pictures of code. You can share real code here as text

jade silo
#

here is my code, and i get response like "com.stripe.exception.InvalidRequestException: When confirming a PaymentIntent with a us_bank_account PaymentMethod and setup_future_usage, mandate_data is required.; request-id: req_p5fdQFsNvUGr1k

"

#

it seems that i need to set "mandate_data" ?

scarlet flame
#

you deleted your code's picture and never re-shared the code

#

where does that pm_12345 come from?

jade silo
#

PaymentIntentCreateParams.Builder params =
PaymentIntentCreateParams.builder()
.setAmount()
.setCurrency()
.setCustomer();

params.addPaymentMethodType(StripePaymentMethodType.US_BANK_ACCOUNT.getValue());
params.addPaymentMethodType(StripePaymentMethodType.CARD.getValue());
params.setPaymentMethod(paymentMethod);
params.setConfirm(true);

params.setSetupFutureUsage(PaymentIntentCreateParams.SetupFutureUsage.OFF_SESSION);
params.setPaymentMethodOptions(PaymentIntentCreateParams.PaymentMethodOptions
.builder()
.setUsBankAccount(PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount
.builder()
.setVerificationMethod(
PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod.INSTANT
)
.build()
).build()
);

#

here is my code to create request

scarlet flame
#

params.setPaymentMethod(paymentMethod);

#

where does paymentMethod come from though?

jade silo
#

it is from my source code , i will be set as 'us_bank_account'

#

are you still with me sir?

scarlet flame
#

I am, there are just 10 other people with many questions

#

I'm sorry but you aren't giving me much/anything

#

params.setPaymentMethod(paymentMethod); expects a PaymentMethod id pm_123. You can not pass us_bank_account there

#

you likely are mixing things up in what your code does. It is currently passing a pm_123, I'm asking where that id came from

jade silo
#

yes i get it. the PaymentMethod id is "pm_1LzExtCw4MyjxsUiDFPbP6vx"

#

it is from stripe

#

this id is from stripe when i created the paymentMethod

#

i can see the paymentIntent status in stripe management platform that is "requires_confirmation"

scarlet flame
#

Where did that pm_123 come from? How did you create it

jade silo
#

when i add a new card for payment, i can get the paymentMethod ID from stripe

scarlet flame
#

what does that mean

#

what does "I add new card for payment" mean. And this is for ACH, that has nothing to do with card payments

jade silo
#

"pm_1LzExtCw4MyjxsUiDFPbP6vx" is my paymentMethohd ID

#

i mean i add a new paymentMethod,and then stripe gave me the paymentMethod ID

scarlet flame
#

I'm sorry this still doesn't make any sense to me 😩

#

what does "I add a new paymentMethod" mean? What do you do? As the developer, what code or tool or API do you use to create that PaymentMethod?

jade silo
#

ok wait me a moment

#

the API is "collectBankAccountForSetup"

#

does these message make sense sir?

scarlet flame
#

Did you ever confirm that SetupIntent?

#

also please no pictures of code. Just copy paste the code as text here, way easier for me to help you

jade silo
#

yes. i have set confirm param when the Intent created

#

params.setConfirm(true);

scarlet flame
#

I'm really sorry, you need to please add more details to your words

#

you say when the Intent created. Which intent? There are SetupIntents and PaymentIntents

jade silo
#

PaymentIntent i mean

scarlet flame
#

The picture of code above is for a SetupIntent and it collects the PaymentMethod. Did you confirm that SetupIntent?

jade silo
#

yes i have confirm the SetupIntent

scarlet flame
#

Can you share the exact SetupIntent id seti_123 for that specific one?

#

I don't see you confirming any SetupIntent anywhere recently

#

I see you create one but never confirm one which would happen after the code in your picture, client-side, in Javascript

jade silo
#

if (setupIntent?.status === 'requires_confirmation') {
const { setupIntent: confirmIntent, error: confirmError } = await stripe.confirmUsBankAccountSetup(saveSecret)

#

this is the code in Javascript to confirm

scarlet flame
#

I don't think you called this

jade silo
#

are you sure my friend

#

actually i have created the PaymentIntent

lyric nebula
#

Hi there 👋 taking over for @scarlet flame

Can you copy/paste that Payment Intent ID so I can take a closer look? The requires_confirmation status seems to indicate that confirmation never actually happened or was attempted and failed.

jade silo
#

pi_3LzNVQCw4MyjxsUi1IYHSQfF

#

thanks

#

i make sure that when the SetUpIntent created, i is confirmed

#

{
“id”: “seti_1LzOPGCw4MyjxsUiLrkYN5b4",
“object”: “setup_intent”,
“cancellation_reason”: null,
“client_secret”: “seti_1LzOPGCw4MyjxsUiLrkYN5b4_secret_Miq5tYU6RM0Fm6ZKUy8piO8AnDdiIb1”,
“created”: 1667324266,
“description”: null,
“last_setup_error”: null,
“livemode”: true,
“next_action”: null,
“payment_method”: “pm_1LzOSUCw4MyjxsUiBc1vD1OD”,
“payment_method_options”: {
“us_bank_account”: {
“verification_method”: “automatic”
}
},
“payment_method_types”: [
“card”,
“us_bank_account”
],
“status”: “succeeded”,
“usage”: “off_session”
}

lyric nebula
jade silo
#

i havenot tried yet

#

what the value should i set?

#

are you still with me sir

#

i set mandate_data as "params.setMandateData(PaymentIntentCreateParams.MandateData.builder()
.setCustomerAcceptance(PaymentIntentCreateParams.MandateData.CustomerAcceptance.builder()
.setOffline(PaymentIntentCreateParams.MandateData.CustomerAcceptance.Offline.builder().build()).build()).build());"

#

right?

lyric nebula
#

I'm here. Apologies, the server is still very busy

#

I'm unsure of the exact syntax, but as long as you're including the required parameters (which it looks like you are), then that should work. Can you run it and test if it works now?

jade silo
#

ok i will test it now

jade silo
#

sorry to disturb

#

i set the param as the pic shows

#

but it doesnot work

lyric nebula
#

What doesn't work? What do you mean by that?

jade silo
#

it seems that i cant set the mandate_data to the request

lyric nebula
#

Do you get an error?

jade silo
#

yes

lyric nebula
#

If not, what is the Payment Intent ID of the Payment Intent that you tried to set the mandate_data on?

jade silo
#

"message": "When confirming a PaymentIntent with a us_bank_account PaymentMethod and setup_future_usage, mandate_data is required."
"type": "invalid_request_error"

lyric nebula
#

Can you copy/paste the request ID where you attempted to set the mandate_data?

Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request

jade silo
#

pi_3LzPAXCw4MyjxsUi1CDya27m

#

the request body doesnot contain ”mandate_data“,so it seems it isnot set correctly?

lyric nebula
#

Can you post the entire code that you're using to set mandate_data?

jade silo
#

PaymentIntentCreateParams.Builder params =
PaymentIntentCreateParams.builder()
.setAmount(money.getAmount())
.setCurrency(money.getCurrency())
.setCustomer(channelChargeCreateParams.getChannelAccountId());

#

params.addPaymentMethodType(StripePaymentMethodType.US_BANK_ACCOUNT.getValue());
params.addPaymentMethodType(StripePaymentMethodType.CARD.getValue());
params.setPaymentMethod(channelChargeCreateParams.getPaymentMethodId());
params.setConfirm(true);
params.setMandateData(PaymentIntentCreateParams.MandateData.builder()
.setCustomerAcceptance(PaymentIntentCreateParams.MandateData.CustomerAcceptance.builder()
.setOffline(PaymentIntentCreateParams.MandateData.CustomerAcceptance.Offline.builder().build()).build()).build());

#

params.setSetupFutureUsage(PaymentIntentCreateParams.SetupFutureUsage.OFF_SESSION);
params.setPaymentMethodOptions(PaymentIntentCreateParams.PaymentMethodOptions
.builder()
.setUsBankAccount(PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount
.builder()
.setVerificationMethod(
PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.VerificationMethod.INSTANT
)
.build()
).build()
);

#

are you still with me sir?

lyric nebula
#

Yes, I just need a few minute to find someone who's more familiar with Java to assist. Apologies for the wait

jade silo
#

ok thanks alot

cunning coyote
#

hey there, taking a look at this for you, let me review

jade silo
#

the problem is i cant set param "mandate_data" sir

jade silo
#

ok let me try it and give you answer sir

jade silo
#

it works !

#

thanks very much

cunning coyote
#

Great!