Professional Documents
Culture Documents
2 How To Use OpenPayAPI PDF
2 How To Use OpenPayAPI PDF
12
2.3 PGIOForm
2.3.1 PGIOForm Description of PGIOForm variables
Max length
Variable name
Variable title
Description .
charset . When merchant send payment information to paygate server, Paygate need charset variable for detect merchant web page charset exactly.
. . In Paymethod "cardreceipt", this variable will contain the card receipt. On other cases, it will contail the brief result of the transaction. ,
Replycode
Reply code
replycode list . Payment reply code, "0000" means the successful result, others are failed.
resultcode
resultcode resultmsg
(rnameauth) . "J2000" . . .
resultmsg
KR - Korean; JP - Japanese; langcode 2 Language code CN - .chinese, US - English none - autodetect the langcode by the content in PGIOForm. mid 20 ID Member ID ID . The merchant id that paygate assigned. . API tid 40 Transaction ID API . Unique transaction identification number, If this variable is empty, the API will generate the TID. mb_serial_no 40 . TID
Member Order No . The order no merchant manage. paymethod list . The payment method code. Refer the paymethod code list. . Good name or brief description of goods. . . Good amount, it has to be the total amount of goods. "WON" . Currency Code for the Amount. . . Credit card code. Refers to the cardcode list. (-) .
paymethod
11
goodname
100
unitprice
10
cardtype
cardnumber
21
Credit card number Credit card numbers without any dash(-) or space(). 2 . 3 "03".
cardexpiremonth
Card expire month 2 digit of card expire month . (ex) "03" for March Card expire year Card quota 4 . 4 digit of card expire year. (YYYY) 00 . "02"~"12" . Card installment term. Valid between "00" ~ "12"
cardexpireyear
cardquota
. demoresult 7 Demo result (success), (fail) The variable cause the demo result to "success" or "fail" by the value "success" / "fail" (BASIC_AUTH) cardsecretnumber 3 Card secret number . 2 CVV2 . Last 3 digit code followed by credit card number on card back side(CVV2 code) for international cards. first 2 digit of card secret number for Korea local issued cards. 7 10 . cardownernumber 10 Card owner number (BASIC_AUTH) . Last 7 digit of personal social security number or full 10 digit of company registration number. Only available for Korean card holders. cardauthcode 8 Card approval no 8 , 6 , 2 . Credit card approval number. (cardreceipt) . fromDT 8 Search date "YYYYMMDD" format . Used in cardreceipt paymethod. "YYYYMMDD" for searching transaction. . bankcode 2 Bank code . Used in BTNOTICE(7) paymethod. 2 digit bank code to be remitted by the customer. Filled with the escrow bank account on escrow transaction.
bankaccount
banksendername
"YYYY" bankexpyear 4 format . paymethod. "YYYY" format. bankexpmonth 2 Bank expected month "MM" format . The expected month to be remitted on BTNOTICE(7) paymethod. "MM" format. "DD" bankexpday 2 format . paymethod. "DD" format. "escrow". loanSt 4 Escrow status . "escrow" value cause the Transaction to be escrowed by PayGate. Only available for BTNOTICE(7) and RTBT(4) paymethod.) Payer Name . . The payer name. it is also used as the account owner name on escrow virtual bank account number. . . socialnumber 13 Social Social Security Number. To issue the cash receipt, it is Security Number used as the personal identification number that it can ber replaced with mobile phone number or cash receipt card number. receipttoemail 100 e-mail . e-mail address of the customer. . . receipttotel 20 Phone number Customer phone number. if it is the mobile phone number and the escrow transaction mode, the customer will receive the escrow bank account information via SMS mobile message. 5 Bank expected day The expected day to be remitted on BTNOTICE(7) Bank expected year The expected year to be remitted on BTNOTICE(7)
receipttoname
50
receipttocountrycode
Country code
"KR" . The country code of the customer. "ON" . Set "ON" on the tax invoice required.
taxflag
Tax flag
taxvatregno
10
( ). 10 digit of company registration number of the company will receive the tax invoice.
taxcompanyname
50
. Company name Official company name to receive the tax invoice. . The official company representative name. .
taxrepresentative
50
Representative name
taxaddr
100
Company address The official company address registered. Business type . The company business type(UpTae) registered in tax office. . The company business item(JongMok) registered in tax office. The department for arrived tax invoice.
taxbiztype
20
taxbizitem
20
Business item
taxdepartment
50
taxcontactname
50
tax invoice
Contact person for The contact person for arrived tax invoice.
. . Official e-mail address to be sent the tax invoice . . The contact phone number for tax invoice. If the phone number is mobile, the SMS message will be sent to notify the tax invoice is ready..
2.3.1.1 replycode
"0000" "0000" means the SUCCESS. Other codes mean the FAIL. . (validation paygate transaction) V : . P : . T : . V, P T 3 .
(ISP) . ActiveX Control Windows Platform 102 . Credit card ISP(internet secure payment) is only available on Microsoft Internet Explorer using ActiveX 103 104 105 106 9 (VISA3D) . VISA3D . Credit card VISA3D type. Korea localized visa 3d secure transaction. Credit card US Dollar transaction for international cards issued outside of Korea. China Debit Card China Alipay (BASIC_DEMO) . Windows Platform . Credit card BASIC_DEMO type. Card demo transaction (RTBT) . 4 Real Time Bank Transaction(RTBT) type transaction. Only available on Microsoft internet explorer on windows OS. 7 (BTNOTICE) . Bank Transfer Notice Transaction(BTNOTICE). (transinfo) . To retrieve the transaction information.
transinfo
rnameauth (rnameauth) . . cardreceipt (cardreceip) . To view and print the card receipt. . Mobile phone payment. .
801 999
BC , BC , BC , BC , 310 BC , BC , BC , BC , BC , BC , BC , BC 410 510 610 710 810 915 923 2A0 2Y0 2Z0 d2J0 ( LG) , , American Express Master VISA JCB
BC Card, Woori BC Card, Kiup BC Card, KB BC Card, KyungNam BC Card, Nonghyup BC Card, DaeGu BC Card, Pusan BC Card, SJJEIL BC Card,Hana BC Card, Citi BC Card, Shinhan BC Card SHINHAN(old LG) Card SAMSUNG Card HYUNDAI Card, Diners Card LOTTE Card, AMEX Card SHINHAN Card HANMI Card CITY Card International American Express Card International Master Card International VISA Card International JCB Card
10
2.3.2
PGIOForm API INTERFACE HTML FORM . PGIOForm is used for data I/O between API and merchant application. FORM "PGIOForm" the form name must be "PGIOForm". Req Variable and Value both required. Vre Variable required. Opt Optional
Type
Req Req
Req
"TEST GOODS"
goodname
Req Req Req Vre Vre Vre Vre Vre Vre Vre Vre Vre
unitprice goodcurrency cardquota cardexpiremonth cardexpireyear cardtype cardnumber replycode replyMsg ResultScreen cardauthcode tid
Opt
"mt@paygate.net"
receipttoemail
Opt
"0112108338"
receipttotel
Opt
"KR"
receipttocountrycode
Credit card approval with card number and expire date BASIC Type . Need the permission because of fraud issue.
Vre Vre Vre Vre Vre Vre Vre Vre Vre Opt Opt Opt Opt Opt Opt
Opt
"KR"
receipttocountrycode
Credit card approval with card number, expire date, card secret number(first 2 digit), social security number(last 7 digit) or company registration number(full 10 digit) BASIC_AUTH Type . need the permission because of fraud issue.
2.3.2.3 (ISP) Credit card ISP(Internet Secure Payment) type transaction (ISP)
Type Input example Req Req "paygateshop" "102" variable name mid paymethod IN 13 OUT Output example
Req Req Req Req Vre Opt Opt Opt Opt Vre Vre Vre Vre Vre Vre Opt Opt Opt Opt Opt Opt
"TEST GOODS" "230000" "WON" "00" "310" "07" "2008" "12" "1432321" "4242424242424242"
goodname unitprice goodcurrency cardquota cardtype cardexpiremonth cardexpireyear cardsecretnumber cardownernumber cardnumber replycode replyMsg ResultScreen cardauthcode tid
Opt
"KR"
receipttocountrycode
PC credit card approval with initial cardtype and the digital certificate stored in client PC only available on Microsoft Internet Explorer on Windows platform.
14
Opt Opt
"mt@paygate.net" "0112108432"
receipttoemail receipttotel
Opt
"KR"
receipttocountrycode
16
Opt
"KR"
receipttocountrycode
credit card demo transaction do not send the approval request to card issuers. replycode=100 .
17
Vre Vre Vre Vre Vre Vre Vre Vre Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt
"4546050012330000"
"07" "123" "test" "tran1" "mt@paygate.net" "82 2 2140 2700" "US" "radd1" "radd2" "radd3" "option1" "option2" "option3" "option4" "option5" "accepter" "saddr1" "saddr2" "saddr3" "mt@paygate.net" "82 2 2140 2755"
cardexpiremonth cardsecretnumber goodrecvmsg mb_serial_no receipttoemail receipttotel receipttocuntrycode receipttoaddr1 receipttoaddr2 receipttoaddr3 goodoption1 goodoption2 goodoption3 goodoption4 goodoption5 shiptoname shiptoaddr1 shiptoaddr2 shiptoaddr3 shiptoemail shiptotel
18
USDollar paymethod "104" . credit card approval as USD currency. cardsecretnumber : 3 . cardsecretnumber" variable is used for CVV2/CVC2 authentication (last 3 digit of credit card back side) unitprice : 2 . "unitprice" have to be filled with 2 digit decimal point this type transaction is available for international cards issued at outside of Korea.
2.3.2.7 (BASIC_INT) International credit card transaction with KRW base currency (BASIC_INT)
(USD) ,(JPY) (KRW) . Type Input example Req Req Req Req Req Req Req Req Req Vre Req Req Req "ever2" "100" "TEST GOODS" "100" "USD" ,"JPY" "07" "2008" "2Z0" "4546050000000000" "321" variable name mid paymethod goodname unitprice goodcurrency cardexpiremonth cardexpireyear cardtype cardnumber cardsecretnumber replycode replyMsg resultScreen IN "0000" "successfully completed" "." "45460500********" OUT Output example
19
Req Req Req Req Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt Opt "US" "evidentkr Kim" "test" "tran1" "mt@paygate.net" "82 2 2140 2700" "AF" "radd1" "radd2" "radd3" "option1" "option2" "option3" "option4" "option5" "accepter" "saddr1" "saddr2" "saddr3" "mt@paygate.net"
cardauthcode tid langcode receipttoname goodrecvmsg mb_serial_no receipttoemail receipttotel receipttocountrycode receipttoaddr1 receipttoaddr2 receipttoaddr3 goodoption1 goodoption2 goodoption3 goodoption4 goodoption5 shiptoname shiptoaddr1 shiptoaddr2 shiptoaddr3 shiptoemail
"08433653" "evidentkr_060724.132123"
Opt
shiptotel
20
paymethod . this type of transaction is only available for international cards issued outside of Korea. (checking the card prefix)
goodcurrency : . "goodcurrency" can be vary for multiple currencies. Up to 22 currencies are available. If non-KRW currency selected, the amount will be converted to KRW automatically by the Visa Exchange rate o refer the currency code list at chapter "2.3.2.5 currencycode list" cardsecretnumber : 3 ."cardsecretnumber" is used for CVV2/CVC2 card authentication (CVV2 is the last 3 digit of credit card back side)
Req
"04"
bankcode
"00404" 004
21
Vre Vre Vre Vre Vre Opt Opt Opt Opt Opt Opt "" "7001011432321" "mt@paygate.net" "0112108432" " 103-21" "A32Q4324" Used for issuing tax invoice. Refer Opt the manual chapter 3.3 for more information Opt Opt Opt Opt Opt Opt Opt Opt "escrow"
replyMsg ResultScreen tid loanSt bankaccount banksendername -> socialnumber receipttoemail receipttotel receiptaddr mb_serial_no ->
"3214234567" ""
" 10321"
taxflag
Opt
taxcontactemail
22
to enable the escrow transaction, set the "loanSt" variable's value to "escrow" loanSt "(escrow)" bankaccount bankcode . If the loanSt is "escrow", the API let the customer choose the bankcode. If the loanSt is "escrow", the generated bank account number will be filled in "bankaccount" variable
If no escrow selected and bankcode and bankaccount variable is empty, it will be filled with the merchant settle bank account information The bankcode and bankaccont will be notified to customer via Mail and Mobile SMS(on escrow transaction) . The issuing tax invoice require the agreement with 3rd party service provider "WebTax21"
2.3.2.9 (BTNOTICE)
2.3.1.8 . bankcode . SMS .
23
"424242" "1323432" "M00004323" "2006/07/24 17:46:59" "2006/07/25 09:40:25" "2006/07/25 09:50:26" "2006/08/12 11:11:23" "102" "230000" "04" "13235687" "301510" "42424242********" "08" "2008" "0" "43257896"
Req
acquire_reqst_dt
Req
cncl_dt
Req Req Req Req Req Req Req Req Req Req Req
sttl_dt paymethod unitprice outbankcode outaccountno cardtype cardnumber cardexpiremonth cardexpireyear cardquota cardauthcode
24
25
Opt Used for issuing tax Opt invoice. Refer the manual chapter 3.3 Opt Opt Opt Opt Opt Opt Opt Opt Opt
mb_serial_no
taxflag
Opt
taxcontactphone
loanSt "escrow" . . to enable the escrow transaction, set the "loanSt" variable's value to "escrow" this type of transaction is only available on MSIE the amount will be remitted in real time from customer's bank account to merchant seyfert account (PayGate's settlement virtual account)
26
Req Req Req Opt Req Req Req Req Req Req Req Req
mid : PayGate MemberID . need the permission of PayGate. unitprice : 400 . unitprice : the minimum amount is KRW400, the maximum is vary for each customer's credit. paymethod : "801" . Set the paymethod value to "801" carrier : SKT-"011", KTF-"016", LGT-"019" Available carriers are "011"(SKT), "016"(KTF), "019"(LGT) receipttotel : (-) . receipttotel : phone holder's real mobile phone number without dash(-) mark. socialnumber : . socialnumber : the phone owner's full social security number to verify the phone number. cardauthcode : . cardauthcode : will be filled with the approval number from mobile Carrier.
27
Input example Req Req Req Req Req Req Vre Vre Opt Opt Opt Opt Vre Vre Vre Vre Vre Opt Opt Opt Opt Opt Opt "KR" "A32Q4324" "Mountie Lee" "7001011432321" "mt@paygate.net" "0112108432" "paygateshop" "card" "TEST GOODS" "230000" "WON" "00" "510" "4242424242424242" "07" "2008" "12" "1432321"
variable name mid paymethod goodname unitprice goodcurrency cardquota cardtype cardnumber cardexpiremonth cardexpireyear cardsecretnumber cardownernumber replycode replyMsg ResultScreen cardauthcode tid langcode mb_serial_no receipttoname socialnumber receipttoemail receipttotel
IN
OUT
Output example
"301510" "42424242********"
Opt
"KR"
receipttocountrycode
PayGate API automatically detect the proper paymethod by the client's environment and payment informations. 28
2.4 doTransaction()
OpenPayAPI . the external method called to start payment process. PGIOForm . Using PGIOForm for data I/O. OpenPayAPI . o o doTransaction() : . verifyReceived(tid, callbacksuccess, callbackfail) : .( tid )
2.5 PGIOscreen
OpenPayAPI PGIOscreen DIV tag . PGIOscreen is the DIV tag name to display payment related informations or interact with customer. o PGIOscreen HTML FORM tag FORM . PGIOscreen DIV tag . The object ID have to be set "PGIOscreen" PGIOscreen DIV tag . Following example shows locating the PGIOscreen div tag on the top of document <html><body>. <table align="center" border="0" cellspacing="0" bgcolor="#F6F6F6" summary="PGIOscreen"> <tr><td align="left"> <div id="PGIOscreen"></div> </td></tr> </table> .
29
30
............... <form name="PGIOForm"> ............... <input type="hidden" name="kindcss" value="1"> ............... </form> ............... Style of PGIOscreen
<style> <!-- 3 --> html{} head{} #PGIOscreen { font-size:11px; } #PGIOscreen { font-family:verdana; } #PGIOscreen { color:#665310; } #PGIOscreen table { border:1px dotted #e9de85; border-collapse: collapse; } #PGIOscreen textarea { border:1px solid #e9de85; 31
padding:10px; width:97%; height:100px; background-color:#ffffff; color:#665310; font-size:11px; font-family:verdana; scrollbar-face-color: #e9de85; scrollbar-shadow-color: #ffffff; scrollbar-highlight-color: #F3f3f3; scrollbar-3dlight-color: #ffffff; scrollbar-darkshadow-color: #F3f3f3; scrollbar-track-color: #ffffff; scrollbar-arrow-color: #f9f9f9; } #PGIOscreen td{ color:#ad8a0c; font-family:arial; font-size: 9pt; line-height:14px; padding-left: 4px; padding-right: 4px; padding-bottom: 4px; padding-top: 4px; } #PGIOscreen input { border: #D0D0D0 1px solid; background-color:#Ffffff; font-size:11px; height:20px; font-family:verdana; padding:3px 0 0 3px; } #PGIOscreen select { font-family:verdana; font-size:10pt; 32
Style "1"
Style "2"
33
Style "3"
Style "4"
Style "5"
2.6 getPGIOresult()
OpenPayAPI API getPGIOresult() . . getPGIOresult() . this method is called inside of API when the transaction process ended. getPGIOresult() . The merchant have to define the method as following example.
34
<script language="javascript"> function getPGIOresult() { if (document.PGIOForm.elements('replycode').value == '0000') { document.PGIOForm.action = 'https://www.merchantdomain.com/getresult.jsp'; // alert(document.PGIOForm.elements('replycode').value); <- // alert .
35