PHP code example of apuspayments / client

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

    

apuspayments / client example snippets


$apusPaymentsAPI = new ApusPaymentsAPI(Environment::sandbox());

$makePayment = new MakePayment();

$makePayment->setAmount(10.00);
$makePayment->setBlockchain(BlockChainType::LTC);
$makePayment->setCurrency(CurrencyType::BRL);
$makePayment->setPan("9999999999999999");
$makePayment->setPassword("1234");
$makePayment->setVendorKey("5f5bdaed-f82b-4b82-b3f5-1d562633da5b");

$makePaymentResponse = $apusPaymentsAPI->makePayment($makePayment);

$apusPaymentsAPI = new ApusPaymentsAPI(Environment::sandbox());

$makeRecurringPayment = new MakeRecurringPayment();

$makeRecurringPayment->setAmount(10.00);
$makeRecurringPayment->setBlockchain(BlockChainType::LTC);
$makeRecurringPayment->setCurrency(CurrencyType::BRL);
$makeRecurringPayment->setPeriod(PeriodType::M);
$makeRecurringPayment->setFrequency(12);
$makeRecurringPayment->setExecute(true);
$makeRecurringPayment->setPan("9999999999999999");
$makeRecurringPayment->setPassword("1234");
$makeRecurringPayment->setVendorKey("5f5bdaed-f82b-4b82-b3f5-1d562633da5b");

$makeRecurringPaymentResponse = $apusPaymentsAPI->makeRecurringPayment($makePayment);

$apusPaymentsAPI = new ApusPaymentsAPI(Environment::sandbox());

$cancelPayment = new CancelPayment();

$cancelPayment->setTxId("2bf779e2a311c2629df977b0bb105879411fd71f5839972c4ed1d3278f80170f");
$cancelPayment->setPassword("1234");
$cancelPayment->setVendorKey("5f5bdaed-f82b-4b82-b3f5-1d562633da5b");

$cancelPaymentResponse = $apusPaymentsAPI->cancelPayment($cancelPayment);

$apusPaymentsAPI = new ApusPaymentsAPI(Environment::sandbox());

$searchPayment = new SearchPayment();
$searchPayment->setVendorKey("5f5bdaed-f82b-4b82-b3f5-1d562633da5b");

$searchPaymentResponse = $apusPaymentsAPI->searchPayment($searchPayment);

$apusPaymentsAPI = new ApusPaymentsAPI(Environment::sandbox());

$rechargeCryptoBalance = new RechargeCryptoBalance();

$rechargeCryptoBalance->setAmount(10.00);
$rechargeCryptoBalance->setBlockchain(BlockChainType::LTC);
$rechargeCryptoBalance->setCurrency(CurrencyType::BRL);
$rechargeCryptoBalance->setPan("9999999999999999");
$rechargeCryptoBalance->setPassword("1234");
$rechargeCryptoBalance->setVendorKey("5f5bdaed-f82b-4b82-b3f5-1d562633da5b");

$rechargeCryptoBalanceResponse = $apusPaymentsAPI->rechargeCryptoBalance($rechargeCryptoBalance);