PHP code example of fshangala / cws

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

    

fshangala / cws example snippets




namespace App\Http\Controllers;
use Fshangala\Cws\Core\WalletCore;

class ExampleController extends Controller
{
  public function exampleMethod()
  {
    $wallet = new WalletCore();
    $user_id = 1;
    $response = createWallet($user_id);
    
    return response($response);
  }
}



namespace App\Http\Controllers;
use Fshangala\Cws\Core\WalletCore;

class ExampleController extends Controller
{
  public function exampleMethod()
  {
    $wallet = new WalletCore();
    $user_id = 1;
    $currency = "USD";
    $debit = 200;
    $reference = "Deposit request";
    $response = depositRequest($user_id,$currency,$debit,$reference);
    
    return response($response);
  }
}



namespace App\Http\Controllers;
use Fshangala\Cws\Core\WalletCore;

class ExampleController extends Controller
{
  public function exampleMethod()
  {
    $wallet = new WalletCore();
    $user_id = 1;
    $currency = "USD";
    $credit = 200;
    $response = withdrawRequest($user_id,$currency,$credit);
    
    return response($response);
  }
}



namespace App\Http\Controllers;
use Fshangala\Cws\Core\WalletCore;

class ExampleController extends Controller
{
  public function exampleMethod()
  {
    $wallet = new WalletCore();
    $user_id = 1;
    $wallet_id = 2;
    $currency = "USD";
    $amount = 200;
    $reference = "Transfer funds to account 2";
    $response = transfer($user_id,$wallet_id,$currency,$amount,$reference);
    
    return response($response);
  }
}



namespace App\Http\Controllers;
use Fshangala\Cws\Core\WalletCore;

class ExampleController extends Controller
{
  public function exampleMethod()
  {
    $wallet = new WalletCore();
    $transaction_id = 1;
    $response =  approveTransaction($transaction_id);
    
    return response($response);
  }
}



namespace App\Http\Controllers;
use Fshangala\Cws\Core\WalletCore;

class ExampleController extends Controller
{
  public function exampleMethod()
  {
    $wallet = new WalletCore();
    $user_id = 1;
    $response = transactionHistory($user_id);
    
    return response($response);
  }
}



namespace App\Http\Controllers;
use Fshangala\Cws\Core\WalletCore;

class ExampleController extends Controller
{
  public function exampleMethod()
  {
    $wallet = new WalletCore();
    $transaction_id = 1;
    $response =  getTransaction($transaction_id);
    
    return response($response);
  }
}



namespace App\Http\Controllers;
use Fshangala\Cws\Core\WalletCore;

class ExampleController extends Controller
{
  public function exampleMethod()
  {
    $wallet = new WalletCore();
    $response = totalBalance();
    
    return response($response);
  }
}



namespace App\Http\Controllers;
use Fshangala\Cws\Core\WalletCore;

class ExampleController extends Controller
{
  public function exampleMethod()
  {
    $wallet = new WalletCore();
    $user_id = 1;
    $response = totalWalletBalance($user_id);
    
    return response($response);
  }
}