【发布时间】:2018-04-10 22:39:20
【问题描述】:
我正在尝试使用 Stripe Payouts 模拟 Escrow 系统。实际上,Stripe 现在没有托管服务,但在 this Q/A article 我收到了使用 Payouts 处理这种情况的建议。 官方文档涵盖的支出不太好。我找到的最好的是here。 这个想法是将付款发送到用户的卡。 我正在使用 Angular 4 和 Symfony Framework 3.2 构建 Web 应用程序。这部分是服务端执行的,所以PHP代码如下:
public function payToCardAction()
{
$apiKey = $this->getParameter('stripe_secret');
Stripe::setApiKey($apiKey);
try{
Payout::create(
array(
'amount' => 400,
'currency' => 'gbp',
'description' => 'Example payment',
'source_type' => 'card',
'destination' => preg_replace('/\s+/', '','4242 4242 4242 4242')
)
);
}
catch (Card $e){
return new JsonResponse(
array(
'status' => 400,
'message'=> 'Bad request'
)
);
}
return new JsonResponse(
array(
'status' => 200,
'message' => 'Success'
)
);
}
我使用测试卡 (4242 4242 4242 4242) 向那里发送一些测试资金,但收到以下错误:
No such external account: 4242424242424242
文档中的错误参考对我没有帮助。我该如何解决这个问题?
【问题讨论】:
标签: php symfony stripe-payments