PHP code example of fgct / nab_evm_3d_secure
1. Go to this page and download the library: Download fgct/nab_evm_3d_secure 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/ */
fgct / nab_evm_3d_secure example snippets
Fgc\NabEvm3dSecure\Auth;
$auth = new Auth(Auth::MODE_TEST, 'XYZ0010', 'abcd1234');
$auth->useDollar(true); // true || false, default is dollar, false to use cents
try {
echo "Creating order for EVM 3D secure authentication...\n";
$order = $auth->createOrder([
'amount' => '10.08', // In dollar
'currency' => 'AUD',
'ip' => '203.89.101.20'
]);
var_export($order);
/* $order = (Fgc\NabEvm3dSecure\Order) array(
'orderId' => '3b5ce3e2-c55f-4f9d-a252-405b832d8f5d',
'orderToken' => 'eyJjdHkiOiJKV1QiL...Yy9hObH5kn6bNQ==',
'amount' => 10.08,
'amountInCents' => 1008,
'amountInDollar' => 10.08,
'currency' => 'AUD',
'orderType' => 'PAYMENT',
'status' => 'NEW',
'merchantId' => 'XYZ00',
'merchantOrderReference' => NULL,
'providerClientId' => 'w-188553',
'sessionId' => 'MWJlZTM2N2ItMWQ0Ny00YWNjLThiOGYtMmRmMmUxZmUzMTAz',
'intents' => ['THREED_SECURE']
); */
} catch (\Exception $e) {
echo $e->getMessage();
}
try {
echo "\nProcessing transaction...\n";
$result = $auth->processTransaction([
'amount' => '10.08',
'purchaseOrderNo' => 'ORDER_#0001',
'cardNumber' => '4444333322221111',
'cardHolderName' => 'TEST TEST',
'expiryDate' => '10/23',
'CAVV' => 'owbocveo5tA7DyHugsy+79oukPI=', // authenticationValue
'SLI' => '02', // eci - E-Commerce Indicator/Security Level Indicator(SLI)
]);
var_export($result);
/* $result = (Fgc\NabEvm3dSecure\Transaction) array(
'txnType' => '0',
'txnSource' => '23',
'amount' => 10.08,
'amountInCents' => '1008',
'amountInDollar' => 10.08,
'currency' => 'AUD',
'purchaseOrderNo' => 'ORDER_#0001',
'approved' => 'Yes',
'responseCode' => '00',
'responseText' => 'Approved',
'settlementDate' => '20211030',
'txnID' => '183917',
'authID' => '429589',
); */
} catch (\Exception $e) {
echo $e->getMessage();
}