#markaw-change-card
1 messages · Page 1 of 1 (latest)
@deft crow can you share what your confirmCardPayment call looks like?
It should like you might not have included the reference to a card element to use for the payment
no, I have included "The client secret of the PaymentIntent." as the card was already created by the createPaymentMethod .js function
Do you mean the initial card or the new card?
If you've created the new card payment method already, you can include the payment method ID in the confirmCardPayment call, but you can also move the card element use into the confirmation call to reduce the number of calls/api requests
eg: https://stripe.com/docs/js/payment_intents/confirm_card_payment#stripe_confirm_card_payment-data-payment_method
This can be the new payment method id like this:
stripe
.confirmCardPayment('{PAYMENT_INTENT_CLIENT_SECRET}', {
payment_method: 'pm_123',
})
Complete reference documentation for the Stripe JavaScript SDK.
Though as i say you can reduce your total API requests by moving the payment method creation to be built into the confirmation