Quick Integrations
Prerequisites
- Staging Credentials
- Test Cards
- Knowlefe of the flow
Refer This
Haven't created your account yet?
Please follow our Getting started guide.
For both integrity & data-authenticity verification before sending data to the API, you need to
calculate a checksum of all the data that you send to MobiKwik Payment Gateway. We use an
HMACSHA-256 algorithm to calculate the checksum of ALL data that is posted to the API. We require data to be posted to our server in the NVP (Name-Value Pairs) format.
Request Parameters Sequence for Checksum
"amount","bankid","buyerAddress","buyerCity","buyerCountry","buyerEmail","buyerFirstName","buyerLastName","buyerPhoneNumber","buyerPincode","buyerState","currency","debitorcredit","merchantIdentifier","merchantIpAddress","mode","orderId","product1Description","product2Description","product3Description","product4Description","productDescription","productInfo","purpose","returnUrl","shipToAddress","shipToCity","shipToCountry","shipToFirstname","shipToLastname","shipToPhoneNumber","shipToPincode","shipToState","showMobile","txnDate","txnType","zpPayOption"
HMAC SHA 256 Algorithms
public static String calculateChecksum(String secretKey, String allParamValue) throws Exception {
byte[] dataToEncryptByte = allParamValue.getBytes();
byte[] keyBytes = secretKey.getBytes();
SecretKeySpec secretKeySpec = new SecretKeySpec(keyBytes, "HmacSHA256");
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(secretKeySpec);
byte[] checksumByte = mac.doFinal(dataToEncryptByte);
String checksum = toHex(checksumByte);
return checksum;
}
static function calculateChecksum($secret_key, $checksumString) {
$hash = hash_hmac('sha256', $checksumString , $secret_key);
$checksum = $hash;
return $checksum;
}
require 'openssl'
require "base64"
hash = OpenSSL::HMAC.digest('sha256', "secretKey", "checksumString")
import hashlib
import hmac
import base64
message = bytes('checksumString', 'utf-8')
secret = bytes('secretKey', 'utf-8')
signature = base64.b64encode(hmac.new(secretKey, checksumString, digestmod=hashlib.sha256).digest())
print(signature)
using System.Security.Cryptography;
namespace Test
{
public class MyHmac
{
private string CreateToken(string checksumString, string secretKey)
{
secretKey = secretKey ?? "";
var encoding = new System.Text.ASCIIEncoding();
byte[] keyByte = encoding.GetBytes(secretKey);
byte[] messageBytes = encoding.GetBytes(checksumString);
using (var hmacsha256 = new HMACSHA256(keyByte))
{
byte[] hashmessage = hmacsha256.ComputeHash(messageBytes);
return Convert.ToBase64String(hashmessage);
}
}
}
}
Response Parameters Sequence for Checksum
"amount","bank","bankid","cardId","cardScheme","cardToken","cardhashid","doRedirect","orderId","paymentMethod","paymentMode","responseCode","responseDescription","productDescription","product1Description","product2Description","product3Description","product4Description","pgTransId","pgTransTime"
Refer to our API section for intiating a request
Try our API'sUpdated over 3 years ago