#vincent92-paymentelement

1 messages · Page 1 of 1 (latest)

molten creek
#

I already try with but did not work

#

what i'm doing wrong ?

#

payment_method_data: {

    billing_details: {
                        address:{ 
                        country:never
                        }
    }
  },
errant trail
#

you say it didn't work but I can tell you it works :p

molten creek
#

I trush you haha

errant trail
#

can you share your whole code? did you properly pass never as a string? country: 'never'

molten creek
#

I tryed both with string 'never' and non string

#

here s the code

#

async function handleSubmit(e) {
e.preventDefault();
setLoading(true);

const { error } = await stripe.confirmPayment({
elements,
confirmParams: {
// cette url la sera mis en variable et changer plus haut via php
return_url: "",
},

 payment_method_data: {
    billing_details: {
         address:{ 
    country:'never',
}
    }
  },

});

// This point will only be reached if there is an immediate error when
// confirming the payment. Otherwise, your customer will be redirected to
// your return_url. For some payment methods like iDEAL, your customer will
// be redirected to an intermediate site first to authorize the payment, then
// redirected to the return_url.
if (error.type === "card_error" || error.type === "validation_error") {
showMessage(error.message);
} else {
showMessage("An unexpected error occured.");
}

setLoading(false);
}

errant trail
#

yeah that's not how it works though, why is it inside payment_method_data?

#
  'payment',
  {
    fields: { 
        billingDetails: { 
          address: { 
            country: 'never' 
          } 
        }, 
      },
  }
);``` that's what you want instead
molten creek
#

You rock thank you !

#

By the way, if I don't collect the country ( to reduce friction user side ) Is that can cause some trouble next ? ( I mean does the country info help to not trigger fraud radar or something like this ?

errant trail
#

no it won't cause issues

molten creek
#

Ok thank you very much