Skip to content

Google Pay / Apple Pay – invalid state codes for Ukraine (and similar countries) #4691

@maxim-yaschenko

Description

@maxim-yaschenko

When using Google Pay (via WooCommerce Stripe Payment Gateway), checkout fails for customers from Ukraine because the state/county code returned by Google Pay does not match the format expected by WooCommerce.

Errors displayed:
There was a problem with the provided shipping address: State / County is required
Sorry, this order requires a shipping option
The provided state is not valid. Must be one of: UA05, UA07, UA09, UA12, UA14, UA18, UA21, UA23, UA26, UA30, UA32, UA35, UA40, UA43, UA46, UA48, UA51, UA53, UA56, UA59, UA61, UA63, UA65, UA68, UA71, UA74, UA77

Expected behaviour :
The plugin should normalize the administrative_area returned by Google Pay (e.g. "Kyiv", "Київ") into the WooCommerce region codes (UA32, UA30, etc.), so that orders can be placed without errors.

Actual behaviour :
Google Pay passes a plain text region name. WooCommerce requires strict state codes. Since there is no mapping/conversion, the order is rejected.

Steps to reproduce :
Enable Stripe Payment Request buttons (Google Pay).
Set store country to Slovenia, allow selling to all countries.
Try to pay with a Ukrainian card via Google Pay.
Checkout fails with invalid state error.

Environment :
WordPress: 6.8.2
WooCommerce: 10.1.2
WooCommerce Stripe Gateway: 9.9.1
Payment method: Google Pay (Payment Request API)

Additional context :
With Apple Pay, sometimes this works because Apple Pay may pass ISO codes, but with Google Pay this consistently fails for Ukraine.
This issue may also affect other countries with coded regions (e.g. Brazil, Canada, US) where WooCommerce expects short codes but Google Pay provides full names.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions