Laravel integration for NTT DATA PAY Payment gateway.
Install the package using using composer install.
composer require rahulreghunath/nttdatapay
Run the command to publish the configuration file.
php artisan vendor:publish --provider="Rahulreghunath\Nttdatapay\ServiceProvider"
Set the credentials and configurations in config/nttdatapay.php
file.
Configuration | Description | Required |
---|---|---|
encKey | Encryption Key | |
decKey | Decryption Key | |
payUrl | Payment Url | |
transactionTrackingUrl | Transaction Tracking Url | |
merchantId | Merchant id | |
password | Merchant Password |
Please note that the configurations will be different for testing and production environments and will be provided by NTT DATA.
use the method createTokenId($data)
to create token id to initiate the payment request.
sample data
$data = [
"payInstrument" => [
"headDetails" => [
"version" => "OTSv1.1",
"api" => "AUTH",
"platform" => "FLASH"
],
"merchDetails" => [
"merchTxnId" => "Test123450",
"merchTxnDate" => "2021-09-04 20:46:00"
],
"payDetails" => [
"amount" => "1",
"product" => "PRODUCT", // optional value
"custAccNo" => "ACC NO", // optional value
"txnCurrency" => "INR"
],
"custDetails" => [
"custEmail" => "user@email.com",
"custMobile" => "0000000000"
],
"extras" => [
"udf1" => "", // optional value
"udf2" => "", // optional value
"udf3" => "", // optional value
"udf4" => "", // optional value
"udf5" => "" // optional value
]
]
];
$payment = new Atom();
$atomTokenId = $payment->createTokenId($data);
Use the Atom Token Id to call the javascript API
<button onclick="pay()">Pay</button>
<script src="CDN provided by NTT DATA"></script>
<script>
const pay=()=>{
const options = {
atomTokenId: "atomTokenId ", // token id get from atom
merchId: "000000", // merchant id
custEmail: "customer-email",
custMobile: "customer-mobile",
returnUrl: "your-response-url"
}
const atom = new AtomPaynetz(options,'uat');
}
</script>
Mandatory JavaScript CDN link will be provided by NTT DATA and will be different for production and testing environments.
check the status of the payment using transactionStatus($merTxn,$amt,$date)
method.
$payment = new Atom();
$response = $payment->transactionStatus($merchantTransactionId,$amount,$date);
use decrypt($data)
to decrypt the response message from Atom.
$payment = new Atom();
$jsonData = $payment->decrypt($encryptedData,$digest_algo="sha512");
default hashing algorithm used is sha512
and can be use different algorithm based as per NTT DATA's specifications.