如何按条 api 拆分付款?

how split payments by stripe api?

我正在建立一个慈善捐款网站。我必须从 user/donator 获得付款,并将 20% 转入网站帐户,将 80% 转入捐赠活动帐户。使用 PayPal 我有自适应支付方式,但我应该如何使用 Stripe 支付?条纹可以使用哪种方法API?

您需要为此使用 Stripe Connect

基本上,平台(=您)将拥有您自己的 Stripe 帐户,并且每个捐赠活动都会有自己的帐户,并与您的帐户相关联(这意味着他们授予您代表他们接受付款的权限)。

然后您就可以create charges for them, using the application_fee parameter to specify your split. There are two different ways to go about it, which are explained here: https://stripe.com/docs/connect/payments-fees

Stripe connect 可以很好地解决这个问题,请记住它仅适用于此处列出的 select 个国家/地区 https://stripe.com/global。您仍然可以在任何其他国家/地区接受付款,然后自己手动分配和分配资金,这可能会产生转账费用。

你也可以将它与 stripe connect 一起使用并像这样分发它

// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
\Stripe\Stripe::setApiKey("sk_test_0nEtpmgWlX0mXXE6aMXQhhs1");

// Create a Charge:
$charge = \Stripe\Charge::create(array(
  "amount" => 10000,
  "currency" => "gbp",
  "source" => "tok_visa",
  "transfer_group" => "{ORDER10}",
));

// Create a Transfer to a connected account (later):
$transfer = \Stripe\Transfer::create(array(
  "amount" => 7000,
  "currency" => "gbp",
  "destination" => "{CONNECTED_STRIPE_ACCOUNT_ID}",
  "transfer_group" => "{ORDER10}",
));

// Create a second Transfer to another connected account (later):
$transfer = \Stripe\Transfer::create(array(
  "amount" => 2000,
  "currency" => "gbp",
  "destination" => "{OTHER_CONNECTED_STRIPE_ACCOUNT_ID}",
  "transfer_group" => "{ORDER10}",
));