Full Payment & Installment - Payment API Credit Card
About Full Payment & Installment - Payment API Credit Card
This API uses after finishing the API Full Payment & Installment - Registration API Credit Card. API used in this stage is similar to the API for the Recurring Token and Pre-Auth & Capture payment type. However, there are several differences in the sent request parameter.
Full Payment & Installment - Payment API Credit Card
API Endpoint | /nicepay/direct/v2/payment |
|---|---|
Request Method | POST |
Description | Full Payment & Installment - Payment API Credit Card |
Merchant Token | SHA256(timeStamp+iMid+referenceNo+amt+merchantKey) |
Request Format | application/x-www-form-urlencoded |
On the Credit Card payment, if 3Ds authentication is needed, your Customer will direct to the 3Ds card Issuer Bank page to input the OTP (One Time Password) code to finish the transaction process.
Request Parameter for Full Payment & Installment - Payment API Credit Card
The following is the list of request parameters to process the payment transaction on the Credit Card Full Payment & Installment payment method. Request Parameter proceeds through Form-Url with the following detailed parameter.
Parameter | Type | Size | Description | Example / Notes |
|---|---|---|---|---|
timeStamp Required | N | 14 | Request Timestamp (YYYYMMDDHH24MISS) | 20221202141217 |
tXid Required | AN | 30 | Transaction ID | IONPAYTEST01202212021455054652 |
referenceNo | N | 40 | Reference Number for Payment | ordNo20221202141217 |
cardNo Required for CC | N | 20 | Credit Card Number | 4434260000000008 |
cardExpYymm Required for CC | A | 4 | Card Expiry (YYMM) | 3901 |
cardCvv Required for CC | N | 4 | Card CVV | 101 |
cardHolderNm Required | AN | 45 | Card Holder Name | John Doe Only alphabet allowed
|
cardHolderEmail Required | ANS | 100 | Card Holder Email | |
merchantToken Required | AN | 255 | Merchant Token | c91e6531f6c84869439bc5ebe5389bd71e7752c054fc9dbfe193d087a1b797ae |
callBackUrl Required | ANS | 255 | Payment Result URL | https://merchant.com/callBackUrl |
Parameter needed in the transaction process is the Your Customer Credit/Debit card data such as cardNo, cardExpYymm, cardCvv, cardHolderNm & cardHolderEmail.
So, to do the transaction process, we suggest You get the card data from Your Customer beforehand before doing the Payment API process.
Include cardCVV on every transaction depending on the MID type of CVV or Non-CVV.
Response Parameter for Full Payment & Installment - Payment API Credit Card
After you request, you will get a response from URL Callback with the following detailed response parameter.
Parameter | Type | Size | Description | Example / Notes |
|---|---|---|---|---|
resultCd | N | 14 | Result Code | |
resultMsg | AN | 255 | Result message: Error Code | |
tXid | AN | 30 | Transaction ID | When success |
referenceNo | ANS | 40 | Merchant Order Number | When success |
payMethod | N | 2 | When success | |
amt | N | 12 | Payment Amount | When success |
currency | AN | 3 | Currency | When success |
goodsNm | A | 100 | Goods Name | When success |
billingNm | A | 100 | Buyer Name | When success |
transDt | N | 8 | Transaction Date (YYYYMMDD) | When success |
transTm | N | 6 | Transaction Time (HH24MISS) | When success |
description | AN | 100 | Transaction Description | When success |
authNo | N | 10 | Approval Number | When success, CC |
issuBankCd | A | 4 | When success, CC | |
acquBankCd | A | 4 | When success, CC | |
cardNo | ANS | 20 | Masked Card No | When success, CC |
cardExpYymm | N | 4 | Card Expiry (YYMM) | When success, CC |
instmntMon | N | 2 | Installment Month | When success, CC |
instmntType | N | 2 | When success, CC | |
ccTransType | N | 2 | 1: Normal 2: Recurring 3: Pre-Auth 4: Capture | When Success, CC |
Sample Parameter for Full Payment & Installment - Payment API Credit Card
Request Parameter
let secondVersion = new SecondApiVersion(config);
let parameterPayment = {
amt: "1000",
referenceNo: "reffNo20250922143200",
tXid: "IONPAYTEST8108202509221432005539",
cardNo: "5123450000000008",
callBackUrl: "https://www.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp",
cardExpYymm: "2901",
cardCvv: "100",
recurringToken: "",
cardHolderNm: "Nicepay Test",
preauthToken: "",
cardHolderEmail: "[email protected]",
};
let response = secondVersion.requestPayment(parameterPayment);Response Parameter
<head>
<style>
body {min-width: 100%; height: auto; min-height: 500px; overflow: none; border: none; background: url("/nicepay/images/rotate.gif") no-repeat center;
</style>
</head>
<body onload='javascript:getBrowserInfo();'>
<div style='visibility:hidden'>
<div id="initiate3dsSimpleRedirect" xmlns="http://www.w3.org/1999/html"> <iframe id="methodFrame" name="methodFrame" height="100" width="200" > </iframe> <form id ="initiate3dsSimpleRedirectForm" method="POST" action="https://mtf.gateway.mastercard.com/acs/mastercard/v2/method" target="methodFrame"> <input type="hidden" name="threeDSMethodData" value="eyJ0aHJlZURTTWV0aG9kTm90aWZpY2F0aW9uVVJMIjoiaHR0cHM6Ly9tdGYuZ2F0ZXdheS5tYXN0ZXJjYXJkLmNvbS9jYWxsYmFja0ludGVyZmFjZS9nYXRld2F5LzNjMTlhMzU0NjgwMWU2ZDMwMTYwZWJiMDllMjAxYzg2NTU0MzZkMzRjYjgwOWFjNTIyMmMxMzIwZDFhMjI3ZDUiLCJ0aHJlZURTU2VydmVyVHJhbnNJRCI6ImM2YTI5MTllLTdlNWMtNDcyMi1hYmJlLTY5YmVlZDAyM2IzZiJ9" /> </form> <script id="initiate-authentication-script"> var e=document.getElementById("initiate3dsSimpleRedirectForm"); if (e) { e.submit(); if (e.parentNode !== null) { e.parentNode.removeChild(e); } } </script> </div>
</div>
<form name="mpgsAuthFrm" id="mpgsAuthFrm" method="post" action='https://dev.nicepay.co.id/nicepay/api/mpgsAuth.do'>
<input type='hidden' name='tXid' value='IONPAYTEST8108202509221432005539'>
<input type='hidden' name='cardNo' value='5123450000000008'>
<input type='hidden' name='cardExpYymm' value='2901'>
<input type='hidden' name='cardCvv' value='100'>
<input type='hidden' name='callbackUrl' value='https://dev.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp'>
<input type='hidden' name='registered' value='true'>
<input type='hidden' name='directV1' value='false'>
<input type='hidden' name='authResult' value='false'>
<input type='hidden' name='browser' value=''>
<input type='hidden' name='browserJavaEnabled' value='false'>
<input type='hidden' name='browserJavascriptEnabled' value='2'>
<input type='hidden' name='browserLanguage' value=''>
<input type='hidden' name='browserScreenColorDepth' value=''>
<input type='hidden' name='browserScreenHeight' value='0'>
<input type='hidden' name='browserScreenWidth' value='0'>
<input type='hidden' name='browserTimeZone' value='0'>
</form>
<script>
function getBrowserInfo() {
document.mpgsAuthFrm.browser.value = navigator.userAgent;
document.mpgsAuthFrm.browserJavaEnabled.value = window.navigator.javaEnabled() === true ? 'true' : 'false';
document.mpgsAuthFrm.browserJavascriptEnabled.value = "1";
document.mpgsAuthFrm.browserLanguage.value = navigator.language;
document.mpgsAuthFrm.browserScreenColorDepth.value = screen.colorDepth;
document.mpgsAuthFrm.browserScreenHeight.value = screen.height;
document.mpgsAuthFrm.browserScreenWidth.value = screen.width;
document.mpgsAuthFrm.browserTimeZone.value = new Date().getTimezoneOffset();
document.mpgsAuthFrm.submit();
}
</script>
</body>
CallBack Handling for Full Payment & Installment - Payment API Credit Card
After the transaction occurs, You will get a notification from us based on the inputted Callback URL in the request parameter on Payment - API Credit Card.
When Your callback already received callbackUrl, we recommended the Merchant to do the status verification using the Status Inquiry - API Credit Card.
CallBack Handling is very important to minimize the Fraud act, we highly recommend the Merchant to do the verification using callBack Handling.
{
"resultCd":"0000",
"resultMsg":"SUCCESS",
"tXid":"IONPAYTEST01202212141112221428",
"referenceNo":"",
"payMethod":"01",
"amt":"10000",
"transDt":"20221212",
"transTm":"121212",
"description":"Testing Credit Card Transaction",
"authNo":"080623",
"issuBankCd":"OTHR"
"acquBankCd":"BMRI",
"cardNo":"453211*****1111",
"goodsNm":"Test Transaction Nicepay"
"billingNm":"John Doe",
"currency":"IDR",
"timeStamp":"20221212121212",
"merchantToken":"2035d2295d9578fffb40137186f0203474142ae3e57992d4847826c5fcaffce6",
"cardExpYymm":"2712",
"instmntMon":"1",
"instmntType":"1",
"ccTransType":"1"
}