"Please provide either an Element or PaymentMethod creation parameters to createPaymentMethod" error when changing from `stripe.createToken()` to `stripe.createPaymentMethod()`

Ensure your code syntax is correct, especially that all attributes are capitalized or in lower-case correctly.

Example

Passing card and CardElement will result in this error. The cardElement attribute is incorrectly capitalized. Instead, pass card and cardElement to createPaymentMethod.

Additional Information

  • JavaScript is a case-sensitive language. If you are passing a parameter comprised of two words together, the first letter of the first word should be lowercase and the first letter of the second word should be uppercase.

    • Example: BankName would be bankName, and HidePostalCode would be hidePostalCode.

Did this answer your question?