LaravelPackages.net
Acme Inc.
Toggle sidebar
plan-a23/paymob

:package_description

6
0
About plan-a23/paymob

plan-a23/paymob is a Laravel package for :package_description. It currently has 0 GitHub stars and 6 downloads on Packagist. Install it with composer require plan-a23/paymob. Discover more Laravel packages by plan-a23 or browse all Laravel packages to compare alternatives.

Last updated

Paymob

Latest Version on Packagist Total Downloads

This is where your description should go. Take a look at contributing.md to see a to do list.

Installation

Via Composer

$ composer require plan-a23/paymob

Main Setup

Config

$ php artisan vendor:publish --tag=config --force

env

PAYMOB_API_KEY: xxxxxxx
PAYMOB_HMAC: xxxxxxxx

Card

env

PAYMOB_CARD_INTEGRATION:xxxxx
PAYMOB_CARD_IFRAME_ID:xxxxx

Payment

use PlanA23\Paymob\Classes\CardPay;

$pay = new CardPay();
$pay->setItems([
    [
        "name"=>"ASC1515",
        "amount_cents"=> "500000",
        "description"=>"Smart Watch",
        "quantity"=> "1"
    ],
    [
        "name"=> "ERT6565",
        "amount_cents"=> "200000",
        "description"=> "Power Bank",
        "quantity"=> "1"
    ]
]);
$pay->setAmountCents(700000);
$pay->setPayOrderId(2); // don't duplicate this id
// can enter shipping data only or shipping and billing
$pay->setShippingData(
    first_name: 'test',
    last_name:'test',
    email: '[email protected]',
    phone_number:'+201xxxxxxxx',
    country:'EG',
    state:'giza',
    city: '6 october',
    street: '123 elhosry' ,
    postal_code: 34546
);
$pay->setBillingData( 
    first_name: 'test',
    last_name:'test',
    email: '[email protected]',
    phone_number:'+201xxxxxxxx',
    country:'EG',
    state:'giza',
    city: '6 october',
    street: '123' ,
    postal_code: 34546);
return $pay->payment();

Wallet

env

PAYMOB_WALLETS_INTEGRATION:xxxxxxx

payment

use PlanA23\Paymob\Classes\WalletPay;
$pay = new WalletPay();
$pay->setItems([
    [
        "name"=>"ASC1515",
        "amount_cents"=> "500000",
        "description"=>"Smart Watch",
        "quantity"=> "1"
    ],
    [
        "name"=> "ERT6565",
        "amount_cents"=> "200000",
        "description"=> "Power Bank",
        "quantity"=> "1"
    ]
]);
$pay->setAmountCents(700000);
$pay->setPayOrderId(2); // don't duplicate this id
// can enter shipping data only or shipping and billing
$pay->setShippingData(
    first_name: 'test',
    last_name:'test',
    email: '[email protected]',
    phone_number:'+201xxxxxxxx',
    country:'EG',
    state:'giza',
    city: '6 october',
    street: '123 elhosry' ,
    postal_code: 34546
);
$pay->setBillingData(
    first_name: 'test',
    last_name:'test',
    email: '[email protected]',
    phone_number:'+201xxxxxxxx',
    country:'EG',
    state:'giza',
    city: '6 october',
    street: '123 elhosry' ,
    postal_code: 34546);
$pay->setPhoneNumber('+201xxxxxxxxx'); // for wallet
return $pay->payment(); //this is link for payment

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.

Comments