{"id":32273108,"url":"https://github.com/youngcet/payfast","last_synced_at":"2026-02-21T08:02:22.316Z","repository":{"id":268578921,"uuid":"904725404","full_name":"youngcet/payfast","owner":"youngcet","description":"A Flutter package to integrate PayFast payments into your app.","archived":false,"fork":false,"pushed_at":"2025-12-06T22:36:21.000Z","size":57193,"stargazers_count":4,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-19T07:12:39.663Z","etag":null,"topics":["flutter","payfast","payment-gateway","payment-integration","payments"],"latest_commit_sha":null,"homepage":"","language":"Dart","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/youngcet.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-17T12:43:00.000Z","updated_at":"2025-12-06T22:36:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f329adb-a52f-4987-a838-2a0d5fbdc0c8","html_url":"https://github.com/youngcet/payfast","commit_stats":null,"previous_names":["youngcet/payfast"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/youngcet/payfast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcet%2Fpayfast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcet%2Fpayfast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcet%2Fpayfast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcet%2Fpayfast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youngcet","download_url":"https://codeload.github.com/youngcet/payfast/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcet%2Fpayfast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29676983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["flutter","payfast","payment-gateway","payment-integration","payments"],"created_at":"2025-10-22T23:15:03.654Z","updated_at":"2026-02-21T08:02:22.310Z","avatar_url":"https://github.com/youngcet.png","language":"Dart","funding_links":["https://www.buymeacoffee.com/yungcet"],"categories":[],"sub_categories":[],"readme":"# Payfast Flutter Package\n\n[![Pub Version](https://img.shields.io/pub/v/payfast)](https://pub.dev/packages/payfast)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/youngcet/payfast/blob/main/LICENSE)\n[![Last Commit](https://img.shields.io/github/last-commit/youngcet/payfast/main)](https://github.com/youngcet/payfast/commits/main)\n[![Issues](https://img.shields.io/github/issues/youngcet/payfast)](https://github.com/youngcet/payfast/issues)\n[![Coverage](https://img.shields.io/codecov/c/github/youngcet/payfast)](https://app.codecov.io/gh/youngcet/payfast)\n\n---\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/youngcet/payfast/blob/main/doc/payfast_demo.gif?raw=true\" height=\"600px\" style=\"border: 1px solid #ddd\"\u003e\n  \u003cimg src=\"https://github.com/youngcet/payfast/blob/main/doc/payfast_demo_live.gif?raw=true\" height=\"600px\" style=\"border: 1px solid #ddd\"\u003e\n\u003c/p\u003e\n\n---\n\n## Overview\n\n**Payfast Flutter Package** enables seamless Payfast payment integration for mobile Flutter apps (Android/iOS).  \n\u003e ⚠️ Web support is **not included** — use [Payfast Web](https://github.com/youngcet/payfast_web) for web apps.\n\n---\n\n## Installation\n\n```bash\nflutter pub add payfast\n```\n\nOr manually add:\n\n```yaml\ndependencies:\n  payfast: ^latest_version\n```\n\n---\n\n## Quick Start\n\nMinimal example:\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:payfast/payfast.dart';\n\nvoid main() =\u003e runApp(const MyApp());\n\nclass MyApp extends StatelessWidget {\n  const MyApp({super.key});\n\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      home: Scaffold(\n        body: PayFast(\n          data: {\n            'merchant_id': '000000',\n            'merchant_key': '000000',\n            'name_first': 'Yung',\n            'name_last': 'Cet',\n            'email_address': 'user@domain.com',\n            'm_payment_id': '123456',\n            'amount': '20',\n            'item_name': 'Subscription',\n          },\n          passPhrase: 'your-passphrase',\n          useSandBox: true, // Set to false for production\n          onsiteActivationScriptUrl: 'https://youngcet.github.io/sandbox_payfast_onsite_payments/', // ensure that this matches sandbox/live mode\n          onPaymentCompleted: (data) =\u003e print('Payment completed: $data'), // data contains payment details\n          onPaymentCancelled: () =\u003e print('Payment cancelled'),\n        ),\n      ),\n    );\n  }\n}\n```\n\n---\n\n## Android \u0026 iOS Setup\n\n**Android:**\n\nSet `minSdkVersion` in `android/app/build.gradle` to greater than 19:\n\nAdd `\u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e` permission in `android/app/src/main/AndroidManifest.xml`.\n\n**iOS:**\n\nAdd the key below in `ios/Runner/Info.plist`\n\n```xml\n\u003ckey\u003eio.flutter.embedded_views_preview\u003c/key\u003e\n\u003cstring\u003eYES\u003c/string\u003e\n```\n\n---\n\n## Hosting the Onsite Script\n\nYou must host the Payfast Onsite activation script (served over HTTPS).\n\nIf you don’t host your own file, you can use:\n- Sandbox: `https://youngcet.github.io/sandbox_payfast_onsite_payments/`\n- Live: `https://youngcet.github.io/payfast_onsite_payments/`\n\nAlternatively, host your own HTML file using the templates below.\n\n### Sandbox Version\n```html\n\u003chtml\u003e\n\u003chead\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\u003e\n    \u003cscript src=\"https://sandbox.payfast.co.za/onsite/engine.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003cscript\u003e\n        // DO NOT MODIFY THIS CODE\n\n        const queryString = window.location.search;\n        const urlParams = new URLSearchParams(queryString);\n        const uuid = urlParams.get('uuid');\n\n        window.payfast_do_onsite_payment({\"uuid\": uuid}, function (result) {\n            if (result === true) {\n                location.href = 'completed'; // triggers completed widget\n            } else {\n                location.href = 'closed'; // triggers cancelled widget\n            }\n        });\n    \u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Live Version\nTo switch to live mode, replace the Payfast script URL:\n\n```html\n\u003cscript src=\"https://www.payfast.co.za/onsite/engine.js\"\u003e\u003c/script\u003e\n```\n\nFor full documentation, see [Payfast Onsite Payments Docs](https://developers.payfast.co.za/docs#onsite_payments).\n\n---\n\n## FlutterFlow Integration\n\nYou can easily integrate Payfast into **FlutterFlow** using a **Custom Widget**.\n\n### Steps\n\n1. In **FlutterFlow**, go to **Custom Code → Custom Widgets**.\n2. Create a new widget named **PayFastWidget**.\n3. Add required parameters:\n   - `useSandBox` (bool)\n   - `passPhrase` (String)\n   - `data` (JSON/dynamic)\n   - `onsiteActivationScriptUrl` (String)\n   - `onPaymentCancelled` (Function)\n   - `onPaymentCompleted` (Function)\n4. Add dependency:\n   ```yaml\n   payfast: ^latest_version\n   ```\n5. Paste this widget code:\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:payfast/payfast.dart';\n\nclass PayFastWidget extends StatefulWidget {\n  final String passPhrase;\n  final bool useSandBox;\n  final dynamic data;\n  final Future Function() onPaymentCancelled;\n  final Future Function() onPaymentCompleted;\n  final String onsiteActivationScriptUrl;\n\n  final double? width;\n  final double? height;\n\n  const PayFastWidget({\n    required this.passPhrase,\n    required this.useSandBox,\n    required this.data,\n    required this.onsiteActivationScriptUrl,\n    required this.onPaymentCancelled,\n    required this.onPaymentCompleted,\n    this.width,\n    this.height,\n    Key? key,\n  }) : super(key: key);\n\n  @override\n  State\u003cPayFastWidget\u003e createState() =\u003e _PayFastWidgetState();\n}\n\nclass _PayFastWidgetState extends State\u003cPayFastWidget\u003e {\n  @override\n  Widget build(BuildContext context) {\n    return PayFast(\n      data: widget.data,\n      passPhrase: widget.passPhrase,\n      useSandBox: widget.useSandBox,\n      onsiteActivationScriptUrl: widget.onsiteActivationScriptUrl,\n      onPaymentCancelled: () =\u003e widget.onPaymentCancelled(),\n      onPaymentCompleted: (data) =\u003e widget.onPaymentCompleted(),\n    );\n  }\n}\n```\n\n6. Save, build, and use the widget in your FlutterFlow project.\n\n\u003e ✅ Use the sandbox URL for testing: `https://youngcet.github.io/sandbox_payfast_onsite_payments/`\n\n---\n\n## Key Features\n\n- Onsite payments (secure checkout inside app)\n- Sandbox \u0026 Live environments\n- Custom payment callbacks\n- Custom UI widgets (summary, buttons, overlays)\n- FlutterFlow support\n- Recurring billing (subscriptions \u0026 tokenization)\n- Error handling callbacks\n\n---\n\n## Common Properties\n\n| Property | Type | Description |\n|-----------|------|-------------|\n| `passPhrase` | `String` | Payfast passphrase |\n| `useSandBox` | `bool` | Use sandbox (test) mode |\n| `data` | `Map\u003cString, dynamic\u003e` | Payment details (amount, merchant info, etc.) |\n| `onsiteActivationScriptUrl` | `String` | Hosted Payfast script URL |\n| `onPaymentCompleted` | `Function(Map data)` | Callback after success |\n| `onPaymentCancelled` | `Function()` | Callback after cancel |\n| `waitingOverlayWidget` | `Widget` | Custom loading UI |\n| `paymentSummaryBuilder` | `Widget` | Custom payment summary UI |\n\n---\n\n## Recurring Billing\n\n**Subscriptions Example:**\n```dart\nPayFast(\n  data: {\n    'merchant_id': '0000000', \n    'merchant_key': 'xxxxxxxxx', \n    'name_first': 'Yung',\n    'name_last': 'Cet',\n    'email_address': 'some@domain.com',\n    'm_payment_id': '2547855',\n    'amount': '20',\n    'item_name': 'Subscription',\n    // subscription fields\n    'subscription_type': '1',\n    'billing_date': '2020-01-01', // optional\n    'recurring_amount': '123.45', // optional\n    'frequency': '3', // see table below\n    'cycles': '12',\n    'subscription_notify_email': 'true', // optional\n    'subscription_notify_webhook': 'true', // optional\n    'subscription_notify_buyer': 'true' // optional\n  },\n  ...\n), \n```\n\n#### Frequency\n\n| Value | Frequency  |\n|-------|------------|\n| 1     | Daily      |\n| 2     | Weekly     |\n| 3     | Monthly    |\n| 4     | Quarterly  |\n| 5     | Biannually |\n| 6     | Annually   |\n\n**Tokenization Example:**\n```dart\nPayFast(\n  data: {\n    'merchant_id': '0000000',\n    'merchant_key': 'xxxxxxxxx', \n    'name_first': 'Yung',\n    'name_last': 'Cet',\n    'email_address': 'some@domain.com',\n    'm_payment_id': '2547855',\n    'amount': '20',\n    'item_name': 'Subscription',\n    // subscription fields\n    'subscription_type': '2',\n  },\n  ...\n), \n```\n\nSee [Payfast Docs](https://developers.payfast.co.za/docs#recurring_billing).\n\n---\n\n## Error Handling\n\n```dart\nPayFast(\n  ...\n  onError: (msg) =\u003e print('Error: $msg'),\n);\n```\n\n## Documentation\n\n[Click here to view the detailed documentation](https://github.com/youngcet/payfast/blob/main/DETAILED.md).\n\n---\n\n## Contributing\n\nPull requests and issues are welcome on [GitHub](https://github.com/youngcet/payfast).\n\nJoin the community on Discord → [#payfast-flutter-package](https://discord.gg/n35vTTHY)\n\n---\n\n## License\n\n[MIT License](https://github.com/youngcet/payfast/blob/main/LICENSE)\n\nSupport the project ☕ [Buy Me a Coffee](https://www.buymeacoffee.com/yungcet)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoungcet%2Fpayfast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoungcet%2Fpayfast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoungcet%2Fpayfast/lists"}