#chunyu-ach-verification
1 messages · Page 1 of 1 (latest)
@jade silo what's your question?
chunyu-ach-verification
Please don't send pictures of code. You can share real code here as text
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" ?
you deleted your code's picture and never re-shared the code
where does that pm_12345 come from?
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
params.setPaymentMethod(paymentMethod);
where does paymentMethod come from though?
it is from my source code , i will be set as 'us_bank_account'
are you still with me sir?
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
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"
Where did that pm_123 come from? How did you create it
when i add a new card for payment, i can get the paymentMethod ID from stripe
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
"pm_1LzExtCw4MyjxsUiDFPbP6vx" is my paymentMethohd ID
i mean i add a new paymentMethod,and then stripe gave me the paymentMethod ID
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?
ok wait me a moment
the API is "collectBankAccountForSetup"
does these message make sense sir?
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
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
PaymentIntent i mean
The picture of code above is for a SetupIntent and it collects the PaymentMethod. Did you confirm that SetupIntent?
yes i have confirm the SetupIntent
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
if (setupIntent?.status === 'requires_confirmation') {
const { setupIntent: confirmIntent, error: confirmError } = await stripe.confirmUsBankAccountSetup(saveSecret)
this is the code in Javascript to confirm
I don't think you called this
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.
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â
}
Okay, so circling back, you're receiving the error "When confirming a PaymentIntent with a us_bank_account PaymentMethod and setup_future_usage, mandate_data is required."
Have you tried supplying the mandate_data on the Payment Intent prior to confirmation: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-mandate_data
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?
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?
ok i will test it now
What doesn't work? What do you mean by that?
Do you get an error?
yes
If not, what is the Payment Intent ID of the Payment Intent that you tried to set the mandate_data on?
"message": "When confirming a PaymentIntent with a us_bank_account PaymentMethod and setup_future_usage, mandate_data is required."
"type": "invalid_request_error"
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
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
pi_3LzPAXCw4MyjxsUi1CDya27m
the request body doesnot contain âmandate_dataâ,so it seems it isnot set correctly?
Can you post the entire code that you're using to set mandate_data?
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?
Yes, I just need a few minute to find someone who's more familiar with Java to assist. Apologies for the wait
ok thanks alot
hey there, taking a look at this for you, let me review
the problem is i cant set param "mandate_data" sir
Ok, i think i see the issue
Instead of using setOffline I think you need to use setType at the inner layer:
https://stripe.com/docs/api/setup_intents/create#create_setup_intent-mandate_data-customer_acceptance-type
type is the required parameter, with a value of offline
Can you give that a try?
ok let me try it and give you answer sir
Great!