PHP code example of quarksgroup / paypack-php

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

    

quarksgroup / paypack-php example snippets






$paypack = new  Paypack();

$paypack->config([
'client_id' => 'xxxx',
'client_secret' => 'xxxx'
]);

$transactions = $paypack->Transactions();

print_r($transactions);
 
$cashin = $paypack->Cashin([
	'phone' => "078xxxxxxx",
	'amount' => "100"
]); 

print_r($cashin);
 
$cashout = $paypack->Cashout([
	'phone' => "078xxxxxxx",
	'amount' => "100"
]); 

print_r($cashout);
 
$transactions = $paypack->Transactions([
	'offset' => "0",
	'limit' => "100"
]);

print_r($transactions);

 - offset	String() // offset of transactions to fetch
 - limit	String() // limit of transactions to fetch default is 20
 - from		Date()	// starting date range of transactions to fetch
 - to		Date() // ending date range of transactions to fetch
 - kind		String() //  kind of transactions to fetch eg: CASHIN or CASHOUT
 - client	Number() // transactions for a specific client

$transaction = $paypack->Transaction($transactionRef);

print_r($transaction);
 
$events= $paypack->Events([
	'offset' => "0",
	'limit' => "100"
]);

print_r($events);

- offset	String() // offset of events to fetch
 - limit	String() // limit of events to fetch default is 20
 - from		Date()	// starting date range of events to fetch
 - to		Date() // ending date range of events to fetch
 - kind		String() //  kind of events to fetch eg: CASHIN or CASHOUT
 - client	Number() // events for a specific client
 - ref		String() // events for a specific transaction ref
 - status	String() // events with a specific status eg: pending or successfull or failed
 
$profile= $paypack->Me(); 

print_r($profile);
bash
composer