PHP code example of genuka / pay-sdk

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

    

genuka / pay-sdk example snippets


use Genuka\Pay\GenukaClient;

$genuka = new GenukaClient(
    publicKey: getenv('GENUKA_PUBLIC_KEY'),
    secretKey: getenv('GENUKA_SECRET_KEY'),
);

$payin = $genuka->payins()->create([
    'amount' => 2000,
    'currency' => 'XAF',
    'payer_phone' => '+237694010263',
    'operator_code' => 'ORANGE_MONEY',
    'metadata' => [
        'order_id' => 'ORD-1001',
    ],
]);

$genuka->payins()->create($payload, idempotencyKey: 'order-1001');
$genuka->payins()->list(['per_page' => 20]);
$genuka->payins()->checkStatus('track-xxx');

$genuka->payouts()->create($payload, idempotencyKey: 'payout-1001');
$genuka->payouts()->list(['per_page' => 20]);
$genuka->payouts()->get('payout-id');
$genuka->payouts()->cancel('payout-id');

$genuka->checkout()->create($payload);
$genuka->checkout()->get('checkout-token');