PHP code example of zerosdev / linkqu-php

1. Go to this page and download the library: Download zerosdev/linkqu-php 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/ */

    

zerosdev / linkqu-php example snippets




namespace App\Http\Controllers;

use LinkQu;

class YourController extends Controller
{
    public function index()
    {
        $result = LinkQu::transaction()->createVa(function($va) {
            $va->setAmount(10000)
                ->setExpired(60)
                ->setCustomerId(uniqid())
                ->setPartnerRef(time())
                ->setCustomerName('Nama Pelanggan')
                ->setCustomerPhone('08123456789')
                ->setCustomerEmail('[email protected]')
                ->setBankCode('014');
        });

        if( LinkQu::hasError() ) {
            print_r(LinkQu::errors());
        } else {
            print_r($result);
        }
    }
}



erosDev\LinkQu\Client;
use ZerosDev\LinkQu\Constant;

$linkqu = new Client(function($client) {
    $client->setMode(Constant::DEVELOPMENT)
        ->setClientId('testing')
        ->setClientSecret('123')
        ->setServerKey('LinkQu@2020')
        ->setUsername('LI307GXIN')
        ->setPin('2K2NPCBBNNTovgB');
});

$result = $linkqu->transaction()->createVa(function($va) {
    $va->setAmount(10000)
    ->setExpired(60)
    ->setCustomerId(uniqid())
    ->setPartnerRef(time())
    ->setCustomerName('Nama Pelanggan')
    ->setCustomerPhone('08123456789')
    ->setCustomerEmail('[email protected]')
    ->setBankCode('014');
});

if( $linkqu->hasError() ) {
    print_r($linkqu->errors());
} else {
    print_r($result);
}