I'm using my own form for the credit card creedentials.
I was trying to follow the instructions here https://laravel.com/docs/7.x/billing#storing-payment-methods
Based on the Stripe's instructions, you can pass cardElement or Card object. I would like to create the Card object myself, but I can't find which info does that object have:
cardButton.addEventListener('click', async (e) => {
const { setupIntent, error } = await stripe.confirmCardSetup(
clientSecret, {
payment_method: {
card: cardElement, //or Card object
billing_details: { name: cardHolderName.value }
}
}
);
if (error) {
// Display "error.message" to the user...
} else {
// The card has been verified successfully...
}
});
Not clear if I should simply use specific ids in my inputs, and then simply pass the form there, but I can't find that information.
You can see the details of the Card object here, which looks like this:
card: {
number: '4242424242424242',
exp_year: '2024',
exp_month: '02',
cvc: '123',
}
However, using Elements is strongly recommended.
It's important to be aware of the PCI compliance implications of this. It is your responsibility to make sure your implementation is compliant, and you will be required to provide additional documentation for your business.