I am following this tutorial: https://stripe.com/docs/billing/subscriptions/fixed-price. They never instantiate a variable called card, which leads me to believe that card is a stripe component that comes with "https://js.stripe.com/v3/". When I run the frontend, I get the following error: payment_portal:214 Uncaught ReferenceError: card is not defined. The error occurs in this codeblock, right here createPaymentMethod({ card });:
form.addEventListener('submit', function (ev) {
ev.preventDefault();
// If a previous payment was attempted, get the latest invoice
const latestInvoicePaymentIntentStatus = localStorage.getItem(
'latestInvoicePaymentIntentStatus'
);
if (latestInvoicePaymentIntentStatus === 'requires_payment_method') {
const invoiceId = localStorage.getItem('latestInvoiceId');
const isPaymentRetry = true;
// create new payment method & retry payment on invoice with new payment method
createPaymentMethod({
card,
isPaymentRetry,
invoiceId,
});
} else {
// create new payment method & create subscription
createPaymentMethod({ card });
}
});
I am going to dig through "https://js.stripe.com/v3/" to see if I can find an instance of card. Any help would be greatly appreciated.