#ilamathi-Elements

1 messages · Page 1 of 1 (latest)

ornate basin
normal surge
#

req_AZ8uYF2gCnBWVK

ornate basin
#

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?

normal surge
#

yes it is working... when this redirection will happen...

#

localhost working only

ornate basin
#

Did you also set handleActions to false when calling stripe.confirmCardPayment?

normal surge
#

no, didn't.. we have to set that?

ornate basin
#

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

normal surge
#

If i pass handleActions:false, getting invalid request error

ornate basin
#

Can you show me the code?

normal surge
#

req_vOKkKFvCaBFIZW

ornate basin
#

Your code?

normal surge
#

{
return_url: 'localhost',
handleActions: false
}

#

i send something like thia

#

await stripe.confirmCardPayment(clientSecret, {
return_url: 'localhost',
handleActions: false
})

ornate basin
#

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?

normal surge
#

i want to execute redirect when payment succeeds

#

i don;t want to handle next actions.. just want to redirect

ornate basin
#

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,

normal surge
#

we need to handle the redirect in our script

#

?

ornate basin
#

Yes you are right.

normal surge
#

one more QQ, in Card Element there is postal code section next to CVC right?.. what is the use of that postal code?

ornate basin
#

Like cvc, postal code is another piece of information that card issuer uses to validate the transaction.

normal surge
#

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?

ornate basin
#

if you hide the postal_code in PaymentElements, then you need to include post_code when confirming the payment.

normal surge
#

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 ?

ornate basin
#

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

normal surge
#

Also Card issuer will validate this postal against the postal given by user while purchasing the card ?

ornate basin
#

It's entirely up to the card issuer.