Stripe Payouts 作为托管模拟

Var*_*arg 5 php symfony stripe-payments

我正在尝试使用 Stripe Payouts 模拟托管系统。实际上,Stripe 现在没有托管,但在这篇 Q/A 文章中,我收到了在这种情况下使用 Payouts 的建议。官方文档涵盖的支付不太好。我找到的最好的就在这里。这个想法是将付款发送到用户的卡上。我正在使用 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'
        )
    );
}
Run Code Online (Sandbox Code Playgroud)

我使用测试卡 (4242 4242 4242 4242) 向那里发送一些测试钱,但收到以下错误:

No such external account: 4242424242424242
Run Code Online (Sandbox Code Playgroud)

文档中的错误参考对我没有帮助。我该如何解决这个问题?

Ywa*_*ain 5

您需要使用Stripe Connect代表第三方接受付款并将付款发送到他们的银行账户(或借记卡,在美国)。

我建议您通过https://support.stripe.com/email 联系Stripe 的支持,以解释您的商业模式和所需的资金流向。他们将帮助您确保您的模型得到支持,并就您应该使用哪些 API 提出建议。