#Geoffrey

1 messages · Page 1 of 1 (latest)

slate shuttleBOT
wanton prism
#

Unfortunately there's no way to restrict the countries in that dropdown, but one other alternative would be for you to provide your own limited country dropdown with just US and Canada and disable the country dropdown provided by PaymentElement (https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails - set fields.billingDetails.country: never. Then, you can pass through the value you received from your own dropdown when you confirm the payment (https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method_data-billing_details)

oblique blaze
#

So I can roll my own input and then

stripe.confirmPayment({
  elements,
  confirmParams: {
    payment_method_data: {
      billing_details: {
        address: {
          country: <country>,
          postal_code: <postal_code>
        }
      }
    }
  },
})
#

It's interesting that the PaymentElement allows a user to turn off specific fields like country and postal, but the AddressElement does not. Seems like these two elements would work better together if they had this overlapping functionality

wanton prism
#

Yup that's generally what you would do

oblique blaze
#

Thanks, I think that's what we'll try to do