#malphine2
1 messages · Page 1 of 1 (latest)
Hello, here is my current code,
payment_intent = stripe.PaymentIntent.create(
amount= amount,
currency= 'cad',
payment_method_types= ['card'],
capture_method= 'manual',
customer= customer,
off_session= True,
confirm= True,
payment_method= method['data'][0]['id'],
transfer_group="test"
)
stripe.Transfer.create(
amount=int(amount * 0.8),
currency='cad',
destination=acct,
transfer_group='test'
)
stripe.Transfer.create(
amount=int(amount * 0.2),
currency='cad',
destination= acct2,
transfer_group='test'
)
basiaclly, i want to make it so that 80% of the payment goes to one account , and 20 goes to the other
im not sure if im going about this the right way
Got it. So you're attempting to implement a separate charge and transfer flow
Why is capture_method: manual for the PaymentIntent?
uhh cauase ill be capturing the payment later
im basically creating a hold irght now
Got it, okay. Is the above returning an error?
the customer id , is using that card
method = stripe.PaymentMethod.list(customer=customer, type="card")
heres how method is defined
1 account is a connected stripe account id (acct)
the second is my personsal stripe account id (acct2)
the connected stripe account is also a account created in stripe mode
in test mode**
also a account created in stripe mode
not quite sure what this means
got it
Okay, so this is behaving as expected. The transfers to acct and acct2 are failing because your platform account doesn't a high enough balance to transfer funds to those accounts.
i see, i think im going about this the wrong way then
do u kinda get what im tryna do
If you don't want to initiate the transfer of funds until those funds are available (until the funds from the charge have been moved to your platform), you can use source_transaction: https://stripe.com/docs/connect/charges-transfers#transfer-availability
Should i be doing this after i capture the funds or as i create the payment intnet?
After you capture the funds
intent = stripe.PaymentIntent.capture(
p_id,
amount_to_capture = amount,
)
heres me capturing the funds
does intent have a charge id object
Yes, there can be multiple charges associated with a single PaymentIntent
should i be using the "latest_charge" attribute when i do this
amount=1000,
currency="usd",
source_transaction='{{CHARGE_ID}}',
destination='{{CONNECTED_ACCOUNT_ID}}',
)```
You can, yes. You should be able to create multiple Transfers with the same source_transaction as long as the sum of the amount for these transfers does not exceed the charge's amount
okay , thanks!