#Kolombina-setup-intent
1 messages · Page 1 of 1 (latest)
Hi there, take a look at https://stripe.com/docs/payments/save-and-reuse
That is the guide for using a SetupIntent to collect card details with Elements
and if we want to use CcheckoutSession it means that we have to create card -> Source -> assign the Source to Customer? what then&
Nope, if you use Checkout then it will handle all of this for you.
You just create the Checkout Session in setup mode and a customer will be created and card will be attached to that customer upon completion of the Session.
ok, thanks. Next question:
We want to implement Direct Payment to connected accounts created on ours platform. So as I understand and checked: creating cutomer on Connected_account X doesn't allow to use the same 'source' to pay to Connected_account Y?
Is it correct?
That's correct. You would want to clone PaymentMethods in this case
You would tokenize on your Platform and clone to each Connected Account
so we've chosen the following way:
- create a customer on platforn_account
- create a source and link it with the customer
- Clone source and customers to the another connected account.
When you say "source" are you talking about our legacy Sources API?
If so, you should use our new(er) PaymentMethods API instead.
stripe.checkout.Session needs not PaymentMethods, but source
If you are using Checkout then it will create the PaymentMethod automatically.
Checkout does not use Sources.
this error I get after using stripe.checkout.Session for customer created at dashboard by hand and created paymntMethods
You provided a customer without specifying a source. The default source of the customer is a source and cannot be shared from existing customers.
session = stripe.checkout.Session.create(
customer=customer,
payment_method_types=['card'],
mode='payment',
line_items=[{
'name': payment_name,
'amount': data_in['price'],
'currency': 'pln',
'quantity': data_in['quantity'],
}],
payment_intent_data={
'application_fee_amount': fee,
'setup_future_usage': 'off_session'
},
success_url=f"{settings.FRONTEND_DEV_APP_URL}/{line}",
cancel_url=f"{settings.FRONTEND_DEV_APP_URL}/{line}",
stripe_account=connected_account_id,
)
I think you are a bit confused... if you use Stripe Checkout you don't create the Customer and PaymentMethod via the Dashboard.
So for the code above, you are creating the Checkout Session on your Connected Account
may by (then sorry). but i've created a Customer and PaymentMethod and used their id
Let's back up a second.
Have you read through https://stripe.com/docs/payments/checkout/how-checkout-works?
At the beginning you stated you want to collect card details first, then charge them.
However, the Checkout Session you created above is in "payment" mode. Which means you are charging the Customer via the Checkout Session.
yeap 😅 it's kind of thinking for future:
if I collect card data by Checkout Session it means that I'l not be able to use the customer's card the next times (because I'l create a stripe custoner linked with specificconnected_account)
this is problem
Right so to solve that, you create the Checkout Session on your Platform and collect the card details there.
Then in the future you can clone the PaymentMethod to your Connected Accounts to use with as many accounts as you want!
oh. now I understand. Thanks for patience!
No problem at all!