PHP code example of berbix / berbix-php

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

    

berbix / berbix-php example snippets


$client = new \Berbix\Client("your_api_secret_here");

$transactionTokens = $client->createTransaction(array(
  'customerUid' => "internal_customer_uid", // ID for the user in internal database
  'templateKey' => "your_template_key", // Template key for this transaction
));

$refreshToken = ''; // fetched from database
$transactionTokens = \Berbix\Tokens::fromRefresh($refreshToken);

$transactionData = $client->fetchTransaction($transactionTokens);