Getting error with createPaymentMethod
Hi,
I'm working on the new payment flow to meet SCA regulation. I followed the migration guide and so I replaced the method (which works) :
let {token} = await this.props.stripe.createToken()
by :
let {paymentMethod} = await this.props.stripe.createPaymentMethod('card')
But I have the following error :
IntegrationError: Please provide either an Element or PaymentMethod creation parameters to createPaymentMethod.
I also tried to pass an empty object as second parameter.
let {paymentMethod} = await this.props.stripe.createPaymentMethod('card',{})
Then the request is sent but it returns an error with the message Missing required param: card. (Elements are not found to fill card's data?? Obviously, they're found with createToken method!)
I finally tried to upgrade api version on Stripe dashboard (#354) but without any luck.
Am I missing something or is this a bug (npm package used is [email protected]) ?
I am facing the same issue, works for createSource but not for createPaymentMethod
Hey there! Thanks for the report. Taking a look at this.
Since 3.0.0, this method should automatically find the elements and I was unable to reproduce this on 4.0.0 as well. Can you confirm that an older version of react-stripe-elements is not being used somehow?
I don't believe this is a bug as I haven't been able to reproduce on recent versions. Here's a rough fiddle I used to verify: https://jsfiddle.net/mjrLt082/2/
If you're still running into issues, please reach out to our support team at https://support.stripe.com/contact or come chat with us at #stripe on freenode.
Shame on me ! I was running npm commands in the wrong folder... and so I was not using 4.0.0 release...
Now, it works... I really apologize...
I had similar issues with the createPaymentMethod function not sending card details to the server. Updating from 3.0.0 to 4.0.0 fixed the issue.