Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transfer amount into customer's bank account using Stripe Payout API

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.

like image 978
Rubin Porwal Avatar asked Nov 08 '22 08:11

Rubin Porwal


1 Answers

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.

like image 171
Manoj Agrawal Avatar answered Nov 15 '22 05:11

Manoj Agrawal