{"id":28576353,"url":"https://github.com/google-pay/pay-server-demos","last_synced_at":"2025-06-10T23:40:16.941Z","repository":{"id":42448814,"uuid":"395495069","full_name":"google-pay/pay-server-demos","owner":"google-pay","description":"Google Pay with various Payments Service Providers (PSPs)","archived":false,"fork":false,"pushed_at":"2025-01-07T11:56:33.000Z","size":2180,"stargazers_count":43,"open_issues_count":12,"forks_count":19,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-01-07T12:40:04.219Z","etag":null,"topics":["google-pay"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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":"2021-08-13T02:11:47.000Z","updated_at":"2025-01-07T11:56:37.000Z","dependencies_parsed_at":"2024-02-07T01:30:24.221Z","dependency_job_id":"602e46b8-bab1-47b8-b407-430b699317ef","html_url":"https://github.com/google-pay/pay-server-demos","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Fpay-server-demos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Fpay-server-demos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Fpay-server-demos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Fpay-server-demos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google-pay","download_url":"https://codeload.github.com/google-pay/pay-server-demos/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-pay%2Fpay-server-demos/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":["google-pay"],"created_at":"2025-06-10T23:40:15.291Z","updated_at":"2025-06-10T23:40:16.925Z","avatar_url":"https://github.com/google-pay.png","language":"JavaScript","funding_links":["https://developer.paypal.com/braintree/docs/guides/google-pay/overview"],"categories":[],"sub_categories":[],"readme":"# Google Pay Server Demos\n\nThis project demonstrates integrating Google Pay with various Payments Service Providers (PSPs), using JavaScript and\nNode.js. It consists of two parts: a client library that wraps each of the PSP server-side APIs, and a demo app that\ndemonstrates end to end integration for any of the included PSPs.\n\nIf you're just interested in sample code for a particular PSP, go straight to the `google-pay-psp-client/handlers`\ndirectory, where you'll find server-side samples for each PSP.\n\n## Demo App\n\nThe demo app is implemented as a minimal shopping site you can use to test the end to end integration for your chosen\nPSP.\n\n**Setup:**\n\n- Copy `demo/config.json.example` to `demo/config.json` and edit the config for your PSP\n- Install dependencies: `npm install .`\n- Run the app: `node demo/app.js`\n- View at `http://localhost:3000`\n\n## Client Library\n\nThe `google-pay-psp-client` directory contains a client library that wraps each of the PSP server-side APIs.\n\n**Example:**\n\n```js\nconst clients = require('./google-pay-psp-client');\n\n// PSP-specific configuration, in this case Braintree.\nconst config = {\n  environment: 'Sandbox',\n  merchantId: 'merchant id',\n  publicKey: 'public key',\n  privateKey: 'private key',\n};\n\n// An order requires a total, currency, and\n// client-side response from the Google Pay API.\nconst order = {\n  total: 100,\n  currency: 'USD',\n  paymentResponse: req.body.paymentResponse,\n};\n\n// Each PSP has a \"pay\" method, which takes config, order, and returns a Promise.\nclients.braintree\n  .pay(config, order)\n  .then(response =\u003e {\n    console.log(response); // PSP-specific response.\n  })\n  .catch(error =\u003e {\n    console.error(error); // PSP-specific error.\n  });\n```\n\n## Current PSPs\n\n- [Adyen](https://docs.adyen.com/payment-methods/google-pay/api-only)\n- [Barion](https://docs.barion.com/Google_Pay)\n- [BePaid](https://docs.bepaid.by/ru/google_pay/integration/owncheckout)\n- [BlueSnap](https://developers.bluesnap.com/reference/google-pay#section-implementing-google-pay-in-your-website)\n- [Braintree](https://developer.paypal.com/braintree/docs/guides/google-pay/overview)\n- [Braspag](https://braspag.github.io/en/manual/ewallets)\n- [Checkout.com](https://docs.checkout.com/payments/payment-methods/wallets/google-pay)\n- [Cybersource](https://docs.cybersource.com/en/payments-tech-docs/googlepay.html)\n- [Datatrans](https://docs.datatrans.ch/docs/payment-methods#section-google-pay)\n- [Ecommpay](https://developers.ecommpay.com/en/pm_googlepay.html)\n- [Novalnet](https://developer.novalnet.de/onlinepayments/aboutgooglepay)\n- [PayU](https://developers.payu.com/en/google_pay.html)\n- [Solid](https://dev.solidgate.com/developers/documentation/introduction/Host-to-host-API)\n- [Spreedly](https://docs.spreedly.com/guides/google-pay)\n- [Square](https://developer.squareup.com/docs/payment-form/add-digital-wallets/google-pay)\n- [Stripe](https://stripe.com/docs/google-pay)\n- [WayForPay](https://help.wayforpay.com/google-pay)\n- [Windcave](https://www.windcave.com/developer-ecommerce-google-pay)\n- [Worldpay](https://developer.worldpay.com/docs/wpg/directintegration/quickstart)\n\nDon't see your PSP here? Feel free to contribute an integration example using the steps below.\n\n## Adding a new PSP\n\n**Client Library:**\n\nAdd a new JavaScript file to the `google-pay-psp-client/handlers` directory. It should export a single function that\naccepts a `config` and an `order` object (see examples of these in the \"Client Library\" section above). The function\nshould return a Promise that resolves on successful payment, and rejects on failure. The `order` object will contain\nsome calculated fields for the total amount:\n\n- `order.totalInt` the total amount in smallest possible units, (eg cents for USD)\n- `order.totalFixed` the rounded total amount (eg 2 decimal places for USD)\n\n**Demo App:**\n\nAdd a new key to `demo/config.json` for the PSP, using the same name as the JavaScript file name added to the client\nlibrary. Use this to store all configuration variables used by the PSP, at minimum containing a `clientConfig` key\ncontaining the [gateway parameters](https://developers.google.com/pay/api/web/reference/request-objects#gateway) for the\nPSP.\n\nOptionally, if custom client-side integration is required, add a new JavaScript file to the `demo/public/handlers`\ndirectory. It should be named the same as the key added to `config.json`, and it will be run once the page's dom is\nloaded. You can then override the function names in `demo/public/shop.js`. See the `demo/public/handlers` directory for\nexamples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle-pay%2Fpay-server-demos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle-pay%2Fpay-server-demos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle-pay%2Fpay-server-demos/lists"}