{"id":28576339,"url":"https://github.com/google-pay/react-native-make-payment","last_synced_at":"2025-06-10T23:40:15.270Z","repository":{"id":130214203,"uuid":"608894541","full_name":"google-pay/react-native-make-payment","owner":"google-pay","description":"React Native library for making native payments","archived":false,"fork":false,"pushed_at":"2025-02-24T10:05:25.000Z","size":1690,"stargazers_count":38,"open_issues_count":10,"forks_count":15,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-06-02T13:26:23.996Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google-pay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null}},"created_at":"2023-03-03T00:19:45.000Z","updated_at":"2025-05-30T17:53:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"894a4ea2-6af3-4da5-99a5-d9662001b58f","html_url":"https://github.com/google-pay/react-native-make-payment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Freact-native-make-payment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Freact-native-make-payment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Freact-native-make-payment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Freact-native-make-payment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google-pay","download_url":"https://codeload.github.com/google-pay/react-native-make-payment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Freact-native-make-payment/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259172148,"owners_count":22816514,"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","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":"2025-06-10T23:40:14.315Z","updated_at":"2025-06-10T23:40:15.250Z","avatar_url":"https://github.com/google-pay.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-make-payment\n\n[![npm version](https://badge.fury.io/js/@google%2Freact-native-make-payment.svg)](https://badge.fury.io/js/@google%2Freact-native-make-payment)\n\nAdds native payments using the [W3C Payment Request API](https://web.dev/how-payment-request-api-works/) to your\nReact Native app. Currently supports Google Pay on Android,\nwith support planned for other platforms in the future.\n\n## Installation\n\n```sh\nnpm install @google/react-native-make-payment\n```\n\nYou can also try out the example by running the following command from the `example` directory:\n\n```sh\nnpx react-native run-android\n```\n\n## Configuration\n\nTo enable Google Pay in your app, you need to add the\nfollowing Google Pay API meta-data element to the\n`\u003capplication\u003e` element of your project's `AndroidManifest.xml`\nfile (typically `android/app/src/main/AndroidManifest.xml`):\n\n```\n\u003cmeta-data\n  android:name=\"com.google.android.gms.wallet.api.enabled\"\n  android:value=\"true\" /\u003e\n```\n\nFor production, you will also need to define the\n`GOOGLE_PAY_ENVIRONMENT` property in your project's\n`gradle.properties` file (typically `android/gradle.properties`):\n\n```\nGOOGLE_PAY_ENVIRONMENT=PRODUCTION\n```\n\n## Usage\n\nFollowing is a minimal example. A complete example can be\nfound in `example/src/App.tsx`.\n\n```js\nimport { PaymentRequest } from '@google/react-native-make-payment';\n\nconst paymentDetails = {\n  total: {\n    amount: {\n      currency: 'USD',\n      value: '14.95',\n    },\n  },\n};\n\nconst googlePayRequest = {\n  // Google Pay API JSON request object, see:\n  // https://developers.google.com/pay/api/android/reference/request-objects\n};\n\nconst paymentMethods = [\n  {\n    supportedMethods: 'google_pay',\n    data: googlePayRequest,\n  },\n];\n\nconst paymentRequest = new PaymentRequest(paymentMethods, paymentDetails);\n\npaymentRequest.canMakePayment().then((canMakePayment) =\u003e {\n  if (canMakePayment) {\n    paymentRequest.show().then((response) =\u003e {\n      // Handle PSP response\n    });\n  } else {\n    // Google Pay unavailable\n  }\n});\n```\n\n### Google Pay Button\nExample of adding a native Google Pay button:\n\n```xml\n\u003cGooglePayButton\n  style={styles.googlepaybutton}\n  onPress={checkCanMakePayment}\n  allowedPaymentMethods={googlePayRequest.allowedPaymentMethods}\n  theme={GooglePayButtonConstants.Themes.Dark}\n  type={GooglePayButtonConstants.Types.Buy}\n  radius={4}        \n/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle-pay%2Freact-native-make-payment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle-pay%2Freact-native-make-payment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle-pay%2Freact-native-make-payment/lists"}