我正在为移动应用程序实现 REST API,该应用程序封装了以货币形式兑换积分的功能,相当于使用 Stripe 作为支付网关的积分。
为了完成它,我使用 Stripe payout API 将金额直接转入目标银行账户。

以下是调用 Stripe 支付 API 的代码片段

$payout=\Stripe\Payout::create(array(
  "amount" => 400,
  "currency" => "usd",
  "destination"=>$ID,/* ID of customer bank account ba_1CIZEOCHXaXPEwZByNehIJrY  */
  "source_type"=>'bank_account'
));

执行上述代码片段后,我收到错误消息作为对支付 API 调用的响应



根据上述错误消息,似乎需要将相同的银行帐户附加到客户和连接的 strip 帐户,但我无法找到合适的解决方案将客户的银行帐户作为外部帐户附加到商家。

请建议我一个适当的解决方案。

最佳答案

实际上,您可以使用 Stripe 支付 API 向连接的 Stripe 账户的银行账户或借记卡发起支付。但是,您可以创建转账,将资金从您的 Stripe 账户发送到连接的账户。

https://stripe.com/docs/api/transfers/create

下面是php代码:

\Stripe\Stripe::setApiKey("sk_test_AjtBCFvy8Ah0x5vLmd5Ntemi");

\Stripe\Transfer::create([
  "amount" => 400,
  "currency" => "usd",
  "destination" => "acct_1CPuerJ18us5u9z6",
  "transfer_group" => "ORDER_95"
]);

我也搜索了stripe文档,直接在第三方卡/银行账户中转账,但没有找到任何东西。

关于php - 使用 Stripe Payout API 将金额转入客户的银行账户,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/49921319/

10-13 05:15