Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

OpenPayAPI

I.
OpenPayAPI
OpenPayAPI .
OpenPayAPI step by step
.
OpenPayAPI Paygate
. OpenPayAPI interactive

.
OpenPayAPI .

, (dev@paygate.net)
.
popup PG

Post

II. OpenPayAPI ?
OpenPayAPI web 2.0
. .
embed
.
(OpenPayAPI HTTPS

OpenPayAPI

III. OpenPayAPI
OpenPayAPI html javascript
.
.
ECMAScript(JavaScript) DOM level1 .
- Internet Explorer, Firefox, Safari, Opera, google Chrome
.
- Microsoft Windows XP, Vista, 2003, 2008 servers, Mac OSX, Linux

IV. OpenPayAPI
.
Secure Javascript (Ajax)
.
( ActiveX HTML Form,
ISP .
OpenPayAPI OpenPayAPI.js include
.
<script type="text/javascript" src="https://api.paygate.net/ajax/common/OpenPayAPI.js">

V. OpenPayAPI
1.

OpenPayAPI.js javascript file PayGate server .

2.

doTransaction(document.PGIOForm)
.

3.

OpenPayAPI.js doTransaction(document.PGIOForm)
<div id="PGIOScreen"></div> .

4.

5.

PayGate getPGIOresult()
. .

6.

getPGIOresult()
.

OpenPayAPI

VI. OpenPayAPI

OpenPayAPI

OpenPayAPI

VII. OpenPayAPI
1. HTML .
<html> <body> tag 2 <head> <form>
<div>

2. OpenPayAPI.js include .
javascript

<html>
<head>
<title>Order Form</title>
<script type="text/javascript" src="/script/order.js"></script>
</head>
<body>

<html>
<head>
<title>Order Form</title>
<script language="javascript" type="text/javascript"
src="https://api.paygate.net/ajax/common/OpenPayAPI.js"></script>
<script type="text/javascript" src="/script/order.js"></script>
</head>
<body>

<head> tag

3. PGIOForm .
PGIOForm name form tag input

<form name="order">
Goodname : <input type="text" name="product_name" value="PayGate System"></input>
Price : <input type="text" name="product_price" value="110000">KRW110,000
</input>
Goodcode : <input name="product_orderno" value="PGSystem"></input>
</form>

OpenPayAPI


<form name="PGIOForm">
<input name="mid" value="testshop" />Merchant ID
<input name="paymethod" value="card" />Paymethod
<input name="goodname" value=" A" />Goodname
<input name="unitprice" value="110000" />Price
<input name="cardquota" value="" />Card Quota
<input name="cardexpiremonth" />Card Expiry month
<input name="cardexpireyear" />Card Expiry year
<input name="cardsecretnumber" />Card CVV2 value
<input name="cardownernumber" />last 7 number of card owner SSN (for Korean user only)
<input name="cardtype" />CardType
<input name="cardnumber" />CardNumber
<input name="cardauthcode" />Approval No
<input name="replycode" value="" />Payment Result Code
<input name="replyMsg" value="" />Payment Result Message
</form>


<form name="PGIOForm">
<input name="mid" value="testshop" />Merchant ID
<input name="paymethod" value="801" />paymethod
<input name="goodname" value=" A" />goodname
<input name="unitprice" value="110000" />price
<input name="goodcurrency" value="WON" />currency
<input name="socialnumber" value="8101011010101" />phone owner's SSN
<input name="carrier" value="SKT" />Mobile Carrier
<input name="receipttotel" value="01099995555" />phone no
<input name="replycode" value="" />payment result code
<input name="replyMsg" value="" />payment result message
</form>

<form name="PGIOForm">
<input name="mid" value="testshop" />Merchant ID
<input name="paymethod" value="4" />paymethod
<input name="goodname" value=" A" />Goodname
<input name="unitprice" value="110000" />Price
<input name="socialnumber" value="8101011010101" />Customer SSN
<input name="receipttoname" value="" />Customer Name
<input name="replycode" value="" />payment result code
<input name="replyMsg" value="" />payment result message
</form>

OpenPayAPI

( )
<form name="PGIOForm">
<input name="mid" value="testshop" />
<input name="paymethod" value="7" />
<input name="goodname" value=" " />
<input name="unitprice" value="110000" />
<input name="receipttoname" value="" />customer name
<input name="bankcode" value="110" />bank code
<input name="bankaccount" value="212234113512" />merchant bank account no
<input name="bankexpyear" value="2008" /><input name="bankexpmonth" value="10" /><input
name="bankexpday" value="23" />due year/month/day
<input name="receipttosocialnumber" value="01088885555" />personal phone number
<input name="replycode" value="" />payment result code
<input name="replyMsg" value="" />payment result message
</form>

.
<form name="PGIOForm">
<input name="mid" value="testshop" /> id



<input
name="paymethod"
value="???" />
<input name="goodname" value=" A" />
<input name="unitprice" value="110000" />
<input name="cardquota" value="" />card quota
<input name="cardexpiremonth" />card expiry month
<input name="cardexpireyear" />card expiry year
<input name="cardsecretnumber" />card cvv2 value
<input name="cardownernumber" />last 7 digit of cardowner SSN
<input name="cardtype" />cardtype
<input name="cardnumber" />cardnumber
<input name="cardauthcode" />approval number
<input name="socialnumber" value="8101011010101" />phone owner SSN
<input name="carrier" value="SKT" />mobile carrier
<input name="receipttotel" value="01099995555" />phone no
<input name="socialnumber" value="8101011010101" />customer SSN
<input name="receipttoname" value="" />customer name
<input name="replycode" value="" />payment result code
<input name="replyMsg" value="" />payment result message
</form>

OpenPayAPI


<form name="PGIOForm">
<input name="mid" value="testshop" />Merchant ID
<input name="paymethod" value="104" />paymethod
<input name="goodname" value="tgoods" />goodname
<input name="unitprice" value="11" />price
<input name="goodcurrency" value="USD" />currency
<input name="langcode" value="US" />language code
<input name="receipttoname" value="test buyer" />
<input name="cardquota" value="" />card quota
<input name="cardexpiremonth" />card expiry month
<input name="cardexpireyear" />card expiry year
<input name="cardsecretnumber" />card cvv2 value
<input name="cardownernumber" />last 7 digit of SSN
<input name="cardtype" />cardtype
<input name="cardnumber" />cardnumber
<input name="cardauthcode" />approval no
<input name="replycode" value="" />payment result code
<input name="replyMsg" value="" />payment result message
</form>

paymethod 104

langcode

English : US

Japaness : JP

goodcurrency

US Dollar : USD

Japan Yen : JPY

other over 170 currencies (ISO Standard currency code)


paymethod: 101 or 100
langcode: US or JP
: Won US .
goodcurrency: .

OpenPayAPI


<form name="PGOIForm">
<input name="mid" value="testshop" />Merchant ID
<input name="paymethod" value="802" />paymethod
<input name="goodname" value=" A" />goodname
<input name="unitprice" value="110000" />price
<input name="goodcurrency" value="WON" />currency
<input name="replycode" value="" />payment result code
<input name="replyMsg" value="" />payment result message
</form>

ARS
<form name="PGIOForm">
<input name="mid" value="testshop" />Merchant ID
<input name="paymethod" value="803" />paymethod
<input name="goodname" value=" A" />goodname
<input name="unitprice" value="110000" />price
<input name="goodcurrency" value="WON" />currency
<input name="replycode" value="" />payment result code
<input name="replyMsg" value="" />payment result message
</form>
ARS KT .

PGIOForm value , ""


javascript .

PayGate OpenPayAPI
Manual input tag .

.

langcode, goodcurrency
.

mid id

goodname

unitprice

paymethod

OpenPayAPI

. (
)
receipttoname

.
receipttotel

receipttoemail .

charset charset . (ex) UTF-8, EUC-KR)


.

4. CUP/Alipay
CUP
<form name="PGIOForm">
<input name="mid" value="testshop" />Merchant ID
<input name="paymethod" value="105" />paymethod
<input name="goodname" value="tgoods" />goodname
<input name="unitprice" value="50" />price
<input name="goodcurrency" value="CNY" />currency
<input name="langcode" value="CN" />language code
<input name="receipttoname" value="test buyer" />
<input name="cardquota" value="" />card quota
<input name="cardexpiremonth" />card expiry month
<input name="cardexpireyear" />card expiry year
<input name="cardsecretnumber" />card cvv2 value
<input name="cardownernumber" />last 7 digit of SSN
<input name="cardtype" />cardtype
<input name="cardnumber" />cardnumber
<input name="cardauthcode" />approval no
<input name="replycode" value="" />payment result code
<input name="replyMsg" value="" />payment result message
</form>

paymethod : 105

langcode : CN

goodcurrency : CNY

OpenPayAPI

Alipay
<form name="PGIOForm">
<input name="mid" value="testshop" />Merchant ID
<input name="paymethod" value="106" />paymethod
<input name="goodname" value="tgoods" />goodname
<input name="unitprice" value="50" />price
<input name="goodcurrency" value="CNY" />currency
<input name="langcode" value="CN" />language code
<input name="receipttoname" value="test buyer" />
<input name="cardquota" value="" />card quota
<input name="cardexpiremonth" />card expiry month
<input name="cardexpireyear" />card expiry year
<input name="cardsecretnumber" />card cvv2 value
<input name="cardownernumber" />last 7 digit of SSN
<input name="cardtype" />cardtype
<input name="cardnumber" />cardnumber
<input name="cardauthcode" />approval no
<input name="replycode" value="" />payment result code
<input name="replyMsg" value="" />payment result message
</form>

paymethod: 106

langcode: CN

goodcurrency: CNY or USD

CUP/Alipay

China

Alipay

1,000 CNY

China

CUP

1,000 CNY

China

Credit
Card

1,000 CNY

1,000/6.82 =

146.62 * 6.82 =

146.62 USD

146.62 USD

146.62 USD

999.94 CNY

1,000 CNY

1,000 CNY

1,000 CNY * 0.123 =

123 USD

123 USD

1,000/6.82 =

146.62 * 6.80 =

999.94 CNY * 0.147 =

146.99 USD

146.62 USD

999.94 CNY

146.99 USD

10

OpenPayAPI

5. doTransaction() .

<script type="text/javascript">
function startPayment() {
// TODO payment integration
}
</script>
<form name="order">
goodname : <input type="text" name="product_name" value=" "></input>
price : <input type="text" name="product_price" value="110000"> 11 </input>
goodcode : <input name="product_orderno" value="PGSystem"></input>
<input type="button" value="PAY NOW" onclick="startPayment();"/>
</form>

<script type="text/javascript">
function startPayment() {
// TODO payment integration.
doTransaction(document.PGIOForm);
}
</script>
<form name="order">
goodname : <input type="text" name="product_name" value=" "></input>
price : <input type="text" name="product_price" value="110000"> 11 </input>
goodcode : <input name="product_orderno" value="PGSystem"></input>
<input type="button" value="PAY NOW" onclick="startPayment();"/>
</form>

doTransaction(document.PGIOForm);
.

validation .

PayGate .
( html <input> tag)

11

OpenPayAPI

6. . PGIOScreen

PGIOScreen div tag


.
Layout .

PGIOScreen <form>
. PGIOScreen <form> tag .

CSS
.

7. getPGIOresult() .

<script type="text/javascript">
function startPayment() {
doTransaction(document.PGIOForm);
}
</script>

<script type="text/javascript">
function startPayment() {
doTransaction(document.PGIOForm);
}
function getPGIOresult() {
verifyReceived(getPGIOElement('tid'), 'callbacksuccess', 'callbackfail');
}
function callbacksuccess() {
var replycode = getPGIOElement('replycode')
if (replycode == '0000') {
// for transaction success
document.PGIOForm.action = 'shop.co.kr/pay/record_payment.jsp';
document.PGIOForm.submit();
} else {
// for transaction failuer
alert(" . ");
}
}
function callbackfail() {
// paygate system error
}
</script>

12

OpenPayAPI

getPGIOresult() PGIOForm
.

, , ..
getPGIOresult() .

, getPGIOresult()
.

getPGIOresult()
.

getPGIOresult()
.

8. ()
DB
.

(doTransaction(document.PGIOForm)) verifyNum +1
function getPGIOresult() verifyNum +1 .
verifyNum +2 ( openPayApi

verifyNum +2 )
DB verifyNum +100 DB insert
.

verifyNum +100

. .

<% .
%>
<html>
<head>
<title>Transaction Successfully Completed</title>
<script language="javascript" src="https://api.paygate.net/ajax/common/OpenPayAPI.js"></script>
<script language="javascript">
function businessverify() {
setPGIOElement('apilog','100');
setPGIOElement('tid',' ');
verifyReceived(); [or verifyReceived('',' ','
');
}
</script>
</head>
<body onLoad="javascript:business_verify();">
<form name='PGIOForm'></form> <-- appendChild

.
.
.
</body></html>

13

OpenPayAPI

9. (SHA-256)
hash .
hash .
hashresult .
result = replycode + tid + mb_serial_no + org_amt + currency
hashresult = result + https://service.paygate.net api password
salt
*api password - > > API
.
ex) hashresult = + trnsctn_no( ) + +
+
( value .)
-KRW, -USD, -JPY, CNY
function getPGIOresult() {
var replycode = getPGIOElement('replycode')
var hashresult = getPGIOElement('hashresult') -- hash
if (replycode == '0000') {
document.PGIOForm.action = 'shop.co.kr/pay/record_payment.jsp';
document.PGIOForm.submit();
} else {
}
}

10.

.

2

.

14

OpenPayAPI


.

.
.

email .
email .

.

URL tid ( )
((KR) (US) .)

https://service.paygate.net/front/support/slipView.jsp?trnsctnNo=appletest_
090107.873843&admMemNo=M000000001&langcode=KR&nbsp;

https://service.paygate.net/front/support/slipView.jsp?trnsctnNo=appletest_
090107.873843&admMemNo=M000000001&langcode=US

VIII.
..
dev@paygate.net / / /

1.

https://api.paygate.net/ajax/cardform.html ( Korea Local Card)

https://api.paygate.net/ajax/cardform_USD2.html ( International Cards)

https://api.paygate.net/ajax/Phone_form.html ( Korea Mobile phone)

id(mid), (goodname),
(unitprice) .

(receipttoname), charset(charset),
(langcode) .

2. ( )
https://api.paygate.net/orderforms/order.html

15

OpenPayAPI

1) OpenPayAPI .
.

2) PayGate System , ISP .


3) getPGIOresult() .

16

OpenPayAPI

IX.
VISA3D(,, LG,,, ) ISP(, )
(,, ) .
, .
div tag
.
( )
.
.
. localhost .
.

1. ()
.
.

.

2.
* VISA, MASTER . (
USD .

: dev@paygate.net .

test id / pw

(100 )

17

You might also like