首页 > 解决方案 > 条纹支付费用

问题描述

我想使用paymentMethod作为来源收取付款但它不收费,我如何使用支付方式获得token作为来源?我尝试使用

\Stripe\Stripe::setApiKey('sk_test_**************');
\Stripe\Charge::create([
    'amount' => $menuPrice*100,
    'currency' => 'usd',
    'customer' => $user->stripe_id,
    'source' => 'pm_*************'
]);

标签: stripe-paymentslaravel-6laravel-cashier

解决方案


收费是较老的方式。新方法是付款意图(使用付款方式)。您可以在此处了解差异:https ://stripe.com/docs/payments/payment-intents/migration


推荐阅读