Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions types/googlepay/googlepay-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ function getGooglePaymentDataConfiguration(): google.payments.api.PaymentDataReq
},
allowedPaymentMethods,
shippingAddressRequired: true,
shippingAddressParameters: {
phoneNumberRequired: true,
format: "FULL-ISO3166",
},
callbackIntents: ["OFFER", "PAYMENT_AUTHORIZATION", "PAYMENT_METHOD"],
};
}
Expand Down
54 changes: 53 additions & 1 deletion types/googlepay/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,15 @@ declare namespace google.payments.api {
* @default false
*/
phoneNumberRequired?: false | true | undefined;

/**
* Shipping address format.
*
* If omitted, defaults to [[ShippingAddressFormat|`FULL`]].
*
* * @default "FULL"
*/
format?: ShippingAddressFormat | undefined;
}

/**
Expand Down Expand Up @@ -483,6 +492,14 @@ declare namespace google.payments.api {
* number be returned.
*/
phoneNumber?: string | undefined;

/**
* The ISO 3166-2 administrative area
*
* ISO 3166-2 administrative area corresponding to administrativeArea.
* Only present if the shipping or billing address format is FULL-ISO3166.
*/
iso3166AdministrativeArea?: string | undefined;
}

/**
Expand Down Expand Up @@ -516,6 +533,14 @@ declare namespace google.payments.api {
* The locality (e.g. city or town).
*/
locality: string;

/**
* The ISO 3166-2 administrative area
*
* ISO 3166-2 administrative area corresponding to administrativeArea.
* Only present if the shipping address format is FULL-ISO3166.
*/
iso3166AdministrativeArea?: string | undefined;
}

/**
Expand Down Expand Up @@ -1582,8 +1607,35 @@ declare namespace google.payments.api {
* Only select this format when it is required to process the order.
* Additional form entry or customer data requests can increase friction
* during the checkout process and can lead to a lower conversion rate.
*
* - `FULL-ISO3166`:
* Same as `FULL` but includes [[Address.iso3166AdministrativeArea|`Address.iso3166AdministrativeArea`]]
*/
type BillingAddressFormat = "MIN" | "FULL" | "FULL-ISO3166";

/**
* Shipping address format enum string.
*
* Options:
*
* - `FULL`:
* Full shipping address
*
* All the fields in [[Address|`Address`]] will
* be returned, with the possible exception of
* [[Address.phoneNumber|`Address.phoneNumber`]] which will only be
* returned if
* [[ShippingAddressParameters.phoneNumberRequired|`ShippingAddressParameters.phoneNumberRequired`]]
* is set to `true`.
*
* Only select this format when it is required to process the order.
* Additional form entry or customer data requests can increase friction
* during the checkout process and can lead to a lower conversion rate.
*
* - `FULL-ISO3166`:
* Same as `FULL` but includes [[Address.iso3166AdministrativeArea|`Address.iso3166AdministrativeArea`]]
*/
type BillingAddressFormat = "MIN" | "FULL";
type ShippingAddressFormat = "FULL" | "FULL-ISO3166";

/**
* The status of the total price used.
Expand Down
8 changes: 8 additions & 0 deletions types/googlepay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
{
"name": "Dominik Mengelt",
"githubUsername": "dmengelt"
},
{
"name": "Matthew Class",
"githubUsername": "aikimatthew"
},
{
"name": "Stephen McDonald",
"githubUsername": "stephenmcd"
}
]
}