{"id":18484075,"url":"https://github.com/lazerpayhq/lazerpay-react-native","last_synced_at":"2025-04-08T18:33:04.938Z","repository":{"id":37268781,"uuid":"445363332","full_name":"LazerpayHQ/lazerpay-react-native","owner":"LazerpayHQ","description":"⚡️Official Lazerpay's react native library🚀 ","archived":false,"fork":false,"pushed_at":"2022-06-23T18:50:23.000Z","size":2870,"stargazers_count":30,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T15:40:15.182Z","etag":null,"topics":["blockchain","crypto","fintech","lazerpay","payment","payments","react-native","web3"],"latest_commit_sha":null,"homepage":"https://lazerpay.finance","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/LazerpayHQ.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}},"created_at":"2022-01-07T01:38:07.000Z","updated_at":"2024-01-08T07:31:07.000Z","dependencies_parsed_at":"2022-09-07T13:20:21.053Z","dependency_job_id":null,"html_url":"https://github.com/LazerpayHQ/lazerpay-react-native","commit_stats":null,"previous_names":["lazerpay-finance/lazerpay-react-native"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LazerpayHQ%2Flazerpay-react-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LazerpayHQ%2Flazerpay-react-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LazerpayHQ%2Flazerpay-react-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LazerpayHQ%2Flazerpay-react-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LazerpayHQ","download_url":"https://codeload.github.com/LazerpayHQ/lazerpay-react-native/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247902709,"owners_count":21015501,"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":["blockchain","crypto","fintech","lazerpay","payment","payments","react-native","web3"],"created_at":"2024-11-06T12:38:29.012Z","updated_at":"2025-04-08T18:32:59.919Z","avatar_url":"https://github.com/LazerpayHQ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lazerpay Official react-native sdk\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request)\n\nThe package allows you accept payment using Lazerpay, install, add keys and use. No stress :)\n\n## Installation\n\n`yarn add lazerpay-react-native @react-native-clipboard/clipboard`\n\nThis version requires `@react-native-clipboard/clipboard` to work\n\nfor iOS: `cd iOS \u0026\u0026 pod install \u0026\u0026 cd ..`\n\nfor expo applications run;\n\n`expo install lazerpay-react-native`\n\nAlso install `react-native-webview` because it's a dependency for this package. Here's a [link](https://github.com/react-native-webview/react-native-webview) to their docs.\n\n```sh\nyarn add react-native-webview\n```\n\nand that's it, you're all good to go!\n\n\u003cimg src=\"https://raw.githubusercontent.com/njokuScript/screenshots/master/step-1.png\" alt='screenshot of SDK' width='306px' /\u003e\n## Usage\n\n```js\nimport { Lazerpay } from 'lazerpay-react-native';\n\nconst Pay = () =\u003e {\n  const [openSDK, setopenSDK] = useState(false);\n\n  const metadata = {\n    'product name': 'Burger and Pepsi',\n    'Product Owner': 'Jeremiah Daniel',\n  };\n\n  return (\n    \u003cView\u003e\n      \u003cLazerpay\n        {...{\n          publicKey: 'PUBLIC_KEY',\n          customerName: 'CUSTOMERS FULL NAME',\n          customerEmail: 'CUSTOMER EMAIL',\n          currency: 'CURRENCY', // USD, NGN, AED, GBP, EUR\n          amount: '10', // amount as a number or string\n          reference: '9192nsjisoi',\n          acceptPartialPayment: true,\n          metadata, // metadata (optional) is an object of information you wish to pass\n          onSuccess: (response) =\u003e {\n            // handle response here\n          },\n          onClose: () =\u003e setopenSDK(false),\n          onError: (response) =\u003e {\n            // handle responsne here\n          },\n          openSDK,\n        }}\n      /\u003e\n\n      \u003cTouchableOpacity onPress={() =\u003e setopenSDK(true)}\u003e\n        \u003cText\u003e Initiate Payment\u003c/Text\u003e\n      \u003c/TouchableOpacity\u003e\n    \u003c/View\u003e\n  );\n};\n```\n\n### NOTE\n\n`reference` has to be updated after any successful partial payment to enable re-initialization.\n\n## Configuration Options\n\n- [`publicKey`](#publicKey)\n- [`customerName`](#customerName)\n- [`customerEmail`](#customerEmail)\n- [`currency`](#currency)\n- [`reference`](#reference)\n- [`amount`](#amount)\n- [`metadata`](#metadata)\n- [`onSuccess`](#onSuccess)\n- [`onError`](#onError)\n- [`onClose`](#onClose)\n\n### \u003ca name=\"publicKey\"\u003e\u003c/a\u003e `publicKey`\n\n**string: Required**\nYour public key can be found on your [dashboard](https://beta.lazerpay.finance) settings.\n\n### \u003ca name=\"customerName\"\u003e\u003c/a\u003e `customerName`\n\n**string: Required**\nThe name of the customer trying to make payments\n\n### \u003ca name=\"customerEmail\"\u003e\u003c/a\u003e `customerEmail`\n\n**string: Required**\nThe email of the customer trying to make payments\n\n### \u003ca name=\"currency\"\u003e\u003c/a\u003e `currency`\n\n**string: Required**\nThe name of the fiat currency the merchant accepts\n\n### \u003ca name=\"amount\"\u003e\u003c/a\u003e `amount`\n\n**number | string: Required**\nThe amount you want to charge the user in `currency`\n\n### \u003ca name=\"metadata\"\u003e\u003c/a\u003e `metadata`\n\n**object : Optional**\nThis contains any additional information you want to pass with this transaction\n\n### \u003ca name=\"reference\"\u003e\u003c/a\u003e `reference`\n\n**string : Optional**\na unique string used to identifier the user\n\n### \u003ca name=\"acceptPartialPayment\"\u003e\u003c/a\u003e `acceptPartialPayment`\n\n**boolean : Optional**\nThis boolean is used to enforce complete payments\n\n### \u003ca name=\"businessLogo\"\u003e\u003c/a\u003e `businessLogo`\n\n**string: Required**\nThe logo of your business as url in string\n\n### \u003ca name=\"onSuccess\"\u003e\u003c/a\u003e `onSuccess`\n\n**(response) =\u003e { Void }: Required**\nThis is called when a transaction is successfully. It returns a response.\n\n### \u003ca name=\"onError\"\u003e\u003c/a\u003e `onError `\n\n**(response) =\u003e { Void }: Required**\nThis is called when a transaction fails. It returns a response.\n\n\u003c!-- See the [event details](#lazerpayEvent) below. --\u003e\n\n### \u003ca name=\"onClose\"\u003e\u003c/a\u003e `onClose `\n\n**() =\u003e { Void }: Required**\nThis is called when a user clicks on the close button.\n\nThe Transaction JSON returned for successful events\n\n```ts\n{\n  \"data\": {\n    \"acceptPartialPayment\": false,\n    \"actualAmount\": 2,\n    \"amountPaid\": 2,\n    \"amountPaidFiat\": 1.9988,\n    \"amountReceived\": 2.02,\n    \"amountReceivedFiat\": 2.018788,\n    \"blockNumber\": 16348693,\n    \"blockchain\": \"Binance Smart Chain\",\n    \"coin\": \"BUSD\",\n    \"currency\": \"USD\",\n    \"customer\": {\n      \"customerEmail\": \"kalunjoku123@gmail.com\",\n      \"customerName\": \"Njoku Emmanuel\",\n      \"customerPhone\": null,\n      \"id\": \"b847dbbd-e5a4-4afc-ba26-b292707dc391\",\n      \"network\": \"mainnet\"\n    },\n    \"feeInCrypto\": 0.02,\n    \"fiatAmount\": 2,\n    \"hash\": \"0x1df0c16f2ee61136c682e92b13ecc38be0f62c100bb9941c92cdac1dc9ab5155\",\n    \"id\": \"221a0296-16e6-47dd-b9de-b16dc1270e1a\",\n    \"network\": \"mainnet\",\n    \"recipientAddress\": \"0xc5Ea2AD69FeA1442B721E76e39384E3BB9B16694\",\n    \"reference\": \"3rYZeRbmIe\",\n    \"senderAddress\": \"0x0B4d358D349809037003F96A3593ff9015E89efA\",\n    \"status\": \"confirmed\",\n    \"type\": \"received\"\n  },\n  \"event\": \"successful\"\n}\n```\n\n## Configuration Options for Making Payments\n\n### \u003ca name=\"openSDK\"\u003e\u003c/a\u003e `openSDK`\n\n**boolean: Required**\n\nThis is a prop to display/hide the sdk\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## Support\n\nIf you're having trouble with Lazerpay React Native SDK or your integration, please reach out to us at \u003chelp@lazerpay.finance\u003e or come chat with us on Slack. We're more than happy to help you out.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flazerpayhq%2Flazerpay-react-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flazerpayhq%2Flazerpay-react-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flazerpayhq%2Flazerpay-react-native/lists"}