{"id":15105789,"url":"https://github.com/fintech-systems/laravel-payfast-onsite","last_synced_at":"2025-09-27T05:30:58.144Z","repository":{"id":62355008,"uuid":"434850942","full_name":"fintech-systems/laravel-payfast-onsite","owner":"fintech-systems","description":"A PayFast Onsite Payments integration for Laravel designed to ease subscription billing. Livewire views included.","archived":true,"fork":false,"pushed_at":"2024-07-17T12:36:43.000Z","size":214,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-16T16:03:03.015Z","etag":null,"topics":["laravel","laravel-livewire","laravel-nova","payfast"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/fintech-systems.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"FintechSystems"}},"created_at":"2021-12-04T08:48:26.000Z","updated_at":"2024-07-17T12:44:26.000Z","dependencies_parsed_at":"2024-09-16T06:01:02.346Z","dependency_job_id":"60fa8284-e68b-428f-ae20-47fa5ca117af","html_url":"https://github.com/fintech-systems/laravel-payfast-onsite","commit_stats":{"total_commits":50,"total_committers":3,"mean_commits":"16.666666666666668","dds":"0.040000000000000036","last_synced_commit":"25ec182eab94b695924d2198ccddb5793b0f3f0d"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":"fintech-systems/packagist-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fintech-systems%2Flaravel-payfast-onsite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fintech-systems%2Flaravel-payfast-onsite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fintech-systems%2Flaravel-payfast-onsite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fintech-systems%2Flaravel-payfast-onsite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fintech-systems","download_url":"https://codeload.github.com/fintech-systems/laravel-payfast-onsite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234391377,"owners_count":18824809,"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":["laravel","laravel-livewire","laravel-nova","payfast"],"created_at":"2024-09-25T20:43:15.505Z","updated_at":"2025-09-27T05:30:52.744Z","avatar_url":"https://github.com/fintech-systems.png","language":"PHP","funding_links":["https://github.com/sponsors/FintechSystems"],"categories":[],"sub_categories":[],"readme":"## About Laravel PayFast Onsite\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/fintech-systems/laravel-payfast-onsite) [![Build Status](https://app.travis-ci.com/fintech-systems/laravel-payfast-onsite.svg?branch=main)](https://app.travis-ci.com/fintech-systems/laravel-payfast-onsite) ![GitHub](https://img.shields.io/github/license/fintech-systems/laravel-payfast-onsite)\n\n**Update 17 July 2024**\n\nThis repo is being archived.\n\nMost of the work here was continued at this repo:\nhttps://github.com/eugenefvdm/payfast-onsite-subscriptions\n\n---\n\nA [PayFast Onsite Payments](https://developers.payfast.co.za/docs#onsite_payments) implementation for Laravel designed to ease subscription billing. [Livewire](https://laravel-livewire.com/) views are included.\n\n**THIS IS BETA SOFTWARE**\n\n- There may be some bugs but the core functionality should work.\n\nRequirements:\n\n- PHP 8.0\n- Laravel\n- A [PayFast account](https://www.payfast.co.za/registration)\n\n## Installation\n\nInstall the package via composer:\n\n```bash\ncomposer require fintech-systems/laravel-payfast-onsite\n```\n\n## Publish Configuration and Views\n\nPublish the config file with:\n```bash\nphp artisan vendor:publish --provider=\"FintechSystems\\Payfast\\PayfastServiceProvider\" --tag=\"payfast-config\"\n```\n\nPublish the Success and Cancelled views and the Livewire components for subscriptions and receipts.\n\n```bash\nphp artisan vendor:publish --provider=\"FintechSystems\\Payfast\\PayfastServiceProvider\" --tag=\"payfast-views\"\n```\n\n### Nova Integration\n\nOptionally publish Laravel Nova Subscription and Receipts Resources\n\n```bash\nphp artisan vendor:publish --provider=\"FintechSystems\\Payfast\\PayfastServiceProvider\" --tag=\"payfast-nova-resource\"\n```\n\n## Migrations\n\nA migration is needed to create Customers, Orders, Receipts and Subscriptions tables:\n\n```bash\nphp artisan migrate\n```\n\n## Example Configuration\n\n`config/payfast.php`:\n\n```php\n\u003c?php\n\nreturn [\n    'merchant_id' =\u003e env('PAYFAST_MERCHANT_ID', '10004002'),\n    'merchant_key' =\u003e env('PAYFAST_MERCHANT_KEY', 'q1cd2rdny4a53'),\n    'passphrase' =\u003e env('PAYFAST_PASSPHRASE', 'payfast'),\n    'testmode' =\u003e env('PAYFAST_TESTMODE', true),        \n    'return_url' =\u003e env('PAYFAST_RETURN_URL', config('app.url') . '/payfast/success'),\n    'cancel_url' =\u003e env('PAYFAST_CANCEL_URL', config('app.url') . '/payfast/cancel'),\n    'notify_url' =\u003e env('PAYFAST_NOTIFY_URL', config('app.url') . '/payfast/webhook'),\n    'card_update_link_css' =\u003e env('CARD_UPDATE_LINK_CSS', 'inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:ring focus:ring-gray-300 disabled:opacity-25 transition'),\n    'card_updated_return_url' =\u003e env('CARD_UPDATED_RETURN_URL', config('app.url') . '/user/profile'),\n    'plans' =\u003e [\n        3 =\u003e [\n            'name' =\u003e 'Monthly R 99',\n            'start_date' =\u003e \\Carbon\\Carbon::now()-\u003eaddDay()-\u003eformat('Y-m-d'),\n            'payfast_frequency' =\u003e 3,\n            'initial_amount' =\u003e 5.99,\n            'recurring_amount' =\u003e 5.99,\n        ],\n        6 =\u003e [\n            'name' =\u003e 'Yearly R 1089',\n            'start_date' =\u003e \\Carbon\\Carbon::now()-\u003eformat('Y-m-d'),\n            'payfast_frequency' =\u003e 6,\n            'initial_amount' =\u003e 6.89,\n            'recurring_amount' =\u003e 6.89,\n        ]\n    ],\n    'cancelation_reasons' =\u003e [\n        'Too expensive',\n        'Lacks features',\n        'Not what I expected',\n    ],\n];\n```\n\n## Livewire Setup\n\n### Jetstream\n\nI have modelled some Livewire views to fit into a [Laravel Jetstream](https://jetstream.laravel.com) user profile page.\n\nWhen calling the Livewire component, you can override any [PayFast form field](https://developers.payfast.co.za/docs#step_1_form_fields) by specifying a `mergeFields` array.\n\nExample modification Jetstream Livewire's `resources/views/profiles/show.php`:\n\n```php\n\u003c!-- Subscriptions --\u003e\n\u003cdiv class=\"mt-10 sm:mt-0\"\u003e    \n    @livewire('jetstream-subscriptions', ['mergeFields' =\u003e [\n            'name_first' =\u003e $user-\u003ename,\n            'name_last' =\u003e $user-\u003ename,\n            'item_description' =\u003e 'Subscription to Online Service'\n        ]] )        \n\u003c/div\u003e\n\n\u003cx-jet-section-border /\u003e\n\u003c!-- End Subscriptions --\u003e\n\n\u003c!-- Receipts --\u003e\n    \u003cdiv class=\"mt-10 sm:mt-0\"\u003e\n        @livewire('jetstream-receipts')\n    \u003c/div\u003e\n\n\u003cx-jet-section-border /\u003e\n\u003c!-- End Receipts --\u003e\n```\n\n## Usage\n\n### Examples\n\n- Generate a payment link\n- Create an ad-hoc token optionally specifying the amount\n- Cancel a subscription\n- Update a card\n\n```php\nuse FintechSystems\\Payfast\\Facades\\Payfast;\n\nRoute::get('/payment', function() {\n    return Payfast::payment(5,'Order #1');\n});\n\nRoute::get('/cancel-subscription', function() {\n    return Payfast::cancelSubscription('73d2a218-695e-4bb5-9f62-383e53bef68f');\n});\n\nRoute::get('/create-subscription', function() {\n    return Payfast::createSubscription(\n        Carbon::now()-\u003eaddDay()-\u003eformat('Y-m-d'),\n        5, // Amount\n        6 // Frequency (6 = annual, 3 = monthly)\n    );\n});\n\nRoute::get('/create-adhoc-token', function() {\n    return Payfast::createAdhocToken(5);\n});\n\nRoute::get('/fetch-subscription', function() {\n    return Payfast::fetchSubscription('21189d52-12eb-4108-9c0e-53343c7ac692');\n});\n\nRoute::get('/update-card', function() {\n    return Payfast::updateCardLink('40ab3194-20f0-4814-8c89-4d2a6b5462ed');\n});\n```\n\n## Testing\n\n```bash\nvendor/bin/phpunit\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Screenshots\n\n![Livewire Subscriptions and Receipts Components](../../blob/main/screenshots/subscription_and_receipts.png)\n\n## Credits\n\n- [Eugene van der Merwe](https://github.com/eugenevdm)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffintech-systems%2Flaravel-payfast-onsite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffintech-systems%2Flaravel-payfast-onsite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffintech-systems%2Flaravel-payfast-onsite/lists"}