PHP code example of blockchyp / blockchyp-php

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

    

blockchyp / blockchyp-php example snippets




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
    'terminalName' => 'Test Terminal',
    'amount' => '55.00',
];


$response = BlockChyp::charge($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
    'terminalName' => 'Test Terminal',
    'amount' => '27.00',
];


$response = BlockChyp::preauth($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
    'transactionId' => '<ORIGINAL TRANSACTION ID>',
    'amount' => '32.00',
];


$response = BlockChyp::capture($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'transactionId' => '<PREVIOUS TRANSACTION ID>',

    // Optional amount for partial refunds.
    'amount' => '5.00',
];


$response = BlockChyp::refund($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
    'transactionId' => '<PREVIOUS TRANSACTION ID>',
];


$response = BlockChyp::void($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'transactionRef' => '<LAST TRANSACTION REF>',
];


$response = BlockChyp::reverse($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
    'terminalName' => 'Test Terminal',
    'amount' => '50.00',
];


$response = BlockChyp::giftActivate($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
    'terminalName' => 'Test Terminal',
    'cardType' => BlockChyp::CARD_TYPE_EBT,
];


$response = BlockChyp::balance($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
];


$response = BlockChyp::closeBatch($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'transactionRef' => '<TX REF>',
    'amount' => '199.99',
    'description' => 'Widget',
    'subject' => 'Widget invoice',
    'transaction' => [
        'subtotal' => '195.00',
        'tax' => '4.99',
        'total' => '199.99',
        'items' => [
            [
                'description' => 'Widget',
                'price' => '195.00',
                'quantity' => 1,
            ],
        ],
    ],
    'autoSend' => true,
    'customer' => [
        'customerRef' => 'Customer reference string',
        'firstName' => 'FirstName',
        'lastName' => 'LastName',
        'companyName' => 'Company Name',
        'emailAddress' => '[email protected]',
        'smsNumber' => '(123) 123-1231',
    ],
];


$response = BlockChyp::sendPaymentLink($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'linkCode' => '<PAYMENT LINK CODE>',
];


$response = BlockChyp::resendPaymentLink($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'linkCode' => '<PAYMENT LINK CODE>',
];


$response = BlockChyp::cancelPaymentLink($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'linkCode' => '<PAYMENT LINK CODE>',
];


$response = BlockChyp::paymentLinkStatus($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'transactionId' => '<TRANSACTION ID>',
];


$response = BlockChyp::transactionStatus($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'amount' => '100.00',
    'cashDiscount' => true,
    'surcharge' => true,
];


$response = BlockChyp::cashDiscount($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'maxResults' => 250,
    'startIndex' => 0,
];


$response = BlockChyp::batchHistory($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'batchId' => '<BATCH ID>',
];


$response = BlockChyp::batchDetails($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'maxResults' => 10,
    'batchId' => '<BATCH ID>',
];


$response = BlockChyp::transactionHistory($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'terminalName' => 'Test Terminal',
];


$response = BlockChyp::listQueuedTransactions($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'terminalName' => 'Test Terminal',
    'transactionRef' => '*',
];


$response = BlockChyp::deleteQueuedTransaction($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'terminalName' => 'Test Terminal',
];


$response = BlockChyp::ping($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'terminalName' => 'Test Terminal',
];


$response = BlockChyp::locate($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
    'terminalName' => 'Test Terminal',
];


$response = BlockChyp::clear($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'terminalName' => 'Test Terminal',
];


$response = BlockChyp::terminalStatus($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'terminalName' => 'Test Terminal',

    // File format for the signature image.
    'sigFormat' => BlockChyp::SIGNATURE_FORMAT_PNG,

    // Width of the signature image in pixels.
    'sigWidth' => 200,
];


$response = BlockChyp::captureSignature($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
    'terminalName' => 'Test Terminal',
    'transaction' => [
        'subtotal' => '60.00',
        'tax' => '5.00',
        'total' => '65.00',
        'items' => [
            [
                'description' => 'Leki Trekking Poles',
                'price' => '35.00',
                'quantity' => 2,
                'extended' => '70.00',
                'discounts' => [
                    [
                        'description' => 'memberDiscount',
                        'amount' => '10.00',
                    ],
                ],
            ],
        ],
    ],
];


$response = BlockChyp::newTransactionDisplay($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
    'terminalName' => 'Test Terminal',
    'transaction' => [
        'subtotal' => '60.00',
        'tax' => '5.00',
        'total' => '65.00',
        'items' => [
            [
                'description' => 'Leki Trekking Poles',
                'price' => '35.00',
                'quantity' => 2,
                'extended' => '70.00',
                'discounts' => [
                    [
                        'description' => 'memberDiscount',
                        'amount' => '10.00',
                    ],
                ],
            ],
        ],
    ],
];


$response = BlockChyp::updateTransactionDisplay($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
    'terminalName' => 'Test Terminal',
    'message' => 'Thank you for your business.',
];


$response = BlockChyp::message($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
    'terminalName' => 'Test Terminal',
    'prompt' => 'Would you like to become a member?',
    'yesCaption' => 'Yes',
    'noCaption' => 'No',
];


$response = BlockChyp::booleanPrompt($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
    'terminalName' => 'Test Terminal',

    // Type of prompt. Can be 'email', 'phone', 'customer-number', or
    // 'rewards-number'.
    'promptType' => BlockChyp::PROMPT_TYPE_EMAIL,
];


$response = BlockChyp::textPrompt($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
];


$response = BlockChyp::terminals($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'terminalId' => '<TERMINAL ID>',
];


$response = BlockChyp::deactivateTerminal($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'terminalName' => 'Test Terminal',
    'activationCode' => '<ACTIVATION CODE>',
];


$response = BlockChyp::activateTerminal($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'terminalName' => 'Test Terminal',
];


$response = BlockChyp::reboot($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
    'terminalName' => 'Test Terminal',

    // Alias for a Terms and Conditions template configured in the BlockChyp
    // dashboard.
    'tcAlias' => 'hippa',

    // Name of the contract or document if not using an alias.
    'tcName' => 'HIPPA Disclosure',

    // Full text of the contract or disclosure if not using an alias.
    'tcContent' => 'Full contract text',

    // File format for the signature image.
    'sigFormat' => BlockChyp::SIGNATURE_FORMAT_PNG,

    // Width of the signature image in pixels.
    'sigWidth' => 200,

    // Whether or not a signature is 



// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
];


$response = BlockChyp::tcTemplates($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'templateId' => '<TEMPLATE ID>',
];


$response = BlockChyp::tcTemplate($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'alias' => 'HIPPA',
    'name' => 'HIPPA Disclosure',
    'content' => 'Lorem ipsum dolor sit amet.',
];


$response = BlockChyp::tcUpdateTemplate($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'templateId' => '<TEMPLATE ID>',
];


$response = BlockChyp::tcDeleteTemplate($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'logEntryId' => '<LOG ENTRY ID>',
];


$response = BlockChyp::tcLog($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'logEntryId' => '<ENTRY ID>',
];


$response = BlockChyp::tcEntry($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
    'terminalName' => 'Test Terminal',
];


$response = BlockChyp::enroll($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'token' => '<TOKEN>',
];


$response = BlockChyp::tokenMetadata($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'token' => '<TOKEN>',
    'customerId' => '<CUSTOMER ID>',
];


$response = BlockChyp::linkToken($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'token' => '<TOKEN>',
    'customerId' => '<CUSTOMER ID>',
];


$response = BlockChyp::unlinkToken($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'token' => '<TOKEN>',
];


$response = BlockChyp::deleteToken($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'customer' => [
        'id' => '<CUSTOMER ID>',
        'customerRef' => 'Customer reference string',
        'firstName' => 'FirstName',
        'lastName' => 'LastName',
        'companyName' => 'Company Name',
        'emailAddress' => '[email protected]',
        'smsNumber' => '(123) 123-1231',
    ],
];


$response = BlockChyp::updateCustomer($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'customerId' => '<CUSTOMER ID>',
];


$response = BlockChyp::customer($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'query' => '(123) 123-1234',
];


$response = BlockChyp::customerSearch($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'customerId' => '<CUSTOMER ID>',
];


$response = BlockChyp::deleteCustomer($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
];


$response = BlockChyp::surveyQuestions($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'questionId' => '<QUESTION ID>',
];


$response = BlockChyp::surveyQuestion($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'id' => '<QUESTION ID>',
    'ordinal' => 1,
    'questionText' => 'Would you shop here again?',
    'questionType' => 'yes_no',
    'enabled' => true,
];


$response = BlockChyp::updateSurveyQuestion($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'questionId' => '<QUESTION ID>',
];


$response = BlockChyp::deleteSurveyQuestion($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'questionId' => '<QUESTION ID>',
];


$response = BlockChyp::surveyResults($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
];


$response = BlockChyp::media($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'fileName' => 'aviato.png',
    'fileSize' => 18843,
    'uploadId' => '<RANDOM ID>',
];


$file = file_get_contents('aviato.png');
$response = BlockChyp::uploadMedia($request, $file);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'uploadId' => '<UPLOAD ID>',
];


$response = BlockChyp::uploadStatus($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'mediaId' => '<MEDIA ASSET ID>',
];


$response = BlockChyp::mediaAsset($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'mediaId' => '<MEDIA ASSET ID>',
];


$response = BlockChyp::deleteMediaAsset($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
];


$response = BlockChyp::slideShows($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'slideShowId' => '<SLIDE SHOW ID>',
];


$response = BlockChyp::slideShow($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'name' => 'Test Slide Show',
    'delay' => 5,
    'slides' => [
        [
            'mediaId' => '<MEDIA ID>',
        ],
    ],
];


$response = BlockChyp::updateSlideShow($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'slideShowId' => '<SLIDE SHOW ID>',
];


$response = BlockChyp::deleteSlideShow($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
];


$response = BlockChyp::terminalBranding($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'mediaId' => '<MEDIA ID>',
    'padded' => true,
    'ordinal' => 10,
    'startDate' => '01/06/2021',
    'startTime' => '14:00',
    'endDate' => '11/05/2024',
    'endTime' => '16:00',
    'notes' => 'Test Branding Asset',
    'preview' => false,
    'enabled' => true,
];


$response = BlockChyp::updateBrandingAsset($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'assetId' => '<BRANDING ASSET ID>',
];


$response = BlockChyp::deleteBrandingAsset($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
];


$response = BlockChyp::merchantProfile($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'test' => true,
];


$response = BlockChyp::getMerchants($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'merchantId' => '<MERCHANT ID>',
    'test' => true,
    'dbaName' => 'Test Merchant',
    'companyName' => 'Test Merchant',
    'billingAddress' => [
        'address1' => '1060 West Addison',
        'city' => 'Chicago',
        'stateOrProvince' => 'IL',
        'postalCode' => '60613',
    ],
];


$response = BlockChyp::updateMerchant($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'merchantId' => '<MERCHANT ID>',
];


$response = BlockChyp::merchantUsers($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'email' => 'Email address for the invite',
];


$response = BlockChyp::inviteMerchantUser($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'profile' => [
        'dbaName' => 'DBA Name',
        'companyName' => 'Corporate Entity Name',
    ],
];


$response = BlockChyp::addGatewayMerchant($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'dbaName' => 'DBA Name',
    'companyName' => 'Corporate Entity Name',
];


$response = BlockChyp::addTestMerchant($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
    'merchantId' => '<MERCHANT ID>',
];


$response = BlockChyp::deleteTestMerchant($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
];


$response = BlockChyp::pricingPolicy($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
];


$response = BlockChyp::partnerStatements($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
];


$response = BlockChyp::partnerStatementDetail($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
];


$response = BlockChyp::merchantInvoices($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
];


$response = BlockChyp::merchantInvoiceDetail($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
];


$response = BlockChyp::partnerCommissionBreakdown($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;




// For composer based systems
_once('/path/to/blockchyp/init.php');

use BlockChyp\BlockChyp;

BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));

// Populate request values
$request = [
];


$response = BlockChyp::merchantCredentialGeneration($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;


composer 


  \BlockChyp\BlockChyp;

  BlockChyp::setApiKey('SPBXTSDAQVFFX5MGQMUMIRINVI');
  BlockChyp::setBearerToken('7BXBTBUPSL3BP7I6Z2CFU6H3WQ');
  BlockChyp::setSigningKey('bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e');

  $request = [
    'test' => TRUE,
    'terminalName' => 'Test Terminal',
    'amount' => '55.00',
  ];

  $response = BlockChyp::charge($request);

  echo 'Response: ' . print_r($response, TRUE) . PHP_EOL;