PHP code example of graftype / cloudpayments-php-client

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

    

graftype / cloudpayments-php-client example snippets


$client = new \CloudPayments\Manager($publicKey, $privateKey);
$transaction = $client->chargeToken($amount, $currency, $accountId, $cardToken);

echo $transaction->getId();

$items[] = array(
            "label" => 'Товар реальный', //наименование товара
            "price" => 30.00, //цена
            "quantity" => 3.00, //количество
            "amount" => 90.00, //сумма
            "vat" => 18, //ставка НДС
            "ean13" => '460123456789' //штрих-код, необязательный
);
$client->sendReceipt($inn, $invoiceId, $accountId, $items, $taxationSystem, $email, $phone);
bash
composer