I am working on an implementation of REST API for a mobile application which encapsulates feature of redemption of earned points in form of money equivalent to points using Stripe as a payment gateway . To accomplish it I have used Stripe payout API to transfer amount directly into destination bank account.
Following is code snippet of call to payout API of Stripe
$payout=\Stripe\Payout::create(array(
"amount" => 400,
"currency" => "usd",
"destination"=>$ID,/* ID of customer bank account ba_1CIZEOCHXaXPEwZByNehIJrY */
"source_type"=>'bank_account'
));
Upon execution of above code snippet I receive error message as response to call of payout API
The bank account ba_1CIZEOCHXaXPEwZByNehIJrY is not attached to this Stripe account. External accounts can only be attached to Standard accounts via the dashboard.
According to above error message it seems that same bank account needs to be attached to both customer and connected stripe account but I am unable to find appropriate solution to attach customer's bank account to merchant as an external account.
Please suggest me an appropriate solution to it.
Actually you can use the Stripe payout API to initiate a payout to either a bank account or debit card of a connected Stripe account.However you can create a transfer , To send funds from your Stripe account to a connected account.
https://stripe.com/docs/api/transfers/create
Below is the php code :
\Stripe\Stripe::setApiKey("sk_test_AjtBCFvy8Ah0x5vLmd5Ntemi");
\Stripe\Transfer::create([
"amount" => 400,
"currency" => "usd",
"destination" => "acct_1CPuerJ18us5u9z6",
"transfer_group" => "ORDER_95"
]);
I have also searched stripe documentation , to directly transfer the payment in the third party card / bank account, but did not find anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With