#zen-card-cloning
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Can you share the Request ID for the API request that returns the error?
req_VBBtmHtV5zEQIW
The payment method used here was created in this request: https://dashboard.stripe.com/test/logs/req_NS2brp3jlkpEb9 which was made directly on the platform so the PM was not created on the Connected Account
sure..i thought that i am cloning it to be used against the connected account though?
i mentioned I ran a call to get a new payment method id...
Am I not understanding what is meant by "cloning" ?
The call to create the Payment method did not include the Stripe Account header
Which we show in the last code snippet in the doc you referenced
https://dashboard.stripe.com/test/logs/req_NS2brp3jlkpEb9 here is the request
No Stripe Account header present
hmm.. ok, let me focus on that part then and see if I can't get it to work
hang on
why does it show the request having a token? in my postman I am sending a customer id, a payment method id and the account header
that request body does not seem to be what I am actually sending
let me try it again and grab request id
ok, can you review this one ? https://dashboard.stripe.com/test/logs/req_go0RjbP9YnJ6n5
that is what I am sending to "clone" the payment method
and then I'd use the returned payment_method id + existing customer id.....
@woeful inlet any thoughts?
Okay and what happens when you try to charge this payment method?
that is when I get that error I initially mentioned
Can you share the API request that returns an error using the newly generated Payment Method ID pm_1NUuxoGg57Ont9I34gIqZNon?
one sec... I think I see what is going on
req_3fASbJFyObgAH1
ok, this is the new error
No such customer: 'cus_OHSjyYpzU6Irl8'
Shouldn't I be using the customer id I got back in the original charge that went to the platform account?
No it needs to be a Customer that exists on the Connected Account as well
At the end of this doc we say you will need to attach the new payment method to a Customer if you want to re-use it
That customer needs to be on the Connected Account
so the steps then are
- clone the payment method
- create a new customer on the connected account
- ????
- Process the charge with new customer id and new payment method id
for unknown step 3... do I need to attach that payment method to the customer object or will that be done as part of the PaymentIntent creation?
What is the reason for you to want to re-use that specific PaymentMethod on the connected account @marble light
zen-card-cloning
i was thinking it'd be "setup already" if we need to charge that customer/payment method again as a direct charge which is possible in our use case
Usually you just clone again next time. That way if the PaymentMethod changed since then your flow still works
ok, so we should just clone/create new each time if this flow is invoked
yes that's what we recommend
ok, let me try it out with this approach
sorry.. still running into trouble
here's what I have done
cloned the customer and received a new customer id. I verify that this customer is linked to the target connected account
this is cus_OHUXMbZX5jAE3h. (req_6NbkNolyJu3zsE)
now, I am looking to clone the payment method as per https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
this example shows including a customer_id so I try to use this new ^ customer I just created and I get an error
message": "No such customer: 'cus_OHUXMbZX5jAE3h'",
req_zXrAIxCdrWXISp
if I take the customer_id out of the POST request, I get
"The payment method you provided is attached to a customer so for security purposes you must provide the customer in the request."
req_Udm6m9BSHS9aUS
What am I doing wrong?
why do you create the Customer on the connected account? I thought we agreed earlier that you would not do that and you were testing with it
i am trying to get a payment to the connected account by using (cloning) the details from a payment already made to our platform account
I thought we just said i needed to create a customer on the Connected account?
Snufkin_stripe โ Today at 12:28 PM
No it needs to be a Customer that exists on the Connected Account as well
๐
You and I just spoke minutes before and I explained not to do that though
You are a platform. You store the Customer and PaymentMethod on the platform. Then when you want to create a Direct Charge you do
- Clone the PaymentMethod
- Use that cloned PaymentMethod on a PaymentIntent
im really confused by this now... dont we need a customer to create a PaymentIntent?
no
so what (who) is the customer id in this example ??https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
where is
-d customer={{CUSTOMER_ID}} \
coming from ??
this goes back to what I said, if I try to "just" clone the payment method and do not include a customer, I get an error
"The payment method you provided is attached to a customer so for security purposes you must provide the customer in the request."
example: req_Qc6bKEJpVn81g4
Sorry, you're rushing through everything, that's the problem
Step 1: Clone the PaymentMethod from the platform to the connected account curl https://api.stripe.com/v1/payment_methods \ -u sk_test_123: \ -d customer={{CUSTOMER_ID}} \ -d payment_method={{PAYMENT_METHOD_ID}} \ -H "Stripe-Account: {{CONNECTED_ACCOUNT_ID}}"
This expects the Customer id and the PaymentMethod id from the platform. What you are cloning.
ok..
you still have not commented on
customer={{CUSTOMER_ID}}
what customer is that?
This expects the Customer id and the PaymentMethod id from the platform. What you are cloning.
I just said this above
i'm sorry that you are repeating. I feel like I've tried this... let me try to get a pm_id from just this step.. one sec
All good. You kind of got lost and likely tried many different things. This flow is really easy once you get it, but it's a pain to have it "click" in your head
So try what I just said first, if it doesn't work let's debug that together
I think I got it to work now. I have a payment into the connected account. And yes, you are right.. it makes more sense now that I see it working. Thank you for being patience with me.
Of course! I'm sorry this is so hard. We're working on a bit of a better flow where you can create a PaymentIntent on the connected account and at the same time pass the platform's Customer and PaymentMethod id clearly as part of the "clone operation" all in one request to make this easier in the future