Gathering detailed insights and metrics for @google-pay/button-react
Gathering detailed insights and metrics for @google-pay/button-react
Gathering detailed insights and metrics for @google-pay/button-react
Gathering detailed insights and metrics for @google-pay/button-react
npm install @google-pay/button-react
Typescript
Module System
Min. Node Version
Node Version
NPM Version
85.8
Supply Chain
94.2
Quality
77
Maintenance
100
Vulnerability
100
License
TypeScript (88.45%)
JavaScript (5.96%)
Shell (5.59%)
Total Downloads
3,305,888
Last Day
968
Last Week
22,813
Last Month
130,088
Last Year
1,636,381
260 Stars
433 Commits
69 Forks
16 Watching
5 Branches
10 Contributors
Latest Version
3.1.0
Package Id
@google-pay/button-react@3.1.0
Unpacked Size
93.68 kB
Size
19.36 kB
File Count
9
NPM Version
8.19.4
Node Version
16.20.2
Publised On
28 Mar 2024
Cumulative downloads
Total Downloads
Last day
-85.4%
968
Compared to previous day
Last week
-27%
22,813
Compared to previous week
Last month
-22.1%
130,088
Compared to previous month
Last year
79.7%
1,636,381
Compared to previous year
1
4
This is the React component for the Google Pay button.
1npm install @google-pay/button-react
1<GooglePayButton 2 environment="TEST" 3 paymentRequest={{ 4 apiVersion: 2, 5 apiVersionMinor: 0, 6 allowedPaymentMethods: [ 7 { 8 type: 'CARD', 9 parameters: { 10 allowedAuthMethods: ['PAN_ONLY', 'CRYPTOGRAM_3DS'], 11 allowedCardNetworks: ['MASTERCARD', 'VISA'], 12 }, 13 tokenizationSpecification: { 14 type: 'PAYMENT_GATEWAY', 15 parameters: { 16 gateway: 'example', 17 gatewayMerchantId: 'exampleGatewayMerchantId', 18 }, 19 }, 20 }, 21 ], 22 merchantInfo: { 23 merchantId: '12345678901234567890', 24 merchantName: 'Demo Merchant', 25 }, 26 transactionInfo: { 27 totalPriceStatus: 'FINAL', 28 totalPriceLabel: 'Total', 29 totalPrice: '100.00', 30 currencyCode: 'USD', 31 countryCode: 'US', 32 }, 33 }} 34 onLoadPaymentData={paymentRequest => { 35 console.log('load payment data', paymentRequest); 36 }} 37/>
More React examples can be found in the examples folder of this repository.
Try it out on StackBlitz, or see it in action with a React sample store (source code).
Visit the Google Pay developer site for more information about integrating Google Pay into your website.
Property | Type | Remarks |
---|---|---|
buttonColor |
|
Optional.
Default value |
buttonLocale |
|
Optional. This ISO 639-1 code represents the desired button language. Supported locales include Default value is determined by the browser/operating system locale. |
buttonSizeMode |
|
Optional.
Default value |
buttonType |
|
Optional. Displays their respective prompts (localized based on the user's browser settings) with the Google Pay logo. The
Default value |
buttonRadius |
|
Optional. Specifies the button corner radius in pixels. The minimum is 0 and the maximum depends on the height of the button. If the height is 40px (default height) then the maximum value for the |
className |
|
Optional. The CSS class name to apply to the element. |
environment |
|
Required. The Google Pay environment to target. Note: in the |
existingPaymentMethodRequired |
|
Optional. When set to Default value |
paymentRequest |
Required. Request parameters that define the type of payment information requested from Google Pay. See | |
style |
|
Optional. The CSS style attributes to apply to the element. |
Callback | Arguments | Remarks |
---|---|---|
onCancel | reason |
Invoked when a user cancels or closes the Google Pay payment sheet. |
onClick | event |
Invoked when the Google Pay button is clicked, before the payment sheet is displayed. Display of the payment sheet can be prevented by calling |
onError | reason |
Invoked when an error is encountered in the process of presenting and collecting payment options from the Google Pay payment sheet. |
onLoadPaymentData | paymentData |
Invoked when a user has successfully nominated payment details. This callback receives the |
onPaymentAuthorized | paymentData |
Invoked when a user chooses a payment method. This callback should be used to validate whether or not the payment method can be used to complete a payment. This would be typically used to perform pre-authorization to ensure that the card is valid and has sufficient funds. Note that in order to use this callback See payment authorization reference for more information. |
onPaymentDataChanged | intermediatePaymentData |
Invoked when payment the user changes payment data options including payment method, shipping details, and contact details. This callback can be used to dynamically update Note that in order to use this callback See payment data changed reference for more information. |
onReadyToPayChange | result |
Invoked when the user's Note that when
|
Note that this folder does not contain a package.json
file. The package.json
file is generated during the build
process using the package-template.json
where the version number is read from the package.json
file defined in the root of this repository.
No vulnerabilities found.
Reason
15 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
SAST tool is run on all commits
Details
Reason
Found 2/12 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
13 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More