Professional Documents
Culture Documents
IonPay PG Guide - PHP
IonPay PG Guide - PHP
SYSTEM
Merchant integration
Write Date
2012.08.23
TASK
Document
Version
1.0
PHP Version
2012-08-23
Merchant integration
Write Date
2012.08.23
TASK
Document
Version
1.0
Table of Contents
IonPay PG Integration Guide................................................................................................................................................ 1
I.
Preparation ......................................................................................................................................................................... 3
1.
2.
3.
Files provided............................................................................................................................................................ 3
II.
III.
IV.
V.
1.
2.
3.
4.
5.
6.
7.
Payment Result......................................................................................................................................................... 6
Merchant integration
Write Date
2012.08.23
TASK
Document
Version
1.0
I. Preparation
1.
Merchant Registration
Before using IonPay Payment Gateway System, Merchant should register IonPay PG
Service. Contact IonPay representative.
File
Description
MID
Merchant ID
2.
Merchant Admin ID
Payment Method ID
Description
ClickPay Mandiri
ATM Mandiri
(under construction)
3.
Files provided
File
Description
ionpay.php
Payment module
mall-sample.php
Sample files
payment.php
payment-result.php
IonPay PG Guider - PHP.pdf
Merchant integration
Write Date
2012.08.23
TASK
Document
Version
1.0
MerchantID.key
https://bo.ionpay.net/IonPayBO/
Merchant can login Merchant Back-Office site (above URL) using Merchant Admin ID and
password issued by IonPay.
Refer Merchant Back-Office User's Guide.
Merchant integration
Write Date
2012.08.23
TASK
Document
Version
1.0
User Browser
Merchant
IonPay PG
1. Payment Request
(Select Payment Method)
4. Payment Processing
7. Payment Result
Merchant integration
Write Date
2012.08.23
TASK
Document
Version
1.0
In Merchant implementation, selecting Payment Method is the first step for payment.
2.
Payment Processing
5.
After completed or canceled IonPay PG open Return URL via user browser.
6.
In Return URL implementation, Merchant query Payment Result from IonPay PG and do matching
action for the result.
7.
Payment Result
Complered Payment.
6
Merchant integration
Write Date
2012.08.23
TASK
Document
Version
1.0
V. API (PHP)
IonPay(MID, merchantKeyFilePath)
Description
Merchant ID
merchantKeyFilePath
Parameters
Return Value
Set(name, value)
Description
Item name
value
Item value
Parameters
Return Value
none
Before Payment Register, Merchant should set below name, value pairs.
name
value
invoiceNo
currencyCode
Currency Code
Set 320 for IDR
paymentMethod
amount
returnUrl
callbackUrl
option
Merchant integration
Write Date
2012.08.23
TASK
Document
Version
1.0
customerFirstName
customerLastName
customerAddress
Customer Address
customerCity
Customer City
customerCountry
Customer Country
customerZipCode
Before calling PaymentResult(), Merchant should set below name, value pairs.
name
Value
invoiceNo
tid
Parameters
Return Value
description
quantity
subTotal
none
Payment()
Description
Parameters
Return Value
When Payment() function call, IonPay object send request transaction to IonPay PG Server with
values set by Merchant. IonPay PG register payment transaction and issue Transactio ID then send
8
Merchant integration
Write Date
2012.08.23
TASK
Document
Version
1.0
Response_Code()
Description
Parameters
Return Value
Response_Msg()
Description
Parameters
Return Value
Get(name)
Description
Parameters
name
Item name
Return Value
name
url
Value
Payment URL for corresponding payment
Merchant should open this URL for payment.
This URL shows UI for each Payment Method.
tid
Transaction
ID
issued
by
IonPay
for
corresponding Payment
9
Merchant integration
Write Date
2012.08.23
TASK
Document
Version
1.0
name
Value
status
resultCode
resultMessage
fraudDecision
fraudReasonCode
fraudReasonMessage
Status value
Meaning
ok
init
Payment Canceled
cancel
fail
Payment Failed
wait
Void
Payment Voided
refund
Payment Refunded
PaymentResult()
Description
Parameters
Return Value
10
Merchant integration
Write Date
2012.08.23
TASK
Document
Version
1.0
11
Merchant integration
Write Date
2012.08.23
TASK
Document
Version
1.0
unset($ionpay);
?>
2. PaymentResult Query
payment-result.php
<?php
require_once("ionpay.php");
$ionpay = new IonPay("TESTMALL", "C:\\APM_Setup\\testmall.key");
$ionpay->Set("invoiceNo", $_GET['invoiceNo']);
$ionpay->Set("tid", $_POST['TID']);
$ionpay->PaymentResult();
if ($ionpay->Response_Code() != 0) {
// error
echo "response code = " . $ionpay->Response_Code() . "<p>";
echo "response msg = " . $ionpay->Response_Msg() . "<p>";
echo "response_json = " . $ionpay->Response_Json() . "<p>";
}
else {
echo "invoiceNo = " . $_GET['invoiceNo'] . "<p>";
echo "tid = " . $_POST['TID'] . "<p>";
echo "result = " . $ionpay->Get("resultCode") . "<p>";
}
unset($ionpay);
?>
12