#malphine2

1 messages · Page 1 of 1 (latest)

polar spadeBOT
hollow geyser
#

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

indigo elm
#

Got it. So you're attempting to implement a separate charge and transfer flow

#

Why is capture_method: manual for the PaymentIntent?

hollow geyser
#

uhh cauase ill be capturing the payment later

#

im basically creating a hold irght now

indigo elm
#

Got it, okay. Is the above returning an error?

hollow geyser
#

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**

indigo elm
#

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.

hollow geyser
#

i see, i think im going about this the wrong way then

#

do u kinda get what im tryna do

indigo elm
hollow geyser
#

Should i be doing this after i capture the funds or as i create the payment intnet?

indigo elm
#

After you capture the funds

hollow geyser
#
 intent = stripe.PaymentIntent.capture(
        p_id,
        amount_to_capture = amount, 
    )

#

heres me capturing the funds

#

does intent have a charge id object

indigo elm
#

Yes, there can be multiple charges associated with a single PaymentIntent

hollow geyser
#

should i be using the "latest_charge" attribute when i do this

  amount=1000,
  currency="usd",
  source_transaction='{{CHARGE_ID}}',
  destination='{{CONNECTED_ACCOUNT_ID}}',
)```
indigo elm
#

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

hollow geyser
#

okay , thanks!