dev-master
9999999-devMoyasar Api Package With Laravel 5.0 above ^ created by phpanonymous :)
MIT
The Requires
- php >= 5.5.0
- guzzlehttp/guzzle ^6.2
laravel api php payment banking integration phpanonymous moyasar getaway
Moyasar Api Package With Laravel 5.0 above ^ created by phpanonymous :)
Moyasar Api Package With Laravel 5.0 => 5.3 and above ^ created by phpanonymous :), (*1)
run this commad on your composer, (*2)
composer require moyasarphpanonymouscom/moyasarapi:dev-master
this package based on guzzlehttp version 6.2 don't worry this package auto downloaded by Composer, (*3)
you maybe want add this on providers array to config/app.php
, (*4)
Moyasarphpanonymouscom\MoyasarApi\MoyasarProvider::class,
add this on aliases array, (*5)
'Moyasar' => Moyasarphpanonymouscom\MoyasarApi\MoyasarFaced::class,
after save app.php
run this command in your composer to make moyasar.php and move to config folder automatically, (*6)
php artisan vendor:publish
and you must be signup account with https://moyasar.com and generate new keys like this https://moyasar.com/docs/api/?php#authentication you should update your config, (*7)
return [ 'Test_Secret_Key'=>'Add Your Secret Key Here :)', 'Test_Publishable_Key'=>'Add Your Test Publishable Key Here', 'Live_Secret_Key'=>'Add Your Live Secret Key Here', 'Live_Publishable_Key'=>'Add Your Live Publishable Key Here ', ];
use this class to set api key with this method, (*8)
Moyasar::setApiKey(config('moyasar.Test_Secret_Key'));
if you want make a new invoices use this method, (*9)
Moyasar::InvCreate('10000','pay me');
to query about invoice use this method, (*10)
Moyasar::InvFetch("your id invoice "); // this method get array like this if success paid https://moyasar.com/docs/api/?php#payments // https://moyasar.com/docs/api/?php#invoices // if can be the payments array not empty and source .. check message key is successed to check invoice paid or not
to create new payment jus use this method on your site to input type credit card or visa like this, (*11)
// const class type /* Moyasar::CREDIT_CARD Moyasar::CURRENCY Moyasar::DESCRIPTION Moyasar::SOURCE Moyasar::SADAD Moyasar::AMOUNT */ $card = [ "type" => Moyasar::CREDIT_CARD, "name" => "Abdulaziz Nasser", "number" => "4111111111111111", "cvc" => 331, "month" => 12, "year" => 2017 ]; // price cardinfo description currency return Moyasar::PayCreate("10000" ,$card, "bag payment", "SAR"); // check status array to successed
to get all invoices use this method, (*12)
// get all invoices paid return Moyasar::PayAll();
// Client Class By Moyasar Moyasarphpanonymouscom\MoyasarApi\MoyasarFaced\Moyasar\Client // Invoice Class By Moyasar Moyasarphpanonymouscom\MoyasarApi\MoyasarFaced\Moyasar\Invoice // Payment Class By Moyasar Moyasarphpanonymouscom\MoyasarApi\MoyasarFaced\Moyasar\Payment // HttpRequestNotFound Class By Moyasar Moyasarphpanonymouscom\MoyasarApi\MoyasarFaced\Moyasar\HttpRequestNotFound // ============ OR You Can Add In aliases Array =============== // 'Client' =>Moyasarphpanonymouscom\MoyasarApi\MoyasarFaced\Moyasar\Client::class, 'Invoice' =>Moyasarphpanonymouscom\MoyasarApi\MoyasarFaced\Moyasar\Invoice::class, 'Payment' =>Moyasarphpanonymouscom\MoyasarApi\MoyasarFaced\Moyasar\Payment::class, 'HttpRequestNotFound'=>Moyasarphpanonymouscom\MoyasarApi\MoyasarFaced\Moyasar\HttpRequestNotFound::class,
soon a simple video to usage it if you have any questions can ask me in this group in facebook https://www.facebook.com/groups/anonymouses.developers enjoy :), (*13)
Moyasar Api Package With Laravel 5.0 above ^ created by phpanonymous :)
MIT
laravel api php payment banking integration phpanonymous moyasar getaway