如何在 Stripe Omnipay 上设置申请费?当我使用 stripe 的 php 库但无法使用 Omnipay 时,它工作正常。
错误信息:仅当代表另一个账户发出请求(使用 OAuth 密钥、条带账户标头或目标参数)时,才能应用application_fee。
$formData = [
'number' => '4242424242424242',
'expiryMonth' => '8',
'expiryYear' => '2018',
'cvv' => '123',
'firstName' => 'John',
'lastName' => 'Wags',
'email' => 'u@aaxxx.com' ,
];
$response = $gateway->purchase(
[
'amount' => '16.00',
'applicationFee' => '2.00',
'destination' => 'acct_24xxxxxxxxxxxxxx',
'currency' => 'AUD',
'card' => $formData,
'receipt_email' => 'xx@aaxxx.com',
'description' => 'Ref:10201'
]
)->send();
我在这里做错了什么吗?
我认为您还必须提供一个目标参数。
$response = $gateway->purchase(
[
'amount' => '16.00',
'applicationFee' => '2.00',
'destination' => 'acct_24xxxxxxxxxxxxxx',
'currency' => 'AUD',
'card' => $formData,
'receipt_email' => 'xx@aaxxx.com',
'description' => 'Ref:10201',
'destination' => 'DESTINATION-ACCOUNT-ID',
]
)->send();
https://stripe.com/docs/connect/payments-fees#charging-through-the-platform