PHP code example of cashmos / cashmos-php-api

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

    

cashmos / cashmos-php-api example snippets


$cashmos = new Cashmos\Cashmos($clientId, $secret);

    $confirmation = new Cashmos\Services\Order\OrderConfirmation($token);
    $cashmos = new Cashmos\Cashmos($clientId, $secret);
    
    if($cashmos->process($confirmation)){
        // Order confirmed successfully.
        // You can get any custom data after the order is confirmed.
        $customData = $confirmation->getCustomData();
    }else{
        // There was an error with order confirmation
        echo $cashmos->getError();
    }