Possessing ourselves as a company that is always ready to provide one's customers the best online experience, we create a long-lasting relationship between merchants and customers with the help of providing the best integration solutions to accept online payments. Before you migrate from an older version please look through the advantages of API v1.3.
Transaction Verification is an advanced case of manual transaction update, so the ability to verify the transactions. In certain cases the transaction details are changing during the processing, and sometimes these changes may require an additional verification or confirmation with PSP. Having a breakpoint at certain conditions would solve the issue and this is exactly what the transaction verification module offers.
In order to test cashier payment:
Use the credentials (merchant id, merchant secret, application key) The examples are presented in php 5.5+, python 2.7+, nodejs 8.10+, Here we are going to give the files, e.g.
Php 5.5+
<?php
if (!defined('PRAXIS_API_TEST_DOMAIN')) define('PRAXIS_API_TEST_DOMAIN', 'https://gateway.cashier-test.com');
if (!defined('PRAXIS_API_LIVE_DOMAIN')) define('PRAXIS_API_LIVE_DOMAIN', 'https://gateway.praxispay.com');
$url = PRAXIS_API_TEST_DOMAIN . '/cashier/cashier';
$merchant_id = '';
$merchant_secret = '';
$application_key = '';
$gateway = null;
$time = time();
if (empty($merchant_id) || empty($merchant_secret) || empty($application_key)) {
die('Variables must be set: $merchant_id, $merchant_secret, $application_key');
}
$data = [
'currency' => 'USD',
'amount' => 300,
'balance' => 10000,
'cid' => 'praxistest-' . $time,
'locale' => 'en-GB',
'gateway' => $gateway,
'version' => '1.3',
'timestamp' => $time,
'country' => 'GB',
'merchant_id' => $merchant_id,
'application_key' => $application_key,
'intent' => 'payment',
'customer_data' => [
'email' => '[email protected]',
'country' => 'GB',
'zip' => '123456',
'city' => 'Some City',
'address' => 'Some st., 123',
],
'notification_url' => 'https://domain.does.not.exist/notification',
'return_url' => 'https://domain.does.not.exist/return',
'order_id' => 'order_' . $time,
];
$signature = [
$data['merchant_id'],
$data['application_key'],
$data['timestamp'],
$data['intent'],
$data['cid'],
$data['order_id'],
];
$signature = implode('', $signature);
$signature = hash('sha384', $signature . $merchant_secret);
$request = curl_init();
curl_setopt_array($request, [
CURLOPT_URL => $url,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_SSL_VERIFYHOST => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLINFO_HEADER_OUT => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json; charset=utf-8',
'GT-Authentication: ' . $signature,
],
]);
$response = curl_exec($request);
$info = curl_getinfo($request);
curl_close($request);
try {
$response_data = json_decode($response, true);
if (is_array($response_data) && isset($response_data['status']) && $response_data['status'] === 0 && isset($response_data['redirect_url'])) {
echo $response_data['redirect_url'];
die;
} else if (is_array($response_data) && isset($response_data['description'])) {
echo $response_data['description'];
die;
} else {
echo 'Something went wrong';
die;
}
} catch (Exception $e) {
echo $e->getMessage();
}
?>