PHP code example of owlookit / tiptoppay-php-client

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

    

owlookit / tiptoppay-php-client example snippets


$publicId = /*...*/;
$pass = /*...*/;
$apiClient = new \Owlookit\Tiptoppay\Library($publicId, $pass);
$response = $apiClient->paymentsCardsCharge(new \Owlookit\Tiptoppay\Request\CardsPayment(
    100,
    'KZT',
    '123.123.123.123',
    '01492500008719030128SMfLeYdKp5dSQVIiO5l6ZCJiPdel4uDjdFTTz1UnXY'
));

echo $response->success;

$apiClient = new \Owlookit\Tiptoppay\Library(\*...*\);
$apiClient->paymentsCardsCharge(\*...*\);

...
$validationUrl = 'https://apple-pay-gateway.apple.com/paymentservices/startSession';
$request = new \Owlookit\Tiptoppay\Request\ApplepayStartSession($validationUrl);
$apiClient->startSession($request);

try {
    ...
    $validationUrl = 'https://apple-pay-gateway.apple.com/paymentservices/startSession';
    $request = new \Owlookit\Tiptoppay\Request\ApplepayStartSession($validationUrl);
    ...
} catch (\Owlookit\Tiptoppay\Exceptions\BadTypeException $e) {
    var_dump($e->getMessage());
}

$hookData = new \Owlookit\Tiptoppay\Hook\HookPay($_POST);
echo $hookData->transactionId;

...
$apiClient = new \Owlookit\Tiptoppay\Library(\*...*\);
$apiClient->setIdempotency(true);
$apiClient->createPaymentByCard2Step(\*...*\);
...

composer