Payment Gateway
  • Home
    • Welcome
      • Cheatsheet
      • Contact Us
      • QRIS
      • Virtual Account
      • E-Wallet
      • Debit & Credit Card
      • Internet Banking
      • Convinient Store
      • Buy Now, Pay Later
  • API Documentation
    • Technical Doc of Fiuu ID
      • Payment Flow Overview
      • Online Payment / Transaction Process
      • Payment Status Flow
      • Security & Data Integrity
        • Verify Key [Confidential]
        • Secret Key [Top Secret]
        • vcode
        • skey
      • Developer Account
      • Hosted Integration APIs
      • Seamless Integration APIs
      • Direct Server Integration APIs
      • Payment Request Parameters
        • Hosted Integration
          • Request Parameters
          • Channel Lists
          • Examples
        • Seamless Integration
          • Request Parameters
          • Channel Details (mpschannel)
        • Direct Server Integration
          • Request Parameters
          • API Response
          • Channel Details (TxnChannel)
      • Payment Response Parameter
        • Payment Status Notification (Merchant Webhook or the 3 Endpoints)
          • Return URL with IPN (Instant Payment Notification)
          • Notify URL with IPN
          • Callback URL with IPN
      • TL; DR?
      • Comparison Chart
      • Merchant Request APIs
      • Error Codes
      • Resources
Powered by GitBook
On this page
  • Implementation:
  • Notification Parameters (via POST method)
  • Example of Notify URL with IPN script for PHP
  1. API Documentation
  2. Technical Doc of Fiuu ID
  3. Payment Response Parameter
  4. Payment Status Notification (Merchant Webhook or the 3 Endpoints)

Notify URL with IPN

Last updated 5 months ago

Direct payment status notification is a back-end instant update mechanism that sends over the payment status notification from gateway directly to the merchant server or system, without relying on any user agent such as web browser or mobile application.

Notify URL script is similar to return URL script but, no output is required for front-end user interface. This is also known as background URL.

Implementation:

Step 1: Login to merchant admin and go to merchant profile, fill in the Notify URL. Notify URL with IPN can be activated for better merchant-payment system communication. Choose “Yes” to “Enable Notify URL with IPN”, as shown:-

Step 2: Merchant to prepare a Notify URL script, which is similar to return URL script.

Step 3: If IPN is disable please ignore this step. Merchants have to echo back all the POST variables with one additional variable, i.e. “treq” with value 1. PHP sample code is provided below.

Notification Parameters (via POST method)

Variable / Parameter
Type Format / Max Length
Description / Example

nbcb

1 digit numeric

Always equal to 2, which indicates this is a notification from PG

amount

2 decimal points numeric value

The total amount paid or to be paid for Fiuu Cash payment request

orderid

alphanumeric, 32 characters

Invoice or order number from merchant system

tranID

integer, 10 digits

Unique transaction ID for tracking purpose

domain

alphanumeric, 32 chars

Merchant ID in PG system

status

2-digit numeric value

00 for Successful payment

11 for failed status

appcode

alphanumeric, 16 chars

Bank approval code. Mandatory for card payment. Certain channels return empty value.

error_code

alphanumeric

Refer to the Error Codes section.

error_desc

text

Error message or description.

skey

32 chars hexadecimal string

This is the data integrity protection hash string. Refer skey section for details.

currency

2 or 3 chars (ISO-4217) currency code

Default currency is IDR (indicating Indonesia Rupiah) for Indonesia channels

channel

predefined string in system

Channel references for merchant system

paydate

Date/Time( YYYY-MM-DD HH:mm:ss)

Date/Time of the transaction.

extraP*

optional (on request)

JSON encoded string or array

token: 16-digit card token for merchant to store for recurring MIT (merchant initiated transaction)

fraudscreen: 1-digit integer, i.e. 1=Unknown, 2=Passed, 3=Alert, 4=Suspicious, 5=Fraud

ccbrand: Visa, MasterCard, AMEX

cclast4: Last 4-digit of card number cctype: Credit, Debit, Prepaid

ProcessorResponseCode : Authorization response code

ProcessorCCVResponse : Credit Card validation response code

AvsStreet : Street validation status

AvsZip : Zip/Postcode validation status

AvsResponse : Association validation status

ECI : Electronic commerce indicator

*Note: Values are not URL encoded

Example of Notify URL with IPN script for PHP

<?php

$sec_key ="xxxxxxxxxx"; //Replace xxxxxxxxxx with Secret_Key

$_POST[treq]    =	1; // Additional parameter for IPN. Value always set to 1. 

/********************************
*Don't change below parameters
********************************/
$nbcb 	        =	$_POST['nbcb'];
$tranID 	=	$_POST['tranID'];
$orderid 	=	$_POST['orderid'];
$status 	=	$_POST['status'];
$domain 	=	$_POST['domain'];
$amount 	=	$_POST['amount'];
$currency 	=	$_POST['currency'];
$appcode 	=	$_POST['appcode'];
$paydate 	                  =	$_POST['paydate'];
$skey 	                  =	$_POST['skey'];
 
/***********************************************************
* Snippet code in purple color is the enhancement required
* by merchant to add into their notification script in order to
* implement backend acknowledge method for IPN
************************************************************/
while ( list($k,$v) = each($_POST) ) {
  $postData[]= $k."=".$v;
}
$postdata	= implode("&",$postData);
$url 		= "https://pg.e2pay.co.id/RMS/API/chkstat/returnipn.php";
$ch 		= curl_init();
curl_setopt($ch, CURLOPT_POST			, 1         );
curl_setopt($ch, CURLOPT_POSTFIELDS		, $postdata );
curl_setopt($ch, CURLOPT_URL			, $url      );
curl_setopt($ch, CURLOPT_HEADER		        , 1         );
curl_setopt($ch, CURLINFO_HEADER_OUT            , TRUE      );
curl_setopt($ch, CURLOPT_RETURNTRANSFER 	, 1         );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER 	, FALSE     );
curl_setopt($ch, CURLOPT_SSLVERSION             , 6         );  // use only TLSv1.2
$result = curl_exec( $ch );
curl_close( $ch );

/***********************************************************
* To verify the data integrity sending by PG
************************************************************/
$key0 = md5( $tranID.$orderid.$status.$domain.$amount.$currency );
$key1 = md5( $paydate.$domain.$key0.$appcode.$sec_key );
if( $skey != $key1 ) $status= -1; // Invalid transaction
if ( $status == "00" ) {
  if ( check_cart_amt($orderid, $amount) ) {
    // write your script here .....
  }
} else {
  // failure action
}

?>

URL:

https://pg.e2pay.co.id/RMS/API/chkstat/returnipn.php