#shalu-kumari_api

1 messages ยท Page 1 of 1 (latest)

silk harborBOT
#

๐Ÿ‘‹ 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/1285545753715933239

๐Ÿ“ 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.

trail anvil
#

What's the error message?

eternal crag
#

PaymentMethods of type us_bank_account must be verified before they can be attached to a customer.

trail anvil
#

I see you're creating the PaymentMethod by just calling POST /v1/payment_methods which won't work. You need to go through a Payment Method setup flow to be able to attach it to the Customer: https://docs.stripe.com/payments/save-and-reuse

eternal crag
#

But I need to used the API request

trail anvil
#

What do you mean?

eternal crag
#

Hey I need the payment Successful based on Ach method using curl rest api request
Here is the followed step

  1. create customer - done
  2. Create payment method - done
  3. create payment intent - done
  4. Verify the payment intent - done
    Now I am using again same payment method id and customer id to create the payment intent then showing error
    However, when I try to reuse the above payment method ID, I encounter an error.

The provided Payment Method cannot be attached. To reuse a PaymentMethod, you must attach it to a Customer first.

when i resolving this issue that need to attached the customer first in the payment method

Noted First time payment done successfully ,But need to future as i need those payment method attached their customer.
Please resolved this issue

trail anvil
#

Here is the followed step
Where did you get these steps from?

eternal crag
#

give a min i am creating the log in stripe account for all the step

#

hey i have creating the log

#

please checked

#

First time created successful payment - req_lgFKulwGtyEekw
Second time error shown - req_D8GboxzkPGdr5D

trail anvil
trail anvil
silk harborBOT
eternal crag
#

If I am using invalid param for payment method ,Can you provide the valid param so can i hit the API request and checked it,If you want some other another api please suggest me give the api ,Please don't provide the document

cunning wolf
#

Happy to answer any questions you have about that guide

eternal crag
cunning wolf
#

Sure, the error is pretty verbose right? It explains the problem with that request quite clearly

#

If you follow the guide I linked, you'll see that the Setup Intent is created without the payment_method parameter. The pm_xxx is generated by the Setup Intent once it is successfully confirmed

eternal crag
#

when i go to setup intent confirmed then need to be payment method ,I'm passing the payment method id then showing an error
here is the error req_D8GboxzkPGdr5D

cunning wolf
#

Yep, because pm_1PzyQa2KmEgiewTQ9VhdEuAZ is not attached to a customer. If you created it correctly via the Setup Intent flow I linked then that would handle this for you

eternal crag
#

so how we can attach the customer becuse already they give error

cunning wolf
#

Right now you're creating Payment Method objects (pm_xxx) manualy through the API and that is not the corect way to integrate. It doesn't correctly save the details for reuse, it doesn't correctly setup the banking details with a mandate

eternal crag
#

when i attach the customer then shown an error
req_dniQOh1wpAwdCJ

cunning wolf
#

The guide I've linked is the correct way to collect ACH details and save them for future payments

eternal crag
#

can you please do that ?

cunning wolf
#

Can I please do what?

eternal crag
#

the above task

cunning wolf
#

No, we don't write code here

eternal crag
#

if you are unable to do, kindly assign it to other agent

noble sluice
#

hi! I'm taking over this thread.

eternal crag
#

hey as per the documents i have 1 and 2 steps done but the 3 rd step for verify the setup intent then showing an error
request id - req_D8GboxzkPGdr5D
after that i have tried to attached the customer then also giving an error if i am wrong then can you please do that
here is the attached customer error- req_dniQOh1wpAwdCJ
my client don't want to used the payment method handle in the font side then want used in the backed side

noble sluice
#

you didn't follow the guide at all. you didn't use a SetupIntent to create the PaymentMethod.

eternal crag
#

here is the request id from create setup intent and i have not used the payment method- req_uyak1q3LLQAnrZ
there status is requires_payment_method

noble sluice
#

great! so now you need to do step 3 to collect the payment method for the SetupIntent.

eternal crag
#

In the third step they showing the client side -script.js
I need to used server side

noble sluice
#

you want the user to enter their banking information themselves, so you should use Stripe.js on the frontend for this.

eternal crag
#

hey i have already bank information in my data i want only used in the payment method

noble sluice
#

as you saw earlier (req_CgWec0ymD8QG0F), you cannot attach a bank account payment method to a customer without verifying it first. so you have to do this on the frontend with Stripe.js

eternal crag
#

yes you right ,I have tried to attached the bank account method to a customer so they give error req_dniQOh1wpAwdCJ and also i have mentioned to you don't used frontend side.

silk harborBOT
eternal crag
#

hey is there way to achived that then please provide me Otherwise you can provide the formate this is not possible so i can shared with the client

lost vapor
#

You can actually do this, but instead of attached it like this, you should use the PM to confirm a setup intent

#

that will allow your customer to verify the bank account and when the setup intent is successful, the bank account PM will be attached to the customer

#

Create a setup intent specifying the customer, payment_method and confirm=true

eternal crag
#

wait

#

same error req_KB9YPlEIDETDZs

lost vapor
#

That's not the same error

#

It is an error yes, but the message is very different

eternal crag
#

๐Ÿ˜ช

lost vapor
#

You already use that payment method. Unless set up for future use & attached, payment methods are one-time-use only.

#

Create the payment method again from the bank details and try that request

#

You need to do the setup intent as the very first thing you do with that payment method

#

What's the customer flow here, roughly speaking?

eternal crag
#

I have create new account yesterday's there is no any transaction is created only one payment method and one customer then also this type error i have verified

#

here is my new account you can also checked - acct_1PzZcnRvep6oj5IC

lost vapor
lost vapor
#

That's a stripe account id

eternal crag
#

yes , this is new stripe account .i have created the customer ,and payment method .
when create the setup intent the show error req_vwAv1fA76LiwUS

lost vapor
#

the stripe account shouldn't matter here, just the sequence for the bank payment method

#

interesting. in this case there is no payment. OK.

eternal crag
#

yes

#

so ,In this case what be next step?

lost vapor
#

I'm testing the flow, give me a few more min

#

When i test this flow, I'm able to confirm the setupintent and get into a requires_action state

eternal crag
#

yaa thanks

lost vapor
#

Trying to figure out how your flow is different

#

i am creating the PM the same as your example

#

then confirming a setup intent like this:

curl --request POST \
  --url https://api.stripe.com/v1/setup_intents \
  -u sk_test_123: \
  --data 'payment_method_types[]=us_bank_account' \
  --data confirm=true \
  --data customer=cus_123 \
  --data usage=off_session \
  --data 'mandate_data[customer_acceptance][accepted_at]=1726580125' \
  --data 'mandate_data[customer_acceptance][online][ip_address]=1.1.1.1' \
  --data 'mandate_data[customer_acceptance][online][user_agent]=cooool' \
  --data 'mandate_data[customer_acceptance][type]=online' \
  --data payment_method=pm_456
eternal crag
#

let me checked

#

yes

lost vapor
#

Oh, i see

#

when you got the error about needed mandata_data

#

Create another new unused PM and try your now complete setup intent request again

eternal crag
#

mandata_data is required i have forgot ,
but i create the new the again setup intent for paymnet then you can checked the next log -req_o5eK2PIhChfBz9

silk harborBOT
lost vapor
#

You're still using that same PM id

#

You cannot use that

#

you need to create a new payment method

#

Throw away pm_1PzaANRvep6oj5ICJON3mR1U and forget it ever existed

#

you can't use it for anything any more

eternal crag
#

okay wait i trying

#

i have create the seti_1Q02VWRvep6oj5ICy8sy8zkm

#

then next step

#

hey are you available?

lost vapor
#

Glad you were able to get that part working! My colleague @devout dove can help you from here, but broadly you need to now handle the next_action to complete the verification, in this case your customer will receive microdeposit(s) to their account and will need to provide details from that at the URL

eternal crag
#

so how can achived this?

devout dove
#

Hi there ๐Ÿ‘‹ you either direct your customer to the hosted_verification_url provided in the next_action hash on the intent if you want to surface the verification flow to the customer, or you collect the mircodeposit amounts/verification code from your customer and make a request to verify the provided details:
https://docs.stripe.com/api/payment_intents/verify_microdeposits

eternal crag
#

i have verify done so how we can payment amount give

#

How to create the transaction after the setup inetnte is verified

devout dove
#

Once you have the verified Payment Method you create a Payment Intent to process a payment with it.

eternal crag
#

so how we can paymnet method on this verifyed setup inetnt

devout dove
#

I don't understand what you're trying to ask, would you mind trying to rephrase the question?

eternal crag
#

okay i will tried and update to you for payment

#

successful done or not