PHP code example of 1alf / laravel-liqpay-sdk

1. Go to this page and download the library: Download 1alf/laravel-liqpay-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

1alf / laravel-liqpay-sdk example snippets


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

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