PHP code example of flowwow / cloudpayments-php-client

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

    

flowwow / cloudpayments-php-client example snippets


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

echo $response->success;

$apiClient = new \Flowwow\Cloudpayments\Library(\*...*\);
$apiClient->paymentsCardsCharge(\*...*\);

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

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

$hookData = new \Flowwow\Cloudpayments\Hook\HookPay($_POST);
echo $hookData->transactionId;

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

composer