{"id":13801465,"url":"https://github.com/eventOneHQ/capacitor-stripe-terminal","last_synced_at":"2025-05-13T11:31:14.614Z","repository":{"id":35448894,"uuid":"217052356","full_name":"eventOneHQ/capacitor-stripe-terminal","owner":"eventOneHQ","description":"💳 Capacitor plugin for Stripe Terminal (credit card readers)","archived":false,"fork":false,"pushed_at":"2024-01-23T17:47:00.000Z","size":1962,"stargazers_count":30,"open_issues_count":15,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-18T10:03:04.398Z","etag":null,"topics":["capacitor","capacitor-plugin","hacktoberfest","plugin","stripe","stripe-terminal"],"latest_commit_sha":null,"homepage":"https://oss.eventone.page/capacitor-stripe-terminal/","language":"TypeScript","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/eventOneHQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["nprail"],"ko_fi":"nprail"}},"created_at":"2019-10-23T12:31:47.000Z","updated_at":"2025-03-12T21:09:05.000Z","dependencies_parsed_at":"2024-01-02T23:09:54.540Z","dependency_job_id":"daae2210-c641-493f-a05d-11e5cd7bc9e0","html_url":"https://github.com/eventOneHQ/capacitor-stripe-terminal","commit_stats":{"total_commits":146,"total_committers":3,"mean_commits":"48.666666666666664","dds":0.3561643835616438,"last_synced_commit":"344eff40fdddab14f0a608d02c34adac9145eb27"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eventOneHQ%2Fcapacitor-stripe-terminal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eventOneHQ%2Fcapacitor-stripe-terminal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eventOneHQ%2Fcapacitor-stripe-terminal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eventOneHQ%2Fcapacitor-stripe-terminal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eventOneHQ","download_url":"https://codeload.github.com/eventOneHQ/capacitor-stripe-terminal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253932832,"owners_count":21986458,"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":["capacitor","capacitor-plugin","hacktoberfest","plugin","stripe","stripe-terminal"],"created_at":"2024-08-04T00:01:23.095Z","updated_at":"2025-05-13T11:31:11.120Z","avatar_url":"https://github.com/eventOneHQ.png","language":"TypeScript","funding_links":["https://github.com/sponsors/nprail","https://ko-fi.com/nprail"],"categories":["TypeScript","Other plugins"],"sub_categories":["Specialized Hardware"],"readme":"\u003cp align=\"center\"\u003e\u003cbr\u003e\u003cimg src=\"https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png\" width=\"128\" height=\"128\" /\u003e\u003c/p\u003e\n\u003ch3 align=\"center\"\u003eCapacitor Stripe Terminal\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\u003cstrong\u003e\u003ccode\u003ecapacitor-stripe-terminal\u003c/code\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  Capacitor plugin for \u003ca href=\"https://stripe.com/terminal\"\u003eStripe Terminal\u003c/a\u003e (unofficial)\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/maintenance/yes/2021?style=flat-square\" /\u003e\n  \u003ca href=\"https://github.com/eventonehq/capacitor-stripe-terminal/actions?query=workflow%3A%22Release%22\"\u003e\u003cimg src=\"https://img.shields.io/github/workflow/status/eventonehq/capacitor-stripe-terminal/Release?style=flat-square\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/capacitor-stripe-terminal\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/capacitor-stripe-terminal?style=flat-square\" /\u003e\u003c/a\u003e\n\u003cbr\u003e\n  \u003ca href=\"https://www.npmjs.com/package/capacitor-stripe-terminal\"\u003e\u003cimg src=\"https://img.shields.io/npm/dw/capacitor-stripe-terminal?style=flat-square\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/capacitor-stripe-terminal\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/capacitor-stripe-terminal?style=flat-square\" /\u003e\u003c/a\u003e\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n\u003ca href=\"#contributors-\"\u003e\u003cimg src=\"https://img.shields.io/badge/all%20contributors-0-orange?style=flat-square\" /\u003e\u003c/a\u003e\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\u003c/p\u003e\n\n**[Current project status](https://github.com/eventOneHQ/capacitor-stripe-terminal/discussions/42)**\n\n**_WARNING_**\n\n_These instructions are for v2 which is currently in beta. See the [`v1-support`](https://github.com/eventOneHQ/capacitor-stripe-terminal/tree/v1-support) branch for v1 instructions._\n\n## Maintainers\n\n| Maintainer | GitHub                              | Social                                      |\n| ---------- | ----------------------------------- | ------------------------------------------- |\n| Noah Prail | [nprail](https://github.com/nprail) | [@NoahPrail](https://twitter.com/NoahPrail) |\n\n## Installation\n\nUsing npm:\n\n```bash\nnpm install capacitor-stripe-terminal\n```\n\nUsing yarn:\n\n```bash\nyarn add capacitor-stripe-terminal\n```\n\nSync native files:\n\n```bash\nnpx cap sync\n```\n\n## Configuration\n\n### iOS\n\nFollow all Stripe instructions under [\"Configure your app\"](https://stripe.com/docs/terminal/sdk/ios#configure).\n\n### Android\n\nAdd the `ACCESS_FINE_LOCATION` permission to your app's manifest:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cmanifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    package=\"com.stripe.example.app\"\u003e\n\n    \u003cuses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /\u003e\n\u003c/manifest\u003e\n```\n\nOn Android, you must also make sure that Location permission has been granted by the user:\n\n```javascript\nif (Capacitor.getPlatform() === 'android') {\n  // check if permission is required\n  let response = await StripeTerminalPlugin.checkPermissions();\n\n  if (response.location === 'prompt') {\n    // if it is required, request it\n    response = await StripeTerminalPlugin.requestPermissions();\n\n    if (response.location !== 'granted') {\n      // if the request fails, show a message to the user\n      throw new Error('Location permission is required.')\n    }\n  }\n}\n\nconst terminal = await StripeTerminalPlugin.create({ ... })\n```\n\nIf the user does not grant permission, `StripeTerminalPlugin` will throw an error when you try to initialize it so you will have to handle that.\n\n_Hint: If the user denies Location permission the first time you ask for it, Android will not display a prompt to the user on subsequent requests for permission and `response` will always be `denied`. You will have to ask the user to go into the app's settings to allow Location permission._\n\n## Usage\n\n```javascript\nimport {\n  StripeTerminalPlugin,\n  DiscoveryMethod\n} from 'capacitor-stripe-terminal'\n\n// First, initialize the SDK\nconst terminal = await StripeTerminalPlugin.create({\n  fetchConnectionToken: async () =\u003e {\n    const resp = await fetch('https://your-backend.dev/token', {\n      method: 'POST'\n    })\n    const data = await resp.json()\n\n    return data.secret\n  },\n  onUnexpectedReaderDisconnect: () =\u003e {\n    // handle reader disconnect\n  }\n})\n\n// Start scanning for readers\n// capacitor-stripe-terminal uses Observables for any data streams\n// To stop scanning, unsubscribe from the Observable.\n// You must connect to a reader while scanning\nterminal\n  .discoverReaders({\n    simulated: false,\n    discoveryMethod: DiscoveryMethod.BluetoothProximity\n  })\n  .subscribe(readers =\u003e {\n    if (readers.length) {\n      const selectedReader = readers[0]\n      const connectionConfig = {\n        locationId: '{{LOCATION_ID}}'\n      }\n      terminal\n        .connectBluetoothReader(selectedReader, connectionConfig)\n        .then(connectedReader =\u003e {\n          // the reader is now connected and usable\n        })\n    }\n  })\n\n// Once the reader is connected, collect a payment intent!\n\n// subscribe to user instructions - these should be displayed to the user\nconst displaySubscription = terminal\n  .didRequestReaderDisplayMessage()\n  .subscribe(displayMessage =\u003e {\n    console.log('displayMessage', displayMessage)\n  })\nconst inputSubscription = terminal\n  .didRequestReaderInput()\n  .subscribe(inputOptions =\u003e {\n    console.log('inputOptions', inputOptions)\n  })\n\n// retrieve the payment intent\nawait terminal.retrievePaymentIntent('your client secret created server side')\n\n// collect the payment method\nawait terminal.collectPaymentMethod()\n\n// and finally, process the payment\nawait terminal.processPayment()\n\n// once you are done, make sure to unsubscribe (e.g. in ngOnDestroy)\ndisplaySubscription.unsubscribe()\ninputSubscription.unsubscribe()\n```\n\n## API Reference\n\nSee the full API docs [here](https://oss.eventone.page/capacitor-stripe-terminal).\n\n## Sponsors\n\n\u003cp\u003e\n    \u003ca href=\"https://event1.io/?utm_medium=opensource\u0026utm_source=capacitor-stripe-terminal\"\u003e\n        \u003cimg src=\"https://brand.event1.io/wordmark/wm.svg\" width=\"200px\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n    \u003ca href=\"https://tableneeds.com/?utm_medium=opensource\u0026utm_source=capacitor-stripe-terminal\"\u003e\n        \u003cimg src=\"https://tableneeds.com/wp-content/uploads/2021/08/tn-new.svg\" width=\"200px\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## Acknowledgements\n\n- Thanks [Stripe](https://stripe.com/terminal) for creating such an amazing product\n- Thanks [react-native-stripe-terminal](https://github.com/theopolisme/react-native-stripe-terminal) for quite a few borrowed concepts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FeventOneHQ%2Fcapacitor-stripe-terminal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FeventOneHQ%2Fcapacitor-stripe-terminal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FeventOneHQ%2Fcapacitor-stripe-terminal/lists"}