{"id":15008379,"url":"https://github.com/katya-solutions-llc/flutter_paystack","last_synced_at":"2026-01-30T09:05:59.073Z","repository":{"id":247064963,"uuid":"824935124","full_name":"Katya-Solutions-LLC/flutter_paystack","owner":"Katya-Solutions-LLC","description":"💳 A powerful Flutter plugin for integrating the Paystack Payment Gateway into your mobile apps, supporting both Android and iOS. This plugin provides a secure, reliable, and seamless payment solution, allowing users to make transactions using cards, bank payments, and mobile money. It offers a straightforward integration process, customzilations!","archived":false,"fork":false,"pushed_at":"2024-12-22T22:22:52.000Z","size":1508,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T09:36:18.235Z","etag":null,"topics":["dart","dart-package","dartlang","flutter","flutter-app","flutter-apps","flutter-examples","flutter-plugin","flutter-ui","katya","paystack","paystack-api","paystack-sdk","porosenocheck"],"latest_commit_sha":null,"homepage":"https://pitomec.rechain.network","language":"Dart","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/Katya-Solutions-LLC.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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":"2024-07-06T10:33:02.000Z","updated_at":"2025-03-06T09:50:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"47e3e911-be4e-47a5-94d0-cfa9a7e5d19f","html_url":"https://github.com/Katya-Solutions-LLC/flutter_paystack","commit_stats":null,"previous_names":["katya-solutions-llc/flutter_paystack"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Katya-Solutions-LLC/flutter_paystack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Katya-Solutions-LLC%2Fflutter_paystack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Katya-Solutions-LLC%2Fflutter_paystack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Katya-Solutions-LLC%2Fflutter_paystack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Katya-Solutions-LLC%2Fflutter_paystack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Katya-Solutions-LLC","download_url":"https://codeload.github.com/Katya-Solutions-LLC/flutter_paystack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Katya-Solutions-LLC%2Fflutter_paystack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260081958,"owners_count":22956218,"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":["dart","dart-package","dartlang","flutter","flutter-app","flutter-apps","flutter-examples","flutter-plugin","flutter-ui","katya","paystack","paystack-api","paystack-sdk","porosenocheck"],"created_at":"2024-09-24T19:18:00.260Z","updated_at":"2026-01-30T09:05:59.045Z","avatar_url":"https://github.com/Katya-Solutions-LLC.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :credit_card: Paystack Plugin for Flutter\n\n[![build status](https://img.shields.io/github/workflow/status/wilburt/flutter_paystack/Build%20and%20Test)](https://github.com/wilburt/flutter_paystack/actions?query=Build+and+test)\n[![Coverage Status](https://coveralls.io/repos/github/wilburt/flutter_paystack/badge.svg?branch=master)](https://coveralls.io/github/wilburt/flutter_paystack?branch=master)\n[![pub package](https://img.shields.io/pub/v/flutter_paystack.svg)](https://pub.dartlang.org/packages/flutter_paystack)\n\nA Flutter plugin for making payments via Paystack Payment Gateway. Fully\nsupports Android and iOS.\n\n## :rocket: Installation\nTo use this plugin, add `flutter_paystack` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).\n\nThen initialize the plugin preferably in the `initState` of your widget.\n\n``` dart\nimport 'package:flutter_paystack/flutter_paystack.dart';\n\nclass _PaymentPageState extends State\u003cPaymentPage\u003e {\n  var publicKey = '[YOUR_PAYSTACK_PUBLIC_KEY]';\n  final plugin = PaystackPlugin();\n\n  @override\n  void initState() {\n    plugin.initialize(publicKey: publicKey);\n  }\n}\n```\n\nNo other configuration required\u0026mdash;the plugin works out of the box.\n\n## :heavy_dollar_sign: Making Payments\nThere are two ways of making payment with the plugin.\n1.  **Checkout**: This is the easy way; as the plugin handles all the\n    processes involved in making a payment (except transaction\n    initialization and verification which should be done from your\n    backend).\n2.  **Charge Card**: This is a longer approach; you handle all callbacks\n    and UI states.\n\n### 1. :star2: Checkout (Recommended)\n You initialize a charge object with an amount, email \u0026 accessCode or\n reference. Pass an `accessCode` only when you have\n [initialized the transaction](https://developers.paystack.co/reference#initialize-a-transaction)\n from your backend. Otherwise, pass a `reference`.\n \n\n ```dart\n Charge charge = Charge()\n       ..amount = 10000\n       ..reference = _getReference()\n        // or ..accessCode = _getAccessCodeFrmInitialization()\n       ..email = 'customer@email.com';\n     CheckoutResponse response = await plugin.checkout(\n       context context,\n       method: CheckoutMethod.card, // Defaults to CheckoutMethod.selectable\n       charge: charge,\n     );\n ```\n\nPlease, note that an `accessCode` is required if the method is\n`CheckoutMethod.bank` or `CheckoutMethod.selectable`.\n\n `plugin.checkout()` returns the state and details of the\n payment in an instance of `CheckoutResponse` .\n \n \n It is recommended that when `plugin.checkout()` returns, the\n payment should be\n [verified](https://developers.paystack.co/v2.0/reference#verify-transaction)\n on your backend.\n\n### 2. :star: Charge Card\nYou can choose to initialize the payment locally or via your backend.\n\n#### A. Initialize Via Your Backend (Recommended)\n\n1.a. This starts by making a HTTP POST request to\n[paystack](https://developers.paystack.co/reference#initialize-a-transaction)\non your backend.\n\n1.b If everything goes well, the initialization request returns a response with an `access_code`.\nYou can then create a `Charge` object with the access code and card details. The `charge` is in turn passed to the `plugin.chargeCard()` function for payment:\n\n```dart\n  PaymentCard _getCardFromUI() {\n    // Using just the must-required parameters.\n    return PaymentCard(\n      number: cardNumber,\n      cvc: cvv,\n      expiryMonth: expiryMonth,\n      expiryYear: expiryYear,\n    );\n  }\n\n  _chargeCard(String accessCode) async {\n    var charge = Charge()\n      ..accessCode = accessCode\n      ..card = _getCardFromUI();\n\n    final response = await plugin.chargeCard(context, charge: charge);\n    // Use the response\n  }\n```\nThe transaction is successful if `response.status` is true. Please, see the documentation \nof [CheckoutResponse](https://pub.dev/documentation/flutter_paystack/latest/flutter_paystack/CheckoutResponse-class.html)\nfor more information. \n\n\n\n#### 2. Initialize Locally\nJust send the payment details to  `plugin.chargeCard`\n```dart\n      // Set transaction params directly in app (note that these params\n      // are only used if an access_code is not set. In debug mode,\n      // setting them after setting an access code would throw an error\n      Charge charge = Charge();\n      charge.card = _getCardFromUI();\n      charge\n        ..amount = 2000\n        ..email = 'user@email.com'\n        ..reference = _getReference()\n        ..putCustomField('Charged From', 'Flutter PLUGIN');\n      _chargeCard();\n```\n\n\n## :wrench: :nut_and_bolt: Validating Card Details\nYou are expected but not required to build the UI for your users to enter their payment details.\nFor easier validation, wrap the **TextFormField**s inside a **Form** widget. Please check this article on\n[validating forms on Flutter](https://medium.freecodecamp.org/how-to-validate-forms-and-user-input-the-easy-way-using-flutter-e301a1531165)\nif this is new to you.\n\n**NOTE:** You don't have to pass a card object to ``Charge``. The plugin will call-up a UI for the user to input their card.\n\nYou can validate the fields with these methods:\n#### card.validNumber\nThis method helps to perform a check if the card number is valid.\n\n#### card.validCVC\nMethod that checks if the card security code is valid.\n\n#### card.validExpiryDate\nMethod checks if the expiry date (combination of year and month) is valid.\n\n#### card.isValid\nMethod to check if the card is valid. Always do this check, before charging the card.\n\n\n#### card.getType\nThis method returns an estimate of the string representation of the card type(issuer).\n\n\n## :heavy_check_mark: Verifying Transactions\nThis is quite easy. Just send a HTTP GET request to `https://api.paystack.co/transaction/verify/$[TRANSACTION_REFERENCE]`.\nPlease, check the  [official documentaion](https://developers.paystack.co/reference#verifying-transactions) on verifying transactions.\n\n## :helicopter: Testing your implementation\nPaystack provides tons of [payment cards](https://developers.paystack.co/docs/test-cards) for testing.\n\n## :arrow_forward: Running Example project\nFor help getting started with Flutter, view the online [documentation](https://flutter.io/).\n\nAn [example project](https://github.com/wilburt/flutter_paystack/tree/master/example) has been provided in this plugin.\nClone this repo and navigate to the **example** folder. Open it with a supported IDE or execute `flutter run` from that folder in terminal.\n\n## :pencil: Contributing, :disappointed: Issues and :bug: Bug Reports\nThe project is open to public contribution. Please feel very free to contribute.\nExperienced an issue or want to report a bug? Please, [report it here](https://github.com/wilburt/flutter_paystack/issues). Remember to be as descriptive as possible.\n\n## :trophy: Credits\nThanks to the authors of Paystack [iOS](https://github.com/PaystackHQ/paystack-ios) and [Android](https://github.com/PaystackHQ/paystack-android) SDKS. I leveraged on their work to bring this plugin to fruition.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatya-solutions-llc%2Fflutter_paystack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkatya-solutions-llc%2Fflutter_paystack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatya-solutions-llc%2Fflutter_paystack/lists"}