PHP code example of crazysnowflake / payop-test
1. Go to this page and download the library: Download crazysnowflake/payop-test 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/ */
crazysnowflake / payop-test example snippets
use Crazysnowflake\PayopTest\PayopTest;
$client = new PayopTest($public_key, $secret_key, $jwt_token);
try {
$invoiceID = $client->setPaymentMethod($method)
->setInvoiceResultUrl('Some Url')
->setInvoiceFailPath('Some Url')
->createInvoice($order, $customer);
$card_token = $client->createCardToken($invoiceID, $card);
$result = $client->setCheckStatusUrl('Some Url')
->checkout($invoiceID, $customer, $card_token['token']);
$transaction = $client->getTransaction($result['txid']);
$status = $client->checkInvoiceStatus($invoiceID);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
}