laravel / cashier-stripe

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
https://laravel.com/docs/billing
MIT License
2.37k stars 671 forks source link

Cashier throws error “A parameter provided in the URL (payment_method) was repeated as a GET or POST parameter.” while adding payment method #957

Closed poornimasudha closed 4 years ago

poornimasudha commented 4 years ago

I am using cashier for stripe in laravel 7, getting this error while adding payment method. " A parameter provided in the URL (payment_method) was repeated as a GET or POST parameter. You can only provide this information as a portion of the URL." I am passing payment intent to the blade like this, 'intent' => $user->createSetupIntent() In 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...
}

});

then adding

$paymentMethod=$request['payment_method']; $user->updateDefaultPaymentMethod($paymentMethod); what is the meaning of this error?

driesvints commented 4 years ago

Hi there,

Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.

poornimasudha commented 4 years ago

It was a fault from my side,I passed complete setup intent instead of payment method in updateDefaultPaymentMethod.