#angel785420
1 messages · Page 1 of 1 (latest)
This code looks right to me. Are you facing any issue?
My website is like eBay so users can sell and buy items. So how I have it setup currently I get the total amount and collect my fee then I send the amounts owed to respected sellers. It currently doesnt tax anything not sure why, Im aware there are item category for taxes and would like to utilize that since users sell meat and clothing items, and I know taxes vary based on category state from state
Are you using Connect?
yes
I see! What is the connected account type? Standard, Express or Custom?
Thanks for sharing! Are you using Separate Charges and Transfers or Direct Charges?
here is my transfers. if event.type == 'checkout.session.completed':
session = event['data']['object']
metadata = session.get('metadata', {})
seller_amounts = json.loads(metadata.get('seller_amounts', '{}'))
payment_intent = stripe.PaymentIntent.retrieve(session.payment_intent)
charge_id = payment_intent.charges.data[0].id
for stripe_id, amount in seller_amounts.items():
print(amount)
print(stripe_id)
stripe.Transfer.create(
destination=stripe_id,
amount=int(Decimal(amount) * 100),
currency='usd',
source_transaction=charge_id,
)
For Standard connected account, Direct Charges (https://stripe.com/docs/connect/direct-charges) should be used instead which you could set amount to transfer to in payment_intent_data.application_fee_amount of the Checkout Session: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-application_fee_amount
Then you'd need to follow this guide to set up the Automatic Tax for Direct Charges: https://stripe.com/docs/tax/tax-for-platforms
Separate Charges and Transfers, the one you're using now is strongly discouraged on Standard connected account.
oh ok got it ill take a look at those
but with Direct Charges, I can charge the total amount with multiple sellers products in the checkout ?
thanks for the help. will need to look into those links more. I think Im figuring it out
but with Direct Charges, I can charge the total amount with multiple sellers products in the checkout ?
Direct Charges is one payment to one connected account
got it. really appreciate the help !