#davidalejandro
1 messages · Page 1 of 1 (latest)
Hi, I think what you're looking for is to Clone the customer, https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods. You're right, if you create the customer on the Platform account, you cannot then try to pass it on the request for a Connected Account
Hi, that's the outdated article I mentioned. Several people here and in Github issues say that article is legacy and shouldn't be used
Sorry, I corrected the link.
No worries, thank you.
So what you're saying is that I'd have to:
- Implement Save and Reuse https://stripe.com/docs/payments/save-and-reuse on my platform for customers to save their payment methods.
- Then clone the payment method https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods before using
Stripe::Checkout::Session?
This is the only way to do this? I was hoping for having to write less code
That is correct! Will this customer and payment method only be used for one Connected Account?
If yes, you can just created the customer when creating the Checkout Session, https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer_creation by passing customer_creation: always for the Connected Account.
No, it is expected that the customer and their payment methods will be used between different Connected Accounts.
Ok thank you.
So when until I implement that on my platform, customers will need to re-enter their card details every time they pay on a new Connected Account?
Also, when cloning the payment method from my platform into the Connected Account, CUSTOMER_ID and PAYMENT_METHOD_ID is the customer id on my platform, right?
payment_method = Stripe::PaymentMethod.create({
customer: '{{CUSTOMER_ID}}',
payment_method: '{{PAYMENT_METHOD_ID}}',
}, {
stripe_account: '{{CONNECTED_ACCOUNT_ID}}',
})
Quick question a friend of mine made a payment true stripe with credit card the person who he made it to. Claimbs and says that the money its getting refunded to him but its bein 20 days and still money hasnt show. How long do this takes is there a way to know if this money was recived?
That is correct @thorny sequoia .
@full surge if you have technical questions, happy to chat. Please write in on the main channel as this thread is dedicated for @thorny sequoia
Am sorry
So final question, I think, is how does Stripe know, based on the customer id and payment method id on my platform, what customer on the connected account to attach it to? Is Stripe, behind the scenes, matching the email? A workflow example:
- A user registers on my platform
- A Customer is created for them on my platform.
- A user pays on a Connected Account.
- A Customer is thus automatically created for them on the Connected Account.
- I then implement Save and Reuse and ask the customer to enter their card details
- The customer then pays again on the same Connected Account.
- I clone the payment method via the code above.
Will this work? How does Stripe know this is the same customer?
1/Create the customer on the Platform Account
2/ Create the Payment Method on the Platform Account
3/ Attach the Payment Method to the Customer on the Platform Account
4/ Create a Payment Method using the Stripe Account Header and by passing the above object ids. It create a Payment Method on the Connected Account
5/ Create a Customer on the Connected Account also by using the Stripe Account Header
6/ Attach the Payment Method from step 4 to this customer id from step 5 by using the Stripe Account Header
Adding the steps above, I recommend that you test this in your test environment. It's much clearer once you have a script.
OK thanks @frigid echo , that was really helpful.
That makes me wonder if a workaround to not have to implement saving payment methods on my Platform Account (steps 2 - 4) would be to clone the Payment Method from one Connected Account to another. i.e.
1/ Create the Customer on the Platform Account
2/ Create a Customer on the Connected Account by using the Stripe Account Header
3/ Use Stripe::Session::Checkout to start a payment and pass step 2's Customer id on the customer param. This would automatically save a Payment Method for this Customer after payment.
4/ Whenever the user wants to pay again on a new Connected Account, I see they already paid on another Connected Account
5/ So I create a Customer on the new Connected Account by using the new Stripe Account Header.
6/ Lookup the Payment Method from the other Customer on the other Connected Account
7/ Attach the Payment Method to the new Customer on the new Connected Account by using the new Stripe Account Header.
I do not think this would work.
Yeah I thought so, thanks for entertaining the idea though 🙂
I think this is definitely the final question: Once I clone the Payment Method to the Customer, I can keep using Stripe::Checkout::Session, pass the Customer id via customer and that would automatically show the saved card details on the checkout page, right?