#3xd_tango - separate c&t
1 messages ยท Page 1 of 1 (latest)
Ok just to clarify, you want to do separate charges and transfers. Also with Stripe Checkout: https://stripe.com/payments/checkout ?
3xd_tango - separate c&t
ill i wanted was to get from shop like 100 (dynamic) and give the payment to driver 40 (dynamic) and charge the remaining of them 60 (shop - driver)
๐ stepping in as codename_duchess needs to step away
someone suggest me that i did setup the connects and all after that im kinda confused
Yep so you do want Separate Charges and Transfers if you are going to do multiparty paymnets
However let's back up a moment
Have you decided on the type of Connected Accounts you are going to use?
card payment?
Have you read: https://stripe.com/docs/connect/accounts?
I'd recommend starting there and reading through that and deciding on Standard vs. Express vs. Custom accounts
oh yeah standard
Okay, as a heads up we don't recommend Separate Charges & Transfers with Standard Accounts.
The main reason being that you handle everything with Separate Charges & Transfers from your platform and if a Standard Account has access to, for instance, refunding via their Dashboard... then that causes issues.
Yes, I'd recommend Express
Cool, so have you onboarded an Express Account yet?
That would be the next step.
And onboarding a test-mode Express account
yeah i did tried with express login and redirects
Okay great, so you have an enabled test-mode Express account?
yep
Perfect
Alright next is to decide on which payment flow you want to use.
So earlier you said "Checkout"
But then you gave code for creating a PaymentIntent
Stripe Checkout would be our hosted page where you would redirect customers to make payment.
Versus using Payment Element where you embed the payment form into your website.
Do you know which of those you plan on using?
well ill go for checkout for now
Okay great. Then you can use our Quickstart to see an example of what your code might look like for a basic Checkout Session: https://stripe.com/docs/checkout/quickstart
Also, to clarify, all of your Connected Accounts will be in the same region as your platform, correct?
yes the shop and the drivers will be on same region US to be specific
Great, just wanted to make sure since that is a requirement for Separate Charges & Transfers.
Alright so next step here is to write code to create a Checkout Session and then make a payment in testmode using that Session.
Let me know when you have accomplished that, or if you get stuck during that process!
question does checkout have dynamic/custom amount ? i want to set amount in the back-end with some calculations
Yes you can determine the amount when you create the Session. You can do this dynamically via price_data: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
sorry for the delay i was testing out the checkout it getting $1.00 instead of $100
stripe.checkout.Session.create(
payment_method_types=["card"],
line_items=[
{
"price_data": {
"currency": "usd",
"unit_amount": int(total_price["shop"]),
"product_data": {
"name": "Order",
"description": f"Order reference: {instance.id}",
"metadata": {
...
},
},
},
"quantity": 1,
},
],
currency="usd",
mode="payment",
success_url="...",
cancel_url="...",
)
yep im here
Looks fine afaict. I'd test it out!
Nope you don't do anything with the Connected Account yet
You do that after the payment is complete
ah okay
So you can omit customer if you want, or if you are going to store customers in your database then you can create Customer IDs for those customers.
Then you create the transfers
Like shown in https://stripe.com/docs/connect/charges-transfers
That is what actually moves the funds to your Connected Accounts
i see so it will be only one transfer for me then like
transfer = stripe.Transfer.create(
amount=4000,
currency='usd',
destination='{{CONNECTED_STRIPE_ACCOUNT_ID}}',
)
one last thing do i have to add transfer_group ?
Yep the above is correct
You will likely want to use source_transaction as well
And transfer_group is optional but you can use that to reconcile your transfers together with a specific payment as well (though you can use source_transaction for this as well)
๐