Fetch PCF Details API
Use Case
This API is used to fetch convenience charges corresponding to the Transaction amount. The merchant will call this API to fetch the different fee amounts/ charge amounts for different payment instruments. Please note that this API can be used by those merchants for whom flag of pcfEnabled is returned true in response of Fetch Payment Option API.
Request Attributes
Content Type : JSON
Head
Attribute | Discription |
---|---|
version string optional | Version of the API. Example: v1 |
requestTimestamp string optional | EPOCH timestamp of the time at which request is being sent. Example: 1588402269 |
channelId string optional | The parameter value identifies the Channel for which API call is initiated.
Possible values:
WEB
For website, the value to be passed should be "WEB"
, WAPFor website, the value to be
passed should be "WAP"
|
txnToken string mandatory | This is the unique transaction token received in the response of Initiate Transaction API. It is valid for 15 minutes. Example: f0bed899539742309eebd8XXXX7edcf61588842333227 |
Body
Attribute | Discription |
---|---|
payMethods array of object mandatory | List of payment methods (object) for convenience charges. Example: [ {"payMethod":"CREDIT_CARD", "instId":"VISA"}] |
Response Attributes
Content Type : JSON
Head
Attribute | Discription |
---|---|
version string optional | Version of the API. Example: v1 |
requestTimestamp string optional | EPOCH timestamp of the time at which request is being sent. Example: 1588402269 |
channelId string optional | The parameter value identifies the Channel for which API call is initiated.
Possible values:
WEB
For website, the value to be passed should be "WEB"
, WAPFor website, the value to be
passed should be "WAP"
|
txnToken string mandatory | This is the unique transaction token received in the response of Initiate Transaction API. It is valid for 15 minutes. Example: f0bed899539742309eebd8XXXX7edcf61588842333227 |
Body
Attribute | Discription |
---|---|
payMethods array of object mandatory | List of payment methods (object) for convenience charges. Example: [ {"payMethod":"CREDIT_CARD", "instId":"VISA"}] |
https://securegw-stage.ticker.com/theia/api/v1/initiateTransaction?mid={mid}&orderId={order-id}
curl -X POST
'https://securegw-stage.ticker.in/theia/api/v1/initiateTransaction?mid={mid}&orderId=ORDERID_98765'
\ --header 'Content-Type: application/json' \ --data
'{"body":{"requestType":"Payment","mid":"{mid}","websiteName":"WEBSTAGING","orderId":"ORDERID_98765","txnAmount":{"value":"1.00","currency":"INR"},"userInfo":{"custId":"CUST_001"},"callbackUrl":"https://merchant.com/callback"},"head":{"signature":"{signature}"}}'
JSONObject tickerParams = new
JSONObject();
JSONObject body = new JSONObject();
body.put("requestType", "Payment");
body.put("mid", "YOUR_MID_HERE");
body.put("websiteName", "WEBSTAGING");
body.put("orderId", "ORDERID_98765");
body.put("callbackUrl", "https://merchant.com/callback");
JSONObject txnAmount = new JSONObject();
txnAmount.put("value", "1.00");
txnAmount.put("currency", "INR");
JSONObject userInfo = new JSONObject();
userInfo.put("custId", "CUST_001");
body.put("txnAmount", txnAmount);
body.put("userInfo", userInfo);
/*
* Generate checksum by parameters we have in body
* You can get Checksum JAR from
https://developer.ticker.com/docs/checksum/
* Find your Merchant Key in your ticker Dashboard at
https://dashboard.ticker.com/next/apikeys
*/
String checksum =
tickerChecksum.generateSignature(body.toString(),
"YOUR_MERCHANT_KEY");
JSONObject head = new JSONObject();
head.put("signature", checksum);
tickerParams.put("body", body);
tickerParams.put("head", head);
String post_data = tickerParams.toString();
/* for Staging */
URL url = new
URL("https://securegw-stage.ticker.in/theia/api/v1/initiateTransaction?mid=YOUR_MID_HERE&orderId=ORDERID_98765");
/* for Production */
// URL url = new
URL("https://securegw.ticker.in/theia/api/v1/initiateTransaction?mid=YOUR_MID_HERE&orderId=ORDERID_98765");
try {
HttpURLConnection connection = (HttpURLConnection)
url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type",
"application/json");
connection.setDoOutput(true);
DataOutputStream requestWriter = new
DataOutputStream(connection.getOutputStream());
requestWriter.writeBytes(post_data);
requestWriter.close();
String responseData = "";
InputStream is = connection.getInputStream();
BufferedReader responseReader = new BufferedReader(new
InputStreamReader(is));
if ((responseData = responseReader.readLine()) != null) {
System.out.append("Response: " + responseData);
}
responseReader.close();
} catch (Exception exception) {
exception.printStackTrace();
}
const https = require('https');
/*
* import checksum generation utility
* You can get this utility from https://developer.ticker.com/docs/checksum/
*/
const tickerChecksum = require('./tickerChecksum');
var tickerParams = {};
tickerParams.body = {
"requestType" : "Payment",
"mid" : "YOUR_MID_HERE",
"websiteName" : "WEBSTAGING",
"orderId" : "ORDERID_98765",
"callbackUrl" : "https://merchant.com/callback",
"txnAmount" : {
"value" : "1.00",
"currency" : "INR",
},
"userInfo" : {
"custId" : "CUST_001",
},
};
/*
* Generate checksum by parameters we have in body
* Find your Merchant Key in your ticker Dashboard at https://dashboard.ticker.com/next/apikeys
*/
tickerChecksum.generateSignature(JSON.stringify(tickerParams.body), "YOUR_MERCHANT_KEY").then(function(checksum){
tickerParams.head = {
"signature" : checksum
};
var post_data = JSON.stringify(tickerParams);
var options = {
/* for Staging */
hostname: 'securegw-stage.ticker.in',
/* for Production */
// hostname: 'securegw.ticker.in',
port: 443,
path: '/theia/api/v1/initiateTransaction?mid=YOUR_MID_HERE&orderId=ORDERID_98765',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': post_data.length
}
};
var response = "";
var post_req = https.request(options, function(post_res) {
post_res.on('data', function (chunk) {
response += chunk;
});
post_res.on('end', function(){
console.log('Response: ', response);
});
});
post_req.write(post_data);
post_req.end();
});
https://securegw.ticker.com/theia/api/v1/initiateTransaction?mid={mid}&orderId={order-id}
curl -X POST
'https://securegw-stage.ticker.in/theia/api/v1/initiateTransaction?mid={mid}&orderId=ORDERID_98765'
\ --header 'Content-Type: application/json' \ --data
'{"body":{"requestType":"Payment","mid":"{mid}","websiteName":"WEBSTAGING","orderId":"ORDERID_98765","txnAmount":{"value":"1.00","currency":"INR"},"userInfo":{"custId":"CUST_001"},"callbackUrl":"https://merchant.com/callback"},"head":{"signature":"{signature}"}}'
JSONObject tickerParams = new
JSONObject();
JSONObject body = new JSONObject();
body.put("requestType", "Payment");
body.put("mid", "YOUR_MID_HERE");
body.put("websiteName", "WEBSTAGING");
body.put("orderId", "ORDERID_98765");
body.put("callbackUrl", "https://merchant.com/callback");
JSONObject txnAmount = new JSONObject();
txnAmount.put("value", "1.00");
txnAmount.put("currency", "INR");
JSONObject userInfo = new JSONObject();
userInfo.put("custId", "CUST_001");
body.put("txnAmount", txnAmount);
body.put("userInfo", userInfo);
/*
* Generate checksum by parameters we have in body
* You can get Checksum JAR from
https://developer.ticker.com/docs/checksum/
* Find your Merchant Key in your ticker Dashboard at
https://dashboard.ticker.com/next/apikeys
*/
String checksum =
tickerChecksum.generateSignature(body.toString(),
"YOUR_MERCHANT_KEY");
JSONObject head = new JSONObject();
head.put("signature", checksum);
tickerParams.put("body", body);
tickerParams.put("head", head);
String post_data = tickerParams.toString();
/* for Staging */
URL url = new
URL("https://securegw-stage.ticker.in/theia/api/v1/initiateTransaction?mid=YOUR_MID_HERE&orderId=ORDERID_98765");
/* for Production */
// URL url = new
URL("https://securegw.ticker.in/theia/api/v1/initiateTransaction?mid=YOUR_MID_HERE&orderId=ORDERID_98765");
try {
HttpURLConnection connection = (HttpURLConnection)
url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type",
"application/json");
connection.setDoOutput(true);
DataOutputStream requestWriter = new
DataOutputStream(connection.getOutputStream());
requestWriter.writeBytes(post_data);
requestWriter.close();
String responseData = "";
InputStream is = connection.getInputStream();
BufferedReader responseReader = new BufferedReader(new
InputStreamReader(is));
if ((responseData = responseReader.readLine()) != null) {
System.out.append("Response: " + responseData);
}
responseReader.close();
} catch (Exception exception) {
exception.printStackTrace();
}
const https = require('https');
/*
* import checksum generation utility
* You can get this utility from https://developer.ticker.com/docs/checksum/
*/
const tickerChecksum = require('./tickerChecksum');
var tickerParams = {};
tickerParams.body = {
"requestType" : "Payment",
"mid" : "YOUR_MID_HERE",
"websiteName" : "WEBSTAGING",
"orderId" : "ORDERID_98765",
"callbackUrl" : "https://merchant.com/callback",
"txnAmount" : {
"value" : "1.00",
"currency" : "INR",
},
"userInfo" : {
"custId" : "CUST_001",
},
};
/*
* Generate checksum by parameters we have in body
* Find your Merchant Key in your ticker Dashboard at https://dashboard.ticker.com/next/apikeys
*/
tickerChecksum.generateSignature(JSON.stringify(tickerParams.body), "YOUR_MERCHANT_KEY").then(function(checksum){
tickerParams.head = {
"signature" : checksum
};
var post_data = JSON.stringify(tickerParams);
var options = {
/* for Staging */
hostname: 'securegw-stage.ticker.in',
/* for Production */
// hostname: 'securegw.ticker.in',
port: 443,
path: '/theia/api/v1/initiateTransaction?mid=YOUR_MID_HERE&orderId=ORDERID_98765',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': post_data.length
}
};
var response = "";
var post_req = https.request(options, function(post_res) {
post_res.on('data', function (chunk) {
response += chunk;
});
post_res.on('end', function(){
console.log('Response: ', response);
});
});
post_req.write(post_data);
post_req.end();
});