Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

1alf/laravel-liqpay-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-liqpay-sdk

Liqpay SDK for Laravel

#Install

composer require 1alf/laravel-liqpay-sdk

php artisan vendor:publish --provider="ALF\LiqPay\LiqPayServiceProvider"

Using

You can use Laravel resolving and add LiqPay inside constructor

public function __construct(LiqPay $liqpay)
{
    parent::__construct();
    $this->liqpay = $liqpay;
}

or you can use it directly

$liqPay = new LiqPay('public_key', 'private_key');
try {
    $res = $liqPay->getApiClient()->request([
        'action'         => 'p2pcredit',
        'amount'         => '1',
        'currency'       => 'UAH',
        'description'    => 'description text',
        'order_id'       => '123456',
        'receiver_card'  => '4242424242424242',
        'receiver_last_name'  => 'LastName',
        'receiver_first_name'  => 'FirstName'
    ]);
    
    print_r($res);
} catch (BadResponseException $e) {
    echo $e->getMessage();
}