#yoshinori hisakawa
1 messages · Page 1 of 1 (latest)
Yes, it's possible to hide country when creating Payment Element. You may set fields.billingDetails.address.country to never: https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-address-country
const { error } = await stripe.confirmPayment({
elements,
redirect: 'if_required',
confirmParams: {
payment_method_data: {
billing_details: {
address: {
country: 'never',
},
},
},
},
});
I have checked the documentation you gave me and changed the implementation, but the country is still displayed.
It's not at confirmPayment, but const paymentElement = elements.create('payment', options);
It's at payment element creation step, not confirming the payment
For example,
const options = {
fields: {
billingDetails: {
address: {
country: 'never',
},
},
},
};
const paymentElement = elements.create('payment', options);