#ashish846955

1 messages · Page 1 of 1 (latest)

marsh talonBOT
royal terrace
#

What you mean exactly by payment split ? can you provide a concret example/use case ?

summer bison
#

I want to split payment in 3 accounts in one transaction

#

\Stripe\Stripe::setApiKey('sk_test_51KfsFjGwCBh3ZCzEC67PMGOHD6asv58g21uoIboA5gbJodET7gPgk1CFZKxNucFaDaRPJp9rFnUq3ZGmY49gMHKw00ORB6ypc3');

$token = \Stripe\Token::create(array(
"card" => array(
"number" => "4242424242424242",
"exp_month" => "08",
"exp_year" => "32",
"cvc" => "123",
"name" => "ashish kamaldhari"
)));
$paymentIntent = \Stripe\PaymentIntent::create([
'amount' => 10000, // Amount in cents (e.g., $100)
'currency' => 'usd',
'payment_method_types' => ['card'],
'payment_method' => 'pm_card_visa',
// 'application_fee_amount' => 9000, // Amount in cents to be deducted as the platform fee
], ['stripe_account' => $accountId]);

$transfer = \Stripe\Transfer::create([
    'amount' => 9000, // Amount in cents (e.g., $90)
    'currency' => 'usd',
    'destination' => $accountId1,
    'transfer_group' => $paymentIntent->id,
]);
#

I have use this code but this is not working

#

@royal terrace Could you please help me!

royal terrace
summer bison
#

Okay

royal terrace
royal terrace
summer bison
royal terrace
#

Can you copy past the requestId here please (req_1234)

summer bison
#

How can i get request id?

royal terrace
#

You need to use Stripe Connect that's the only option for this use case.

royal terrace
summer bison
#

If I want to transfer from one account to another, I have to connect the accounts?

#

{
"id": "pi_3NDo0AGwCBh3ZCzE1cpydcwd",
"object": "payment_intent",
"last_payment_error": null,
"livemode": false,
"next_action": null,
"status": "requires_payment_method",
"amount": 10000,
"amount_capturable": 0,
"amount_details": {
"tip": {
}
},
"amount_received": 0,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"charges": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/charges?payment_intent=pi_3NDo0AGwCBh3ZCzE1cpydcwd"
},
"client_secret": "pi_3NDo0AGwCBh3ZCzE1cpydcwd_secret_cSSiz6pN86FQgFMEGrhOlMWQx",
"confirmation_method": "automatic",
"created": 1685535582,
"currency": "usd",
"customer": null,
"description": null,
"invoice": null,
"latest_charge": null,
"metadata": {
},
"on_behalf_of": null,
"payment_method": null,
"payment_method_options": {
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"transfer_data": null,
"transfer_group": null
}

#

Can I do it without the connect function?

summer bison
#

How can i do this?

#

Could you please provide me php code?

royal terrace
#

First you need to choose what Account types you need to use, Express or Custom (you can't use Standard account for separate charges/transfers)
https://stripe.com/docs/connect/express-accounts
https://stripe.com/docs/connect/custom-accounts
According to what Account type you are using, you need to create/onboard all the required account (one account for each party) following the links above. The follow this guide in order to create the charges and transfers:
https://stripe.com/docs/connect/charges-transfers

summer bison
#

I have use both type of account use

royal terrace
#

Well, I think you can use both types.