#harshil-ahir_code

1 messages ¡ Page 1 of 1 (latest)

dim berryBOT
#

👋 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.

wind cargo
#

Hello

supple fox
#

Hello

wind cargo
#

Are you charging this bank account immediately or just setting it up?

supple fox
#

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);

wind cargo
#

Yeah you are mixing APIs here

supple fox
#

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

wind cargo
#

So let's pause

supple fox
wind cargo
#

Answer my question from before

#

Are you trying to charge this PaymentMethod immediately?

#

Or just save it for later?

supple fox
#

My main target is to verified customer account

wind cargo
#

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?

supple fox
wind cargo
#

Okay so you aren't charging immediately

#

Just collecting and verifying

supple fox
#

No

#

I just want to verify there account

wind cargo
#

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

supple fox
wind cargo
#

Look at the API reference -- there are parameters for customer and payment_method

supple fox
#

Okay go it can you please dont close these chat for some time while i will check or confirm it

wind cargo
#

Sure

supple fox
#

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

wind cargo
#

The SetupIntent returned in the response will have status: succeeded

#

Yeah you need to remove that Attach request

#

The SetupIntent does that for you

supple fox
#

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

wind cargo
#

Seems pretty self-explanatory, no?

#

You are only passing payment_method_types: ['card']

supple fox
#

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

wind cargo
#

Yep, you didn't pass confirm: true

supple fox
#

Ohh okay wait

#

com.stripe.exception.InvalidRequestException: Missing required param: mandate_data.; code: parameter_missing; request-id: req_PO428wlFeKI73L

getting these errro

#

error

wind cargo
#

Yep you need to pass mandate_data here

#

Sorry, I didn't mention that

supple fox
#

Where can i get that

#

Can you give that code

wind cargo
#

All the parameters are in the API Reference which I linked above

supple fox
#

in that api its show "mandate": null

supple fox
#

still can't getting what should i write for manadate in SetupIntentCreateParams

wind cargo
#

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

supple fox
#

How can i pass these as i am working on java spring boot

supple fox
wind cargo
#

I can't tell you how you should do that -- but your customer needs to agree to you charging them

wind cargo
wind cargo
supple fox
wind cargo
#

Correct, you still have to collect mandate acceptance

supple fox
#

how can i get that but ,and how it will effect in my code and any response

wind cargo
#

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.

supple fox
wind cargo
#

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

supple fox
wind cargo
#

?

#

It will behave the same in live mode -- you do need to get it working in test mode first.

supple fox
#

its not working im not getting any idea that how can i solve these query for mandate_data error

wind cargo
#

Are you passing mandate_data in your API request?

supple fox
#

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

wind cargo
#

What is the error?

supple fox
#

i am unable to get NotificationMethod.DEFAULT or anything after SetupIntentCreateParams.MandateData

#

i am getting options as CustomerAcceptance class,class,builder(),Builder class

wind cargo
#

I don't know what NotificationMethod.DEFAULT is...?

#

Where is NotificationMethod coming from?

#

That isn't a parameter you need here

supple fox
supple fox
wind cargo
#

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

supple fox
#

Okay

supple fox
wind cargo
#

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.

wind cargo
#

Have you looked at your request in your Dashboard?

supple fox
wind cargo
#

What is the explicit error message?

dim berryBOT
supple fox
#

SetupIntentCreateParams.MandateData.CustomerAcceptance cannot be resolved to a variable

raw jackal
#

Hi taking over here

supple fox
#

Hello

raw jackal
#

Can you share the code where you're getting this error

supple fox
#

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);

supple fox
#

you there??

raw jackal
#

I'm in many threads

#

You'll need to be patient

supple fox
#

can you dont close these thready for 24 hours because i need to leave my place in emergency and will start communication tomorrow

raw jackal
#

Oh

#

You'll need to open up a new thread then

#

We limit the number of threads we have open

supple fox
#

But then how can i start continue the convo from here

raw jackal
#

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

supple fox
#

that convo will start from here??

supple fox
raw jackal
#

I don't know what you're asking

#

If a thread is inactive for more than an hour or so we close

#

You can always open a new one and someone will come in and help you