You can select the allowed billing addresses when creating a store, but those values are not reflected in the country dropdown at checkout.

Comments

bojanz created an issue. See original summary.

bojanz’s picture

Question is what to do on the user pages.

At checkout we know the order, which means we know the store, and can restrict the countries.
But on the user pages we don't know the store, which means that the user can specify a potentially restricted country.
Do we allow that but prevent such addresses from being selected at checkout?

bojanz’s picture

This was partially resolved in #2844917: Create a commerce_profile_select form element and field widget.

The country list is now correctly restricted on:
1) Order edit
2) Billing information pane (used when there are no payments)
3) PaymentInformation (billing information collected when an offsite gateway is used)

The list is still not restricted in PaymentMethodAddForm (the checkout form for onsite gateways).
We need to restrict it there as well, and add tests.

Regarding #2, the filtering out of non-suitable profiles is being solved in #2832493: Checkout shows payment methods which cannot be reused.
On user pages we restrict the list to the one on the default store, but only if there's just a single store.
That covers the use case for non-multistore websites at least.

steveoliver’s picture

Assigned: Unassigned » steveoliver
steveoliver’s picture

So how do we know in the context of the PaymentMethodAddForm if we are in the context of an order checkout, or if we are under the user's 'Create payment method' screen?

bojanz’s picture

We'll need to take the route match and see whether it contains an order, I guess.

Either that or pass #order to the plugin form. I avoided that previously so that gateways don't accidentally always rely on its presence.

steveoliver’s picture

Status: Active » Needs review
bojanz’s picture

Assigned: steveoliver » bojanz

Wrapping this up (test coverage, fallback to default store).

  • bojanz committed a7d02d7 on 8.x-2.x authored by steveoliver
    Issue #2822211 by bojanz, steveoliver: The allowed billing addresses are...
bojanz’s picture

Status: Needs review » Fixed

Done.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.