{"id":20305788,"url":"https://github.com/bitpay/cordova-sdk","last_synced_at":"2025-04-11T14:51:50.330Z","repository":{"id":21717301,"uuid":"25038863","full_name":"bitpay/cordova-sdk","owner":"bitpay","description":"A cordova plugin to interface with the BitPay API.","archived":false,"fork":false,"pushed_at":"2023-03-08T08:55:55.000Z","size":232,"stargazers_count":11,"open_issues_count":5,"forks_count":16,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-06T08:03:03.212Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitpay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-10T14:24:07.000Z","updated_at":"2024-08-25T20:33:53.000Z","dependencies_parsed_at":"2022-08-17T23:15:26.733Z","dependency_job_id":null,"html_url":"https://github.com/bitpay/cordova-sdk","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/bitpay%2Fcordova-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fcordova-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fcordova-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fcordova-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitpay","download_url":"https://codeload.github.com/bitpay/cordova-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248425041,"owners_count":21101285,"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":"2024-11-14T17:09:53.877Z","updated_at":"2025-04-11T14:51:50.307Z","avatar_url":"https://github.com/bitpay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BitPay Cordova SDK\n\nThis SDK allows your application to quickly create an invoice, show the user an option to pay you, and track the status of the payment. Accept bitcoins in your app with 10 lines of code!\n\n## Installing\nInstall the SDK as a plugin to your Cordova project.\n\n```bash\n$ cordova plugin add https://github.com/bitpay/cordova-sdk.git\n\n```\n\n## Setup Credentials\n\n### 1. Create a BitPay Account\nPlease go to https://bitpay.com to create an account. You can also create a development account at [https://test.bitpay.com](https://test.bitpay.com/dashboard/signup).\n\n### 2. Generate an Application Token\n\nGo to [My Account \u003e API Tokens](https://bitpay.com/api-tokens) section. Click on the _Add New Token_ button and make a token with the `Point-of-Sale` capability without client authentication. You can then include this token with your application for distribution.\n\n## Sample Code and Usage\n\n### Creating a BitPay Client\n\n```javascript\nvar Bitpay = cordova.require('com.bitpay.sdk.cordova.Bitpay');\n\nvar bitpay = new Bitpay({\n        host: 'bitpay.com', // or 'test.bitpay.com'\n        port: 443,\n        token: '70163c90f...' // as retrieved from above\n    });\n```\n\n### Creating a New Invoice\n\n```javascript\nbitpay.createInvoice({\n    price: 314.15,\n    currency: 'USD'\n}, function(error, invoice){\n  if (error) throw error;\n\n  // subscribe to events\n  invoice.on('payment', function(e){\n    // do something on payment\n    var paid = invoice.data.btcPaid;\n  })\n\n  // open a native wallet with a signed payment request\n  invoice.openWallet();\n\n  // get the invoice url\n  var url = invoice.data.url;\n\n  // generate a qrcode\n  invoice.getQrCode({format: 'BIP72'}, function(elm){\n    // do something with the qrcode elm\n  });\n});\n```\n\n### Get an Invoice\n\n```javascript\nbitpay.getInvoice({\n    id: 'RyNzmZEbGwACpmNg8X6jGN'\n}, function(error, invoice){\n  if (error) throw error;\n\n  // do something with the invoice\n\n});\n```\n\n### Check if a Bitcoin Wallet is Available\n\n```javascript\nbitpay.isWalletAvailable(function(available) {\n    // e.g. enable open wallet button.\n});\n```\n\n### Advance Usage\nUnder the hood, the SDK works thanks to a powerful RPC client that you can also use. To use more of the advanced capabilities, such as the merchant facade, you'll need to pair the client. You can also use the included [command line tool](docs/cli.md) to explore more of the API.\n\n```javascript\nvar Client = cordova.require('com.bitpay.sdk.cordova.RPCClient')\n\nvar client = new Client({\n        host: 'test.bitpay.com',\n        port: 443,\n        token: '70163c90f...' // any type of token\n    });\n\nclient.callMethod(..., function(error, data){\n  ...\n});\n```\nTo read more about the RPC client go to the [advanced usage](docs/advanced_usage.md) section.\n\n\n# More Samples and Documentation\n\n### Sample Project\nTake a look at [this project](https://github.com/bitpay/cordova-sdk-sample)\nwhere an integration with a mock application is shown.\n\n### BitPay's API docs\nTo read more about invoices refer to the included [API documentation](docs/api.md).\n\n## Troubleshooting\n\nContact support via [our official helpdesk](https://help.bitpay.com) or [ask the community](https://github.com/bitpay/cordova-sdk/issues).\n\n## License\n\nCode released under [the MIT license](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitpay%2Fcordova-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitpay%2Fcordova-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitpay%2Fcordova-sdk/lists"}