{"id":15282592,"url":"https://github.com/jogboms/nativescript-paystack","last_synced_at":"2025-04-12T23:06:40.052Z","repository":{"id":57308683,"uuid":"118921354","full_name":"jogboms/nativescript-paystack","owner":"jogboms","description":"Nativescript integration for Paystack payment platform","archived":false,"fork":false,"pushed_at":"2023-08-04T16:30:55.000Z","size":2685,"stargazers_count":16,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T17:08:40.338Z","etag":null,"topics":["android","ios","nativescript","payment-gateway","payment-integration","payments","paystack"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/jogboms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2018-01-25T14:13:49.000Z","updated_at":"2024-05-30T16:07:07.000Z","dependencies_parsed_at":"2024-10-14T14:21:12.331Z","dependency_job_id":"fb5d1ab0-49f5-4407-bf0b-bdd6c82e0467","html_url":"https://github.com/jogboms/nativescript-paystack","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jogboms%2Fnativescript-paystack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jogboms%2Fnativescript-paystack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jogboms%2Fnativescript-paystack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jogboms%2Fnativescript-paystack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jogboms","download_url":"https://codeload.github.com/jogboms/nativescript-paystack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312197,"owners_count":21082637,"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":["android","ios","nativescript","payment-gateway","payment-integration","payments","paystack"],"created_at":"2024-09-30T14:31:24.619Z","updated_at":"2025-04-12T23:06:40.023Z","avatar_url":"https://github.com/jogboms.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nativescript Paystack\n\n[![npm version](https://badge.fury.io/js/nativescript-paystack.svg)](https://badge.fury.io/js/nativescript-paystack)\n[![npm](https://img.shields.io/npm/dt/nativescript-paystack.svg?label=npm%20downloads)](https://www.npmjs.com/package/nativescript-paystack)\n[![Build Status](https://travis-ci.org/jogboms/nativescript-paystack.svg?branch=master)](https://travis-ci.org/jogboms/nativescript-paystack)\n\nNativescript-Paystack provides a wrapper that incorporate payments using [Paystack](https://paystack.com/) from within your {N} applications. The integration is achieved using the Paystack [Android](https://github.com/PaystackHQ/paystack-android)/[iOS](https://github.com/PaystackHQ/paystack-ios) SDK libraries. Hence, has full support for both Android \u0026 iOS.\n\n## Installation\n\nThe package should be installed via `tns plugin` for proper gradle and Pod setup.\n\n```bash\ntns plugin add nativescript-paystack\n```\n\n## Usage\n\n### Setup\n\nFirst import package into the `main-page`'s model or `app.component` as the case may be for either {N} Core or {N} w/ Angular\n\n```ts\nimport { NSPaystack } from \"nativescript-paystack\";\n```\n\nThen create an instance of `NSPaystack`.\n\n```ts\nthis.paystack = new NSPaystack();\n```\n\nInitialize the instance with the `publicKey` gotten from Paystack\n\n```ts\nthis.paystack.initialize(publicKey);\n```\n\n### Charging a Card\n\nTo charge a card, it is expected that the Form/UI responsible for handling the data collection is handled by you.\n\n```ts\nconst payment = this.paystack.payment(\u003cNSPaymentParams\u003e{\n    amount: 500000, // In Kobo\n    email: \"my.email@gmail.com\",\n    number: \"4084084084084081\",\n    cvc: \"408\",\n    year: 2019,\n    month: 3\n});\n\npayment\n    // Add metadata\n    .addMetadata(\"Hello\", \"World\")\n    // Add custom data fields\n    .addCustomField(\"Author\", \"Anonymous\");\n\n// Listen on when validation modal comes up\npayment.on(NSPayment.openDialogEvent, () =\u003e {\n    console.log(NSPayment.openDialogEvent);\n});\n\n// Listen on when validation modal goes out\npayment.on(NSPayment.closeDialogEvent, () =\u003e {\n    console.log(NSPayment.closeDialogEvent);\n});\n\npayment\n    .charge()\n    .then(({ reference }) =\u003e {\n        alert(`Reference: ${reference}`);\n    })\n    .catch(({ code, message, reference }) =\u003e {\n        alert(`An error occured`);\n        console.log(`Code: ${code}`);\n        console.log(`Message: ${message}`);\n        console.log(`Reference: ${reference}`); // If any\n    });\n```\n\n## API\n\n### Payload Signature\n\nThe payload signature is also available via the definition files.\n\n| Argument | Type   | Description                                    |\n| -------- | :----- | :--------------------------------------------- |\n| number   | string | the card number without any space seperator    |\n| month    | number | the card expiry month ranging from 1-12        |\n| year     | number | the card expiry year in a four-digits e.g 2019 |\n| cvc      | string | the card 3/4 digit security code               |\n| amount   | number | the charge amount in kobo                      |\n| email    | string | the customer's email address                   |\n\n### Response Signature\n\nPromise response signature is also available via the definition files.\n\n#### Success Response\n\n```ts\ninterface NSPaystackSuccessResponse {\n    reference: string;\n}\n```\n\n#### Error Response\n\n```ts\nexport interface NSPaystackErrorResponse {\n    code: number | string;\n    message: string;\n    reference?: string;\n}\n```\n\n### Note\nIt is expected that all tests be carried out on an actual device.\n\n## License\n\nApache License Version 2.0, January 2004\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjogboms%2Fnativescript-paystack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjogboms%2Fnativescript-paystack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjogboms%2Fnativescript-paystack/lists"}