Skip to content

Commit 11df58f

Browse files
authored
šŸ¤– Merge PR DefinitelyTyped#74134 [googlepay] add support for ISO 3166-2 administrative area codes by @dmengelt
1 parent 70c7889 commit 11df58f

File tree

3 files changed

+65
-1
lines changed

3 files changed

+65
-1
lines changed

ā€Žtypes/googlepay/googlepay-tests.tsā€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ function getGooglePaymentDataConfiguration(): google.payments.api.PaymentDataReq
201201
},
202202
allowedPaymentMethods,
203203
shippingAddressRequired: true,
204+
shippingAddressParameters: {
205+
phoneNumberRequired: true,
206+
format: "FULL-ISO3166",
207+
},
204208
callbackIntents: ["OFFER", "PAYMENT_AUTHORIZATION", "PAYMENT_METHOD"],
205209
};
206210
}

ā€Žtypes/googlepay/index.d.tsā€Ž

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,15 @@ declare namespace google.payments.api {
404404
* @default false
405405
*/
406406
phoneNumberRequired?: false | true | undefined;
407+
408+
/**
409+
* Shipping address format.
410+
*
411+
* If omitted, defaults to [[ShippingAddressFormat|`FULL`]].
412+
*
413+
* * @default "FULL"
414+
*/
415+
format?: ShippingAddressFormat | undefined;
407416
}
408417

409418
/**
@@ -483,6 +492,14 @@ declare namespace google.payments.api {
483492
* number be returned.
484493
*/
485494
phoneNumber?: string | undefined;
495+
496+
/**
497+
* The ISO 3166-2 administrative area
498+
*
499+
* ISO 3166-2 administrative area corresponding to administrativeArea.
500+
* Only present if the shipping or billing address format is FULL-ISO3166.
501+
*/
502+
iso3166AdministrativeArea?: string | undefined;
486503
}
487504

488505
/**
@@ -516,6 +533,14 @@ declare namespace google.payments.api {
516533
* The locality (e.g. city or town).
517534
*/
518535
locality: string;
536+
537+
/**
538+
* The ISO 3166-2 administrative area
539+
*
540+
* ISO 3166-2 administrative area corresponding to administrativeArea.
541+
* Only present if the shipping address format is FULL-ISO3166.
542+
*/
543+
iso3166AdministrativeArea?: string | undefined;
519544
}
520545

521546
/**
@@ -1582,8 +1607,35 @@ declare namespace google.payments.api {
15821607
* Only select this format when it is required to process the order.
15831608
* Additional form entry or customer data requests can increase friction
15841609
* during the checkout process and can lead to a lower conversion rate.
1610+
*
1611+
* - `FULL-ISO3166`:
1612+
* Same as `FULL` but includes [[Address.iso3166AdministrativeArea|`Address.iso3166AdministrativeArea`]]
1613+
*/
1614+
type BillingAddressFormat = "MIN" | "FULL" | "FULL-ISO3166";
1615+
1616+
/**
1617+
* Shipping address format enum string.
1618+
*
1619+
* Options:
1620+
*
1621+
* - `FULL`:
1622+
* Full shipping address
1623+
*
1624+
* All the fields in [[Address|`Address`]] will
1625+
* be returned, with the possible exception of
1626+
* [[Address.phoneNumber|`Address.phoneNumber`]] which will only be
1627+
* returned if
1628+
* [[ShippingAddressParameters.phoneNumberRequired|`ShippingAddressParameters.phoneNumberRequired`]]
1629+
* is set to `true`.
1630+
*
1631+
* Only select this format when it is required to process the order.
1632+
* Additional form entry or customer data requests can increase friction
1633+
* during the checkout process and can lead to a lower conversion rate.
1634+
*
1635+
* - `FULL-ISO3166`:
1636+
* Same as `FULL` but includes [[Address.iso3166AdministrativeArea|`Address.iso3166AdministrativeArea`]]
15851637
*/
1586-
type BillingAddressFormat = "MIN" | "FULL";
1638+
type ShippingAddressFormat = "FULL" | "FULL-ISO3166";
15871639

15881640
/**
15891641
* The status of the total price used.

ā€Žtypes/googlepay/package.jsonā€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@
3838
{
3939
"name": "Dominik Mengelt",
4040
"githubUsername": "dmengelt"
41+
},
42+
{
43+
"name": "Matthew Class",
44+
"githubUsername": "aikimatthew"
45+
},
46+
{
47+
"name": "Stephen McDonald",
48+
"githubUsername": "stephenmcd"
4149
}
4250
]
4351
}

0 commit comments

Comments
Ā (0)