PHP code example of mywaygames / api-client

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

    

mywaygames / api-client example snippets


$apiClient = new MywayGames\ApiClient;

// Set the API base URI, if you are not sure please contact your admin
$apiClient->setBaseUri('https://test.myway-games.com/api/v1/');

var_dump($apiClient->createTestAccount()->response());

$apiClient->auth(["username" => "YOUR_USERANEM","password" => "YOUR_USERANEM"]);

$apiClient->auth(["api_key" => "YOUR_API_KEY"]);

$apiClient->getUserData()->response()->userdata;

$apiClient->getUserData()->response()->userdata->balance;

$apiClient->products()->response();

$apiClient->denominations('all')->response();

$apiClient->products()->response();

$apiClient->denominations(2)->response();

$order_args = [];

// Unuque uuidv4 token that you need to generate to avoid placing duplicate orders.
$order_args['orderToken'] = $apiClient->generateToken();

// The denomination_id you want to buy "which you received by calling ->denominations()"
$order_args['denomination_id'] = 1;

// Optional, default is 1
$order_args['qty'] = 1;

// Required only if the product you want to order is a topup product "i.e has 

$apiClient->orderDetails(21)->response();