1. Get Payment URL
Swagger Link
https://kwpayapi.casheer.com/V1/
API Endpoints
https://kwpayapisb.casheer.com/V1/api/GenToken/Validate
Sample Request & Response
Use the below parameters and hashing function for order creation. The request should contain the following inputs to make sure inputs should be encrypted using our hashing function show in the following example to prevent exposure. For parameters description please refer here
"ValidatePaymentRequest" : {
"merchantCode": "xxxxx"
"authKey": "xxxxxxxxx",
"currency": "KWD",
"pc": "KWKFHMPGSCCKWD",
"tunnel": "",
"amount": 1 ,
"doConvert": "N",
"sourceCurrency":"conditional",
"description": "optional",
"referenceID": "(15 digit random number)",
"timeStamp": "yyyy/MM/dd HH:mm:ss tt",
"language": "en",
"callbackURL": "Your website URL",
"hash": "ComputedHash",
"userReference": 0,
"billingDetails":
{
"fName": "First Name",
"lName": "last Name",
"mobile": "mobile",
"email": "email",
"city": "city",
"pincode": "pincode",
"state": "state",
"address1": "address1",
"address2": "address2"
}
}
Multi Vendor Request & Response
To create a multivendor payment request, you must include an additional parameter in the request body called SubVendors
. This parameter is an array that contains objects representing each individual vendor involved in the transaction. Each object within the SubVendors
array must include the following fields in request body:
"ValidatePaymentRequest" : {
"merchantCode": "xxxxx"
"authKey": "xxxxxxxxx",
"currency": "KWD",
"pc": "KWKFHMPGSCCKWD",
"tunnel": "",
"amount": 10 ,
"doConvert": "N",
"sourceCurrency":"conditional",
"description": "optional",
"referenceID": "(15 digit random number)",
"timeStamp": "yyyy/MM/dd HH:mm:ss tt",
"language": "en",
"callbackURL": "Your website URL",
"hash": "ComputedHash",
"userReference": 0,
"billingDetails":
{
"fName": "First Name",
"lName": "last Name",
"mobile": "mobile",
"email": "email",
"city": "city",
"pincode": "pincode",
"state": "state",
"address1": "address1",
"address2": "address2"
},
"SubVendors": [
{
"id": "XXXXX", //the vendor’s merchantcode
"description": "otional",
"amount": 5, //the portion of the total payment allocated to this vendor
"vendorReference": 183164329829353, //a unique transaction reference number
"hash": "ComputedVendorHash"
},
{
"id": "XXXXXX",
"description": "optional",
"amount": 5,
"vendorReference": 183164329829365,
"hash": "ComputedVendorHash"
}
]
}
Sample Code to post data
public async Task> ValidatePayment(ValidatePaymentRequest obj)
{
Output dto = new Output();
var url = {Provided End Point};
var client = new HttpClient();
client.BaseAddress = new Uri(url);
try
{
obj.hash = ComputeHash(obj);
var resultser = JsonConvert.SerializeObject(obj);
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
var response = client.PostAsJsonAsync(url, obj).Result;
if (response.IsSuccessStatusCode)
{
var ss = response.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject>(ss.Result);
dto = result;
}
else
{
var ss = response.Content.ReadAsStringAsync();
var resps = ss.Result.ToString();
}
}
catch (HttpRequestException ex)
{
}
return dto;
}
Last updated