#harshil-ahir_code
1 messages ¡ Page 1 of 1 (latest)
đ 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/1286313525110636545
đ 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.
- harshil-ahir_code, 1 hour ago, 10 messages
Hello
Hello
Are you charging this bank account immediately or just setting it up?
I am setting the customer bank account first then passing small amounts which was mention as
// List<Integer> amounts=new ArrayList<>();
// amounts.add(32);
// amounts.add(45);
// Map<String, Object> amount = new HashMap<>();
// amount.put("amounts", amounts);
and then i have try many things like
BankAccount bankAccount = (BankAccount) customer.getSources().retrieve(token.getBankAccount().getId());
// Map<String, Object> params = new HashMap<>();
// params.put("amounts", amounts);
//
// bankAccount.verify(params);
//// BankAccount resource =
//// BankAccount.retrieve("cus_9s6XGDTHzA66Po", "ba_1NAiwl2eZvKYlo2CRdCLZSxO");
//// BankAccountVerifyParams params =
//// BankAccountVerifyParams.builder().addAmount(32L).addAmount(45L).build();
//// BankAccount bankAccount = resource.verify(params);
Yeah you are mixing APIs here
PaymentMethod paymentMethod = PaymentMethod.create(paymentMethodParams);
LOGGER.info("before paymentMethod{}"+paymentMethod.getId());
// Attach the Payment Method to the Customer
PaymentMethod paymentMethodAttached = paymentMethod.attach(
PaymentMethodAttachParams.builder().setCustomer(user.getStripeCustomerId()).build()
);
LOGGER.info("before paymentMethod{}"+paymentMethodAttached.getId());
PaymentMethodVerifyParams params = PaymentMethodVerifyParams.builder()
.addAllAmount(amounts) // Amounts are micro-deposits (in cents)
.build();
// Verify the bank account (Payment Method)
PaymentMethod verifiedBankAccount = PaymentMethod.retrieve(paymentMethodAttached.getId()).verify(params);
In these can't able to call PaymentMethodVerifyParams
So let's pause
Okay
Answer my question from before
Are you trying to charge this PaymentMethod immediately?
Or just save it for later?
Immediately
My main target is to verified customer account
So you are collecting these bank account details from the customer and you are going to charge them for your product when you do so, correct?
No i am collecting bank account details from customer and then verify its bank account details
Okay
Then you want to use a SetupIntent here. You do this in place of the Customer attachment step as this will also attach the PaymentMethod to your Customer. So you create a SetupIntent and pass the PaymentMethod ID and Customer ID and you pass confirm: true. The API reference for a SetupIntent creation is here: https://docs.stripe.com/api/setup_intents/create
Then the SetupIntent moves to requires_action and you use the SetupIntent Verify Microdeposit endpoint to actually verify the bank account: https://docs.stripe.com/api/setup_intents/verify_microdeposits
In setup intent how can i pass the paymentMethodId and customerId
Look at the API reference -- there are parameters for customer and payment_method
Okay go it can you please dont close these chat for some time while i will check or confirm it
Sure
how can i know that the account is verifed or not with this api response https://docs.stripe.com/api/setup_intents/verify_microdeposits
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
com.stripe.exception.InvalidRequestException: PaymentMethods of type us_bank_account must be verified before they can be attached to a customer.; request-id: req_aeylGBxUDEVwDq
getting these type of error
The SetupIntent returned in the response will have status: succeeded
Yeah you need to remove that Attach request
The SetupIntent does that for you
Okay wait please dont close the ticket till i say its a request
com.stripe.exception.InvalidRequestException: The PaymentMethod provided (us_bank_account) is not allowed for this SetupIntent. Please attach a PaymentMethod of one of the following types: card. Alternatively update the allowed payment_method_types for this SetupIntent to include "us_bank_account".; code: setup_intent_invalid_parameter; request-id: req_lfcr0CbnY9JO4J
now getting these type of erro r
Seems pretty self-explanatory, no?
You are only passing payment_method_types: ['card']
sorry just bit in some tesnion
com.stripe.exception.InvalidRequestException: This SetupIntent cannot be actioned on because it has a status of requires_confirmation. Only a SetupIntent with one of the following statuses may be actioned on: ["requires_action"].; code: intent_invalid_state; request-id: req_qGnZdc8pFeFEDW
getting these error
Yep, you didn't pass confirm: true
Ohh okay wait
com.stripe.exception.InvalidRequestException: Missing required param: mandate_data.; code: parameter_missing; request-id: req_PO428wlFeKI73L
getting these errro
error
All the parameters are in the API Reference which I linked above
in that api its show "mandate": null
still can't getting what should i write for manadate in SetupIntentCreateParams
You pass mandate_data.customer_acceptance
And then you need to fill in the parameters based on how you collected mandate acceptance from your customers
How can i pass these as i am working on java spring boot
How i havent collected the mandate acceptance like something from customer
https://docs.stripe.com/payments/ach-debit#mandates discusses your reponsibility in collecting mandate agreement from your customer
I can't tell you how you should do that -- but your customer needs to agree to you charging them
This url is not working
In terms of how to pass these parameters in Java, you should look at the online Java doc: https://stripe.dev/stripe-java/index.html
package index
Sorry, edited
but i am not charging them now i want to just verify there bank account
Correct, you still have to collect mandate acceptance
how can i get that but ,and how it will effect in my code and any response
I can't tell you how you handle that -- this is an agreement between you and your customer. If they have implicitly agreed in the past to you charging their bank account then you can pass mandate_data.customer_acceptance.type: 'offline' to indicate they had previously agreed to you doing this.
but is there any way you now from that i can verify it
Yes you follow the steps I already provided
You confirm the SetupIntent and then use the Verify Micro Deposit endpoint
In live mode those micro deposits are sent to your customers bank account and they need to provide you the amounts to perform that verification
So does these code will work on live mode because in test mode its not working
?
It will behave the same in live mode -- you do need to get it working in test mode first.
its not working im not getting any idea that how can i solve these query for mandate_data error
Are you passing mandate_data in your API request?
declaration: package: com.stripe.param, class: SetupIntentCreateParams, class: MandateData
Yeah i find a way in chatgpt but it showing error on
.setMandateData(
SetupIntentCreateParams.MandateData.builder()
.setNotificationMethod(SetupIntentCreateParams.MandateData.NotificationMethod.DEFAULT) // Use the default if EMAIL is not valid
.build()
)
any thing i will attach after SetupIntentCreateParams.MandateData in setNotificationMethod
What is the error?
i am unable to get NotificationMethod.DEFAULT or anything after SetupIntentCreateParams.MandateData
i am getting options as CustomerAcceptance class,class,builder(),Builder class
I don't know what NotificationMethod.DEFAULT is...?
Where is NotificationMethod coming from?
That isn't a parameter you need here
so in these line what will i add
i find it in chatgpt so what will i write in setMandateData()
You need to add CustomerAcceptance: https://stripe.dev/stripe-java/com/stripe/param/SetupIntentCreateParams.MandateData.CustomerAcceptance.html
Don't use ChatGPT
You are the dev here
You need to write your own code
Chat GPT is not going to show you how to do this
Okay
still showing error after using it i also used it method as Offline,Online.Type ,class,builder
you can say i have used every method still its showing error
Just saying "it is showing error" does not help. Look at the error. What does it explicitly say? What does it indicate you should change.
I can't write your code for you
You need to debug here.
not showing any suggestion
Have you looked at your request in your Dashboard?
yeah but the thing is dont showing any suggestion
What is the explicit error message?
SetupIntentCreateParams.MandateData.CustomerAcceptance cannot be resolved to a variable
Hi taking over here
Hello
Can you share the code where you're getting this error
SetupIntentCreateParams params = SetupIntentCreateParams.builder()
.addPaymentMethodType("us_bank_account")
.setCustomer(customer.getId())
.setPaymentMethod(paymentMethod.getId())
.setConfirm(true)
.setMandateData(
SetupIntentCreateParams.MandateData.builder()
.setNotificationMethod(SetupIntentCreateParams.MandateData.CustomerAcceptance)
.build()
)
.build();
in setMandateData
PaymentMethodCreateParams paymentMethodParams = PaymentMethodCreateParams.builder()
.setType(PaymentMethodCreateParams.Type.US_BANK_ACCOUNT)
.setUsBankAccount(
PaymentMethodCreateParams.UsBankAccount.builder()
.setRoutingNumber("110000000")
.setAccountNumber("000123456789")
.setAccountHolderType(PaymentMethodCreateParams.UsBankAccount.AccountHolderType.INDIVIDUAL)
.build()
)
.setBillingDetails(
PaymentMethodCreateParams.BillingDetails.builder()
.setName("Test")
.build()
)
.build();
after these the above code which is giving error
PaymentMethod paymentMethod = PaymentMethod.create(paymentMethodParams);
SetupIntent setupIntent = SetupIntent.create(params);
SetupIntent resource = SetupIntent.retrieve(setupIntent.getId());
SetupIntentVerifyMicrodepositsParams param =
SetupIntentVerifyMicrodepositsParams.builder()
.addAmount(32L)
.addAmount(45L)
.build();
SetupIntent setupIntents = resource.verifyMicrodeposits(param);
These shows the whole code
you there??
Okay
can you dont close these thready for 24 hours because i need to leave my place in emergency and will start communication tomorrow
Oh
You'll need to open up a new thread then
We limit the number of threads we have open
But then how can i start continue the convo from here
There will be a link to this thread in the new thread
We don't keep threads open sorry
But you can start a new convo
that convo will start from here??
how can you just tell the process