{"id":15067028,"url":"https://github.com/stephenjude/laravel-payment-gateways","last_synced_at":"2025-04-09T14:09:56.242Z","repository":{"id":44984942,"uuid":"494741356","full_name":"stephenjude/laravel-payment-gateways","owner":"stephenjude","description":"A simple Laravel API implementation for all payment providers.","archived":false,"fork":false,"pushed_at":"2024-03-25T18:42:16.000Z","size":208,"stargazers_count":93,"open_issues_count":0,"forks_count":16,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-13T21:53:20.812Z","etag":null,"topics":[],"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/stephenjude.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2022-05-21T09:44:19.000Z","updated_at":"2024-04-12T12:15:26.000Z","dependencies_parsed_at":"2023-12-19T07:14:56.034Z","dependency_job_id":"fbdc39c9-02e4-4c36-86be-342ca354b8d4","html_url":"https://github.com/stephenjude/laravel-payment-gateways","commit_stats":{"total_commits":211,"total_committers":5,"mean_commits":42.2,"dds":"0.44075829383886256","last_synced_commit":"a7d70106c05b3174a189a155531a9c30ef89b75c"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":"spatie/package-skeleton-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenjude%2Flaravel-payment-gateways","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenjude%2Flaravel-payment-gateways/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenjude%2Flaravel-payment-gateways/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenjude%2Flaravel-payment-gateways/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephenjude","download_url":"https://codeload.github.com/stephenjude/laravel-payment-gateways/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054194,"owners_count":21039952,"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":[],"created_at":"2024-09-25T01:15:27.479Z","updated_at":"2025-04-09T14:09:56.218Z","avatar_url":"https://github.com/stephenjude.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Payment Gateways\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/stephenjude/laravel-payment-gateways.svg?style=flat-square)](https://packagist.org/packages/stephenjude/laravel-payment-gateways)\n[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/stephenjude/laravel-payment-gateways/run-tests?label=tests)](https://github.com/stephenjude/laravel-payment-gateways/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/stephenjude/laravel-payment-gateways/Check%20\u0026%20fix%20styling?label=code%20style)](https://github.com/stephenjude/laravel-payment-gateways/actions?query=workflow%3A\"Check+%26+fix+styling\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/stephenjude/laravel-payment-gateways.svg?style=flat-square)](https://packagist.org/packages/stephenjude/laravel-payment-gateways)\n\nA simple Laravel implementation for all payment providers. This package supports \nPaystack, Monnify, Pay4Me Pay, Seerbit Flutterwave, Klasha, and Stripe.\n\n## Use Case\nHave you had to implement limited SDKs for accepting payments on your mobile app? \nThat's the problem this package solved.\n\nWith this package, you can generate a payment link and \nreturn it to your mobile app API call and the payment can be completed on the in-app browser.\n\nWhen the customer completes their payment, this package verifies the payment and executes the code defined inside your \ncustom closure. \n\nThe closure should look like this:\n\n```php\nuse Stephenjude\\PaymentGateway\\DataObjects\\TransactionData;\n\nfunction (TransactionData $payment){\n    $order-\u003eupdate([\n        'status' =\u003e $payment-\u003estatus, \n        'amount' =\u003e $payment-\u003eamount, \n        'currency' =\u003e $payment-\u003ecurrency\n    ]);\n    \n    $customer-\u003enotify(new OrderPaymentNotification($order));\n}\n```\n\nIf you are using this package on the web this closure is the place where you can return a redirect after updating the customer order or sending a notification.\n\n## Installation\n\nYou can install the package via Composer:\n\n```bash\ncomposer require stephenjude/laravel-payment-gateways\n```\n\nYou can publish the config file with:\n\n```bash\nphp artisan vendor:publish --tag=\"payment-gateways-config\"\n```\n\nOptionally, you can publish the views using\n\n```bash\nphp artisan vendor:publish --tag=\"payment-gateways-views\"\n```\n\n## Usage\nThis package currently supports `paystack`, `monnify`, `pay4me`, `seerbit`, `flutterwave`, `klasha` and `stripe`.\n\n### How to initialize a payment session\n\n```php\nuse Stephenjude\\PaymentGateway\\PaymentGateway;\nuse Stephenjude\\PaymentGateway\\DataObjects\\TransactionData;\n\n$provider = PaymentGateway::make('paystack')\n\n$paymentSession = $provider-\u003einitializeCheckout([\n    'currency' =\u003e 'NGN', // required\n    'amount' =\u003e 100, // required\n    'email' =\u003e 'customer@email.com', // required\n    'meta' =\u003e [ 'name' =\u003e 'Stephen Jude', 'phone' =\u003e '081xxxxxxxxx'],\n    'closure' =\u003e function (TransactionData $payment){\n        /* \n         * Payment verification happens immediately after the customer makes payment. \n         * The payment data obtained from the verification will be injected into this closure.\n         */\n        logger('payment details', [\n           'currency' =\u003e $payment-\u003ecurrency, \n           'amount' =\u003e $payment-\u003eamount, \n           'status' =\u003e $payment-\u003estatus,\n           'reference' =\u003e $payment-\u003ereference,   \n           'provider' =\u003e $payment-\u003eprovider,   \n           'date' =\u003e $payment-\u003edate,                   \n        ]);\n    },\n]);\n\n$paymentSession-\u003eprovider;\n$paymentSession-\u003echeckoutUrl;\n$paymentSession-\u003eexpires;\n```\n### Accessing payment transaction data\n```php\n\n$provider = PaymentGateway::make('paystack'); \n\n$transactions = $provider-\u003elistTransactions(); // Returns array\n\n$transaction = $provider-\u003efindTransaction(REFERENCE); // Returns Stephenjude\\PaymentGateway\\DataObjects\\TransactionData \n$transaction-\u003eprovider;\n$transaction-\u003eemail;\n$transaction-\u003eamount;\n$transaction-\u003ecurrency;\n$transaction-\u003ereference;\n$transaction-\u003estatus;\n$transaction-\u003edate;\n```\n\n### Pawapay Setup\n\nRequired Env Variables\n\n```\nPAWAPAY_SECRET=\n```\nCheckout\n\n```php \nuse \\Stephenjude\\PaymentGateway\\Enums\\Provider;\nuse \\Stephenjude\\PaymentGateway\\PaymentGateway;\n\n$pawapay = PaymentGateway::make(Provider::PAWAPAY())-\u003einitializeCheckout([\n    \"amount\" =\u003e 15,\n    \"country\" =\u003e \"ZMB\",\n    'meta' =\u003e [\n        \"description\" =\u003e \"Note of 4 to 22 chars\",\n        \"reason\" =\u003e \"Ticket to festival\"\n    ]\n]);\n```\n\n### Pay4Me Setup\n```\nPAY4ME_PUBLIC=\nPAY4ME_SECRET=\n```\n\n### Monnify Setup\n```\nMONNIFY_PUBLIC=\nMONNIFY_SECRET=\nMONNIFY_CONTRACT_CODE=\n```\n\n### Pay4Me Setup\n```\nSEERBIT_PUBLIC=\nSEERBIT_SECRET=\n```\n\n### Paystack Setup\n```\nPAYSTACK_PUBLIC=\nPAYSTACK_SECRET=\n```\n### Flutterwave Setup\n```\nFLUTTERWAVE_PUBLIC=\nFLUTTERWAVE_SECRET=\n```\n\n### Klasha Setup\n```\nKLASHA_PUBLIC=\nKLASHA_SECRET=\n```\n\n### Stripe Setup\n```\nSTRIPE_PUBLIC=\nSTRIPE_SECRET=\n```\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [stephenjude](https://github.com/stephenjude)\n- [All Contributors](../../contributors)\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%2Fstephenjude%2Flaravel-payment-gateways","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephenjude%2Flaravel-payment-gateways","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenjude%2Flaravel-payment-gateways/lists"}