#ilamathi-Elements
1 messages · Page 1 of 1 (latest)
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_AZ8uYF2gCnBWVK
Thanks. It seems like you are using a localhost URL as the return_url, can you double check and see if the URL is working?
Did you also set handleActions to false when calling stripe.confirmCardPayment?
no, didn't.. we have to set that?
You only need to set the return_url If you are handling next actions yourself.
To indicate that you want to handle next actions yourself, you need to set handleActions to false
If i pass handleActions:false, getting invalid request error
Can you show me the code?
req_vOKkKFvCaBFIZW
Your code?
{
return_url: 'localhost',
handleActions: false
}
i send something like thia
await stripe.confirmCardPayment(clientSecret, {
return_url: 'localhost',
handleActions: false
})
handleActions belongs to the options field https://stripe.com/docs/js/payment_intents/confirm_card_payment#stripe_confirm_card_payment-options
So try
await stripe.confirmCardPayment(clientSecret, {
return_url: 'localhost',
},{
handleActions: false
})
Just want to clarify, are you sure that you want to handle the next actions by yourself, or you just want to execute a redirect when the payment succeeeds?
i want to execute redirect when payment succeeds
i don;t want to handle next actions.. just want to redirect
If that's the case, you don't need to set the return_url.
stripe.confirmCardPayment will return a Promise which resolves with a result object. If the result object contains a paymentIntent, it means the payment is successful, and you can call a javascript function to perform redirect by yourself,
So it won't do itself like confirmPayment https://stripe.com/docs/js/payment_intents/confirm_payment
we need to handle the redirect in our script
?
Yes you are right.
one more QQ, in Card Element there is postal code section next to CVC right?.. what is the use of that postal code?
Like cvc, postal code is another piece of information that card issuer uses to validate the transaction.
when we create paymentmethod, we can able to pass postal code and all like
const pmResult = await stripe.createPaymentMethod({
type: 'card',
card: elements.getElement(CardElement),
billing_details: {
address: {
country: props.options.country,
postal_code: props.options.postal_code,
},
},
});
so this postal code given in payment method creation and card element postal should match?
if you hide the postal_code in PaymentElements, then you need to include post_code when confirming the payment.
You can change the postalCode visibility through this param https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-customized_fields-fields-billingDetails-address-postalCode
I am using the react-stripe-js, in that i don;t think there is option to hide postal code..
CardElement react component
My question, if we so postal in the card element, then there is no need to pass postal code while creating payment method right?..
Also Card issuer will validate this postal against the postal given by user while purchasing the card ?
Yes you are right, if postal code is already provided in the card element, you don't need to provide it again in the confirm call
Also Card issuer will validate this postal against the postal given by user while purchasing the card ?
It's entirely up to the card issuer.