PHP code example of capitalpayments / sdk

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

    

capitalpayments / sdk example snippets


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

$response = $Sdk->login();


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# get the environment : response >= int $sandobox (0 or 1)
$response = $Sdk->getEnvironment();


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# get the account data
$response = $Sdk->getAccount();


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# get the balance from the api
$response = $Sdk->getBalance();


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# get main wallet data (private key is 

 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# retrives all wallets attached to api 
$response = $Sdk->getWallets();


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# retrieve the invoice data
$response = $Sdk->createInvoice([
    'invoice_id' => 'invoice_id' # string 
    'amount' => 'amount' # float|int 
]);


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# retrieve the invoices data
$response = $Sdk->createInvoices([
    [
        'invoice_id' => 'invoice_id' # string 
        'amount' => 'amount' # float|int 
    ],
    [
        'invoice_id' => 'invoice_id' # string 
        'amount' => 'amount' # float|int 
    ]
]);


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# get the invoice status
$response = $Sdk->getInvoiceStatus([
    'invoice_id' => 'invoice_id' # string 
]);


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# get the invoice status
$response = $Sdk->cancelInvoice([
    'invoice_id' => 'invoice_id' # string 
]);


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# retrieve the payout data
$response = $Sdk->createPayout([
    'payout_id' => 'payout_id' # string 
    'amount' => 'amount' # float|int 
    'address' => 'USDT.TRC20WalletAddress' # string
]);


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# retrieve the payouts data
$response = $Sdk->createPayouts([
    [
        'payout_id' => 'payout_id' # string 
        'amount' => 'amount' # float|int 
        'address' => 'USDT.TRC20WalletAddress' # string
    ],
    [
        'payout_id' => 'payout_id' # string 
        'amount' => 'amount' # float|int 
        'address' => 'USDT.TRC20WalletAddress' # string
    ]
]);


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# get the payout status
$response = $Sdk->getPayoutStatus([
    'payout_id' => 'payout_id' # string 
]);


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# cancel payout  
$response = $Sdk->cancelPayout([
    'payout_id' => 'PayoutId', # @string
]);


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# retrieve the item data
$response = $Sdk->createItem([
    'title' => 'title' # string 
    'description' => 'description' # float|int 
    'price' => 'price' # string
]);


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# retrieve the item data
$response = $Sdk->getItem([
    'item_id' => 'item_id' # string 
]);


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# retrieve the items data
$response = $Sdk->getItems();


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# 
$response = $Sdk->deleteItem([
    'item_id' => 'item_id' # string 
]);



 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# retrieve the customer data
$response = $Sdk->createCustomer([
    'name' => 'name' # string 
    'email' => 'email' # float|int 
    'whatsapp' => 'whatsapp' # float|int 
    'address' => 'address' # string
]);


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# retrieve the customer data
$response = $Sdk->getCustomer([
    'customer_id' => 'customer_id' # string 
]);


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

#
$response = $Sdk->getCustomers();


 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# 
$response = $Sdk->deleteCustomer([
    'customer_id' => 'customer_id' # string 
]);



 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# set invoice as payed (it will takes 5 minutes to complete the payment invoice process)
$response = $Sdk->setTestInvoiceAsPayed([
    'invoice_id' => 'InvioceID-InvoiceNumber1', # @string
]);




 

 new CapitalPayments\Sdk\Sdk('api_key','api_secret');

# set deposit wallet
$response = $Sdk->setDepositWallet([
    'address' => 'USDT.TRC20_WALLET_ADDRESS', # @string
]);