Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Google Pay Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-google-pay-knowledge-patch-nevaberry-plugins)
---
name: google-pay-knowledge-patch
description: Google Pay
version: null
license: MIT
metadata:
author: Nevaberry
---
# Google Pay
Load this skill when working on Google Pay web merchant integrations,
including client configuration, addresses, payment-sheet behavior, payment
methods, and testing.
## Reference index
| Reference | Topics |
| --- | --- |
| [Web configuration and testing](references/web-configuration-and-testing.md) | CSP nonce, button borders, sandboxed checkout, localized test cards, payment callbacks |
| [Addresses and checkout](references/addresses-and-checkout.md) | Standardized addresses, administrative areas, payment-sheet action labels, promo codes |
| [Payment methods and processing](references/payment-methods-and-processing.md) | Card funding source, Brazilian combo cards, PayPal, ECv2 signing keys |
## Client configuration
### Apply the page's CSP nonce
Pass the current page's Content Security Policy nonce as
`PaymentOptions.nonce` when constructing the client.
The client applies it to every dynamically injected `<script>` and `<style>`
element.
```js
function createPaymentsClient(cspNonce) {
return new google.payments.api.PaymentsClient({
environment: "TEST",
nonce: cspNonce,
});
}
```
### Isolate checkout scripts
A web checkout can embed the payment integration in a sandboxed iframe
that isolates its scripts from the parent DOM.
See [web configuration and testing](references/web-configuration-and-testing.md)
for the supplied sandboxed iframe setup link.
## Card funding source
For a card payment, read the funding source from
`paymentData.paymentMethodData.info.cardFundingSource`.
The possible values are:
- `UNKNOWN`
- `CREDIT`
- `DEBIT`
- `PREPAID`
Handle `UNKNOWN` when using this value for funding-source-specific pricing.
See [payment methods and processing](references/payment-methods-and-processing.md).
## Standardized addresses
Set `BillingAddressParameters.format` to `FULL-ISO3166` to request a
standardized billing address.
```js
cardParameters.billingAddressRequired = true;
cardParameters.billingAddressParameters = { format: "FULL-ISO3166" };
```
The address objects also expose these properties:
| Object | Property |
| --- | --- |
| `ShippingAddressParameters` | `format` |
| `Address` | `iso3166AdministrativeArea` |
| `IntermediateAddress` | `iso3166AdministrativeArea` |
Both `Address` and `IntermediateAddress` can return
`iso3166AdministrativeArea`.
See [addresses and checkout](references/addresses-and-checkout.md).
## Payment-sheet action labels
`TransactionInfo.checkoutOption` determines the payment-sheet button label.
| Option | Label |
| --- | --- |
| `CONTINUE_TO_REVIEW` | Review Order |
| `DEFAULT` | Continue |
| `COMPLETE_IMMEDIATE_PURCHASE` | Pay |
```js
paymentDataRequest.transactionInfo.checkoutOption = "CONTINUE_TO_REVIEW";
```
See [addresses and checkout](references/addresses-and-checkout.md).
## Payment-sheet promo codes
Use `OfferInfo` to update and display promo codes on the payment sheet.
The [addresses and checkout reference](references/addresses-and-checkout.md)
includes the supplied promo code tutorial link.
## Dynamic button border
Set `ButtonOptions.borderButtonType` on the options passed to `createButton()`
to control the border treatment.
The border is drawn inset so it stays visible while loading and leaves the
inner content size intact.
See [web configuration and testing](references/web-configuration-and-testing.md)
for the supplied button options link.
## Testing payment flows
### Localized gateway test cards
Gateway test cards in the `TEST` environment support country-specific billing
addresses in 27 markets, including the UK, France, Germany, Spain, Japan,
Hong Kong, and Brazil.
### Liability shift and payment callbacks
Web integrations using payment authorization or Dynamic Price Updates
callbacks can use liability shift and processor test cards.
The payment sheet follows the same experience as flows without callbacks
where compatible, with `OFFER` callbacks as an exception.
See [web configuration and testing](references/web-configuration-and-testing.md).
## Payment methods and direct integrations
### Brazilian credit and debit combo cards
Configure Brazilian credit and debit combo card support through
`CardParameters.allowedCardNetworks`.
### PayPal
PayPal is supported as a value for the `PaymentMethod.type` request field.
### ECv2 signing key
ECv2 lets `DIRECT` integrations use a long-lived signing key from the payment
service that only needs updating every ten years.
See [payment methods and processing](references/payment-methods-and-processing.md)
for the supplied card parameters, payment method, and cryptography links.