收银员抛出错误“ URL(payment_method)中提供的参数被重复作为GET或POST参数。”同时添加付款方式

时间:2020-06-11 13:54:51

标签: laravel stripe-payments strip laravel-cashier

我在laravel 7中将收银员用于条纹,添加付款方式时出现此错误。 URL(付款方式)中提供的参数重复作为GET或POST参数。您只能将此信息作为URL的一部分提供。 我正在将付款意向传递给刀片, 'intent' => $user->createSetupIntent() 在js中,

cardButton.addEventListener('click', async (e) => {
    e.preventDefault();
    const { setupIntent, error } = await stripe.confirmCardSetup(
        clientSecret, {
            payment_method: {
                card: cardElement,
                billing_details: { name: cardHolderName.value }
            }
        }
    );

    if (error) {

        // Display "error.message" to the user...
    } else {
        send('save', false, {
            data: {
                payment_method: setupIntent
            }

        });
        // The card has been verified successfully...
    }
});

然后添加

 $paymentMethod=$request['payment_method'];
        $user->updateDefaultPaymentMethod($paymentMethod);

谁能帮助我找出问题所在。

1 个答案:

答案 0 :(得分:0)

这是我的错,我在updateDefaultPaymentMethod中传递了完整的设置意图而不是付款方式。 我需要将数据设置为Payment_method:setupIntent.payment_method