#en-payment-split

1 messages · Page 1 of 1 (latest)

finite ravine
#

by spliting the payment, do you mean you want to say
transfer 9 dollars to the connected account but keep 1 dollar?

#

without that, the whole 1000 will go to the connected account

wise pike
#

sorry i was not clear on this one, I know about the application_fee_amount, For now I just want to test if this piece of code works (send 1000 to the connected account)

finite ravine
#

it should work, do you encounter any issues?

wise pike
#
{
"status":"requires_payment_method"
}

The logged paymentIntent object had this line so i looked into documentation and found this way to crate payment_method

const paymentMethod = await stripe.paymentMethods.create({
    type: 'card',
    card: {
      number: '4242424242424242',
      exp_month: 9,
      exp_year: 2022,
      cvc: '314',
    },
  });
#

i have now changed my code to this now

 try {
      const paymentIntent = await stripe.paymentIntents.create({
        payment_method_types: ['card'],
        amount: 1000,
        currency: 'usd',
        application_fee_amount: 123,
        payment_method: paymentMethod.id,
        confirmation_method: 'automatic',
        transfer_data: {
          destination: connectID,
        },
      });
      console.log(paymentIntent);
    } catch (error) {
      console.log('error>>>', error);
    }
#

logged paymentIntent object now shows this

{
"status": 'requires_confirmation',
}
#

UPDATE: I added confirm: true on payment intent and the status now shows succeeded

#

I can now see balance on both platform and connected account

#

Thank you for the help mr Admin 🙂

finite ravine
#

a, cool, thanks for figuring it out.