{"id":4795,"url":"https://github.com/sorokin0andrey/react-native-google-pay","last_synced_at":"2025-07-31T15:37:54.396Z","repository":{"id":38958130,"uuid":"191772919","full_name":"sorokin0andrey/react-native-google-pay","owner":"sorokin0andrey","description":"React Native bridge for Google Pay","archived":false,"fork":false,"pushed_at":"2023-12-05T12:26:01.000Z","size":1882,"stargazers_count":104,"open_issues_count":11,"forks_count":55,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-23T04:05:49.604Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sorokin0andrey.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-06-13T13:55:01.000Z","updated_at":"2025-06-02T08:28:26.000Z","dependencies_parsed_at":"2024-04-25T05:48:02.305Z","dependency_job_id":null,"html_url":"https://github.com/sorokin0andrey/react-native-google-pay","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.125,"last_synced_commit":"de8d1ebcb88873df013ea4b02d205705f13808ef"},"previous_names":["busfor/react-native-google-pay"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/sorokin0andrey/react-native-google-pay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorokin0andrey%2Freact-native-google-pay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorokin0andrey%2Freact-native-google-pay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorokin0andrey%2Freact-native-google-pay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorokin0andrey%2Freact-native-google-pay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sorokin0andrey","download_url":"https://codeload.github.com/sorokin0andrey/react-native-google-pay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorokin0andrey%2Freact-native-google-pay/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267705746,"owners_count":24130965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:17:24.428Z","updated_at":"2025-07-31T15:37:54.338Z","avatar_url":"https://github.com/sorokin0andrey.png","language":"Java","funding_links":[],"categories":["Components"],"sub_categories":["Monetization"],"readme":"\n# react-native-google-pay\n[![react-native version](https://img.shields.io/badge/react--native-0.41-0ba7d3.svg?style=flat-square)](https://github.com/facebook/react-native/releases/tag/v0.41.0)\n![npm](https://img.shields.io/npm/dw/react-native-google-pay.svg?style=flat-square)\n[![npm (tag)](https://img.shields.io/npm/v/react-native-google-pay/latest.svg?style=flat-square)](https://github.com/busfor/react-native-google-pay/tree/master)\n\nAccept Payments with Google Pay for React Native apps.\n\n\u003cdiv\u003e\n\u003cimg width=\"280px\" src=\"emulator.gif\" /\u003e\n\u003c/div\u003e\n\n---\n\n## Versions\n\n| 1.x              | 2.x              |\n| ---------------- | -------------    |\n| Android support  | AndroidX support  |\n\n\n## Getting started\n\n`$ yarn add react-native-google-pay`\n\n## Linking \n\n### \u003e= 0.60\n\nAutolinking will just do the job.\n\n### \u003c 0.60\n\n### Mostly automatic installation\n\n`$ react-native link react-native-google-pay`\n\n### Manual installation\n\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n  - Add `import com.busfor.RNGooglePayPackage;` to the imports at the top of the file\n  - Add `new RNGooglePayPackage()` to the list returned by the `getPackages()` method\n2. Append the following lines to `android/settings.gradle`:\n  \t```\n  \tinclude ':react-native-google-pay'\n  \tproject(':react-native-google-pay').projectDir = new File(rootProject.projectDir, \t'../node_modules/react-native-google-pay/android')\n  \t```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n  \t```\n      implementation project(':react-native-google-pay')\n  \t```\n\n### Enable Android Pay in your Manifest\n\nTo enable Google Pay in your app, you need to add the following Google Pay API meta-data element to the `\u003capplication\u003e` element of your project's AndroidManifest.xml file.\n\n```xml\n\u003cmeta-data\n    android:name=\"com.google.android.gms.wallet.api.enabled\"\n    android:value=\"true\" /\u003e\n```\n\n## Usage\n```javascript\nimport { GooglePay } from 'react-native-google-pay';\n\nconst allowedCardNetworks = ['VISA', 'MASTERCARD'];\nconst allowedCardAuthMethods = ['PAN_ONLY', 'CRYPTOGRAM_3DS'];\n\nconst requestData = {\n  cardPaymentMethod: {\n    tokenizationSpecification: {\n      type: 'PAYMENT_GATEWAY',\n      // stripe (see Example):\n      gateway: 'stripe',\n      gatewayMerchantId: '',\n      stripe: {\n        publishableKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx',\n        version: '2018-11-08',\n      },\n      // other:\n      gateway: 'example',\n      gatewayMerchantId: 'exampleGatewayMerchantId',\n    },\n    allowedCardNetworks,\n    allowedCardAuthMethods,\n  },\n  transaction: {\n    totalPrice: '10',\n    totalPriceStatus: 'FINAL',\n    currencyCode: 'USD',\n  },\n  merchantName: 'Example Merchant',\n};\n\n// Set the environment before the payment request\nGooglePay.setEnvironment(GooglePay.ENVIRONMENT_TEST);\n\n// Check if Google Pay is available\nGooglePay.isReadyToPay(allowedCardNetworks, allowedCardAuthMethods)\n  .then((ready) =\u003e {\n    if (ready) {\n      // Request payment token\n      GooglePay.requestPayment(requestData)\n        .then((token: string) =\u003e {\n          // Send a token to your payment gateway\n        })\n        .catch((error) =\u003e console.log(error.code, error.message));\n    }\n  })\n```\n\n## Demo\nYou can run the demo by cloning the project and running:\n\n`$ yarn demo`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorokin0andrey%2Freact-native-google-pay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsorokin0andrey%2Freact-native-google-pay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorokin0andrey%2Freact-native-google-pay/lists"}