PHP code example of kobara / php-sdk

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

    

kobara / php-sdk example snippets


use Kobara\KobaraClient;

$kobara = new KobaraClient($_ENV['KOBARA_SECRET_KEY']);
$payment = $kobara->payments->create([
    'amount' => 2500,
    'currency' => 'HTG',
    'provider' => 'kobara',
    'success_url' => 'https://shop.example/success',
    'cancel_url' => 'https://shop.example/cancel',
], 'payment-1001');

echo $payment['data']['checkout_url'];

$withdrawal = $kobara->withdrawals->create([
    'amount' => 1000,
    'method' => 'moncash',
    'account_currency' => 'HTG',
    'wallet' => '50934567890',
], 'withdrawal-1001');
bash
composer