JCB QR Cross Border Payments - C# Sample Code Guide - v2.1
JCB QR Cross Border Payments - C# Sample Code Guide - v2.1
TRADEMARKS
Company, product, and service names used by JCB Inc. within or supplied with this document may be
trademarks or service marks of other persons or entities.
COPYRIGHT
1 INTRODUCTION ............................................................................................................................................. 3
2 COMPONENTS ............................................................................................................................................... 3
3 INTERFACE ..................................................................................................................................................... 3
7 ANNEXURE .................................................................................................................................................. 19
This document provides the clear explanation about the technical details and specifications to user. This
shall be distributed to Licensees those who are willing to connect to JCB QR Payment solution and it will
help them in onboarding.
2 Components
JCB sample code shall consist of major components. which are listed as below
• Sample code
• Readme.html
3 Interface
Common sample code provides an interface to JCB QR applications for both Issuer & Acquirer transactions
that can be performed between banks. Integration methodology and flow would differ depending upon
the programming platform. Interface details shall be elaborated as below.
4 Technology support
As of now we shall support C# 4.5 or higher to it only.
Below APIs will be consumed by the issuer to initiate the transaction and at the same time issuer also has
to provide the response for some transactions.
When Issuer is initiating the transaction, it will be treated as the CLIENT and when Issuer has to send the
response back to the request means issuer will act as a SERVER. There are different APIs which are
involved in this process.
Below APIs will be consumed by the acquirer to respond with the transaction status and in sometimes
acquirer also has to request for reversals for some exception cases.
When acquirer is initiating the reversal transaction or responding to the original request it will be treated
as the CLIENT and when Acquirer has to send the response back tie the request Acquirer will act as a
SERVER. There are different APIs which are involved in this process.
6 API Specifications
All the APIs for JCB QR Payment supports HTTP version 1.1, and HTTP method for all APIs is POST.
All API URLs follow the below format:
<Scheme>://<Host:Port>/<contextRoot>/api/<licensee_identifier>/<Version>/<apiName>
Host:Port Hostname and port number of JCBI. The value shall be different qrcode.jcbgloba
based on environment. l.com:443
<Sandbox> - sbox.qrcode.jcbglobal.com:443
<Certification> - cert.qrcode.jcbglobal.com:443
<Production> - qrcode.jcbglobal.com:443
contextRoot Context root of the services. The value shall be different based gateway
on environment
<Sandbox> - gateway
<Production> - gateway
Version The version of API. Both of major and minor versions shall be set. v1.0
API Name Name of the API URL endpoint. Types of API defined as follows: Payreq
Host:Port Hostname and port number of Licensee. The value shall be XXXXX.XXX: 443
submitted to JCBI in advance using Form A.
contextRoot Context root of the services. The value shall be submitted to gateway
JCBI in advance using Form A.
Version The version of API. Both of major and minor versions shall be v1.0
set.
/*
* URL Pattern -- > /gateway/api/{licenseeId}/v1.0/payreq
* Request Method -- > POST
* Request Header -- > APIUniqueID , MessageID , TimeStamp , Version
* Path variable -- > licenseeId
* String licenseeId = "licenseeId"; // String | licenseeId - pass the same id which was
received in payreq pathVariable
* String aPIUniqueID = "ApiUniqueId"; // String | APIUniqueID - pass the same id which
was received in payreq requestHeader
* String messageID = "MessageID"; // String | MessageID - pass the same id which was
received in payreq requestHeader
* String timeStamp = "TimeStamp"; // String | TimeStamp - pass the same time stamp
which was received in payreq requestHeader
* String version = "Version"; // String | Version - pass the same version which was
received in payreq requestHeader
* Request Body -- > PaymentRequest
* @return Ack
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
response body
*/
Input Parameters:
// Import classes:
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
//POST Method
Input Parameters:
// Import classes:
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
//POST Method
};
HttpResponseMessage responsePost = await client.PostAsJsonAsync("v1.0/payrevreq",
PayReq);
if (responsePost.IsSuccessStatusCode)
{
// Get the URI of the created resource.
Uri returnUrl = responsePost.Headers.Location;
Console.WriteLine(returnUrl);
var resp = responsePost.Content.ReadAsStringAsync().Result;
Console.WriteLine("Success : " + resp);
}
else
{
var resp = responsePost.Content.ReadAsStringAsync().Result;
Console.WriteLine("{0} ({1})", (int)responsePost.StatusCode, responsePost.ReasonPhrase);
Console.WriteLine("Error : " + resp);
}
}
Console.Read();
}
This API is used for the sending back the response for the reversal request.
/*
* URL Pattern -- > /gateway/api/{licenseeId}/v1.0/payrevresp
* Request Method -- > POST
* Request Header -- > APIUniqueID , MessageID , TimeStamp , Version
* Path variable -- > licenseeId
* Request Body -- > ReversalResponse
* @return Ack
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response
body
*/
/*
* URL Pattern -- > /gateway/api/{licenseeId}/v1.0/rejreversal
* Request Method -- > POST
* Request Header -- > APIUniqueID , MessageID , TimeStamp , Version
* Request Body -- > TxnVo
* @return ReversalResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response
body
*/
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
//POST Method
Input Parameters:
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
//POST Method
client.DefaultRequestHeaders.Add("MessageID", "30010");
var exrate = new exrate()
{
AmountTransaction = "1.00",
CurrencyCodeTransaction = "704",
AcquirerInstitutionIdentificationCode = "12345678",
CurrencyCodeSettlementAcquirer = "704"
};
HttpResponseMessage responsePost = await client.PostAsJsonAsync("v1.0/exrate", exrate);
if (responsePost.IsSuccessStatusCode)
{
// Get the URI of the created resource.
Uri returnUrl = responsePost.Headers.Location;
Console.WriteLine(returnUrl);
var resp = responsePost.Content.ReadAsStringAsync().Result;
Console.WriteLine("Success : " + resp);
}
else
{
var resp = responsePost.Content.ReadAsStringAsync().Result;
Console.WriteLine("{0} ({1})", (int)responsePost.StatusCode, responsePost.ReasonPhrase);
Console.WriteLine("Error : " + resp);
}
}
Console.Read();
}
7 Annexure
Please use the Read me file in the attached zip files.
SL No Type Remarks