#joe8912
1 messages · Page 1 of 1 (latest)
You're trying to get a Payment Intent out of a Transfer object?
So I have a webhook that once the transaction is completed it starts transferring the amounts to the sellers. I was told to use source_transaction so I wouldn't get insufficient funds available error. Im in test mode
Are you using Destination Charges or are you using Separate Charges and Transfers?
stripe.Transfer.create(
destination=stripe_id,
amount=int(Decimal(amount) * 100),
currency='usd',
source_transaction=session.payment_intent,
) this is what i have right now
I'm in a webhook so not sure how I would get the payment_intent from there
No, I mean, which payment flow are you using?
oh sorry im using Separate charges and transfers
Ah, okay. I don't think source_transaction gets populated in that case, since you could be transferring some amount from multiple different charges
got it. how could I avoid insufficient funds errors when transferring?
You check the Balance on the account immediately before transferring: https://stripe.com/docs/api/balance/balance_retrieve?lang=python
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.