2017 © Pedro Peláez
 

package moyasarapi

Moyasar Api Package With Laravel 5.0 above ^ created by phpanonymous :)

image

moyasarphpanonymouscom/moyasarapi

Moyasar Api Package With Laravel 5.0 above ^ created by phpanonymous :)

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 22 % Grown

The README.md

moyasar package with moyasar.com

Moyasar Api Package With Laravel 5.0 => 5.3 and above ^ created by phpanonymous :), (*1)

Installation

run this commad on your composer, (*2)

composer require moyasarphpanonymouscom/moyasarapi:dev-master 

attention please

this package based on guzzlehttp version 6.2 don't worry this package auto downloaded by Composer, (*3)

app.php preparing

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 ',
];

usage

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();

default methods By Moyasar Api

// 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)

The Versions

09/01 2017

dev-master

9999999-dev

Moyasar Api Package With Laravel 5.0 above ^ created by phpanonymous :)

  Sources   Download

MIT

The Requires

 

laravel api php payment banking integration phpanonymous moyasar getaway