#ilamathi-paymentmethod
1 messages · Page 1 of 1 (latest)
hi! no, it's not.
the PaymentElement is optimised/designed for confirming Payment/Setup Intents only, not creating PaymentMethod tokens
Basically i want to create the paymentMethod for the details entered in the paymentElement before confirming the payment
Is it possible to show the card element in the multiple line as similar to the PaymentElement look and feel?
makes sense, but not a use case we support today
sure, you'd use the separate CardNumber/CardExpiry Elements and place them as you need
quick example https://jsfiddle.net/cdt43qL1/
With this separate Element we can able to create paymentMethod right before confirming the payment?
here, stripe.createPaymentMethod({
type: 'card',
card: cardElement,
billing_details: {
// Include any additional collected billing details.
name: 'Jenny Rosen',
},
}).then(stripePaymentMethodHandler);
instead of card element i need to pass all the elements in object to create card paymentMethod?
Basically we need all these details right,
const paymentMethod = await stripe.paymentMethods.create({
type: 'card',
card: {
number: '4242424242424242',
exp_month: 6,
exp_year: 2023,
cvc: '314',
},
});
as we are using separate element for each field, then instead of cardElement we need to pass all the other element
no you can't do that as it's not PCI compliant
nope just pass any of them
like pass the cardNumberElement, it works
oh ok... by passing single element it will take all other value from other element like Exp, CVC and create paymentMethod?
yep
ok great...