magedahmad/larapayment

A package to handle different payment gateways

v0.2 2021-02-02 10:09 UTC

This package is auto-updated.

Last update: 2024-10-29 05:59:45 UTC


README

Total Downloads Latest Version Latest Version Development Branch Made With

A package to handle different payment gateways

Installation

You can install the package via composer:

composer require magedahmad/larapayment

After installing, register the service provider inside config/app.php

MagedAhmad\LaraPayment\LaraPaymentServiceProvider::class,

in terminal publish the migration and config file with

php artisan vendor:publish --provider="MagedAhmad\LaraPayment\LaraPaymentServiceProvider

and migrate the db table

php artisan migrate

in app/config/larapament.php you need to modify the API keys

Usage

paymob instructions

use MagedAhmad\LaraPayment\LaraPayment;


$payment = new LaraPayment();

// payment gateway = paymob
// amount to pay in usd = 100$
$payment->make_payment("paymob", 100, $items);

default currency is USD, if you want you can change currency in constructor.

$payment = new LaraPayment('EGP');

Response would return the iframe that you need to include in your blade file

after completing transaction you would be redirected to a route you specify in paymob itself

in the function handling the callback url you need to verify the transaction.

example code:

public function receive(Request $request) 
{
    $laraPayment = new LaraPayment();

    $laraPayment->verify_paymob($request->order, $request->all()); // return status
}

And That's it !

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email maged.ahmedr@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.