PHP code example of andisiahaan / tripay-php

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

    

andisiahaan / tripay-php example snippets




use AndiSiahaan\Tripay\Client;

$client = new Client(getenv('TRIPAY_API_KEY'), getenv('TRIPAY_PRIVATE_KEY'), false, getenv('TRIPAY_MERCHANT_CODE'));

// Example: list payment channels
$channels = $client->paymentChannels()->list();
print_r($channels);
bash
composer 
powershell
php vendor\\bin\\phpunit -v
powershell
$env:TRIPAY_API_KEY='your-api-key'; $env:TRIPAY_PRIVATE_KEY='your-private-key'; $env:TRIPAY_MERCHANT_CODE='YOUR_MERCHANT_CODE'; php examples/example_create_transaction.php