#3xd_tango - separate c&t

1 messages ยท Page 1 of 1 (latest)

halcyon hinge
#

3xd_tango - separate c&t

hazy sedge
#

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)

untold minnow
#

๐Ÿ‘‹ stepping in as codename_duchess needs to step away

hazy sedge
#

someone suggest me that i did setup the connects and all after that im kinda confused

untold minnow
#

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?

hazy sedge
#

card payment?

untold minnow
#

I'd recommend starting there and reading through that and deciding on Standard vs. Express vs. Custom accounts

hazy sedge
#

oh yeah standard

untold minnow
#

Okay, as a heads up we don't recommend Separate Charges & Transfers with Standard Accounts.

hazy sedge
#

okay

#

i could do the express

untold minnow
#

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

hazy sedge
#

yeah i did tried with express login and redirects

untold minnow
#

Okay great, so you have an enabled test-mode Express account?

hazy sedge
#

yep

untold minnow
#

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?

hazy sedge
#

well ill go for checkout for now

untold minnow
#

Also, to clarify, all of your Connected Accounts will be in the same region as your platform, correct?

hazy sedge
#

yes the shop and the drivers will be on same region US to be specific

untold minnow
#

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!

hazy sedge
#

question does checkout have dynamic/custom amount ? i want to set amount in the back-end with some calculations

untold minnow
hazy sedge
#

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="...",
)
untold minnow
#

Ah so sorry! I missed this follow up @hazy sedge

#

Are you still here?

hazy sedge
#

yep im here

untold minnow
#

The amount will be in cents here

#

So you want 10000 if you want $100

hazy sedge
#

i see

#

thanks anything else im missing

untold minnow
#

Looks fine afaict. I'd test it out!

hazy sedge
#

and the customer={id of express connect} ?

#

or just customer_email

untold minnow
#

Nope you don't do anything with the Connected Account yet

#

You do that after the payment is complete

hazy sedge
#

ah okay

untold minnow
#

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.

hazy sedge
#

gotcha

#

whats will be the next step after done payments ?

untold minnow
#

Then you create the transfers

#

That is what actually moves the funds to your Connected Accounts

hazy sedge
#

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 ?

untold minnow
#

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)

hazy sedge
#

i see

#

thanks a lot, you save me there

untold minnow
#

๐Ÿ‘

hazy sedge
#

ill figure out the source_transaction

#

charge id ๐Ÿค”

untold minnow
#

You get the charge ID from the PaymentIntent

#

Which is created due to the Checkout Session

#

The best way to programmatically handle all of this is to use Webhooks

#

So you will want to look into implementing those once you have your Checkout Sessions working