You are on page 1of 35

OpenPayAPI - How to use OpenPayAPI version 3.

12

2. API How to use OpenPayAPI


2.1 Five The 5 core concepts
API Calling API o HTML PAGE API Import the OpenPayAPI in your html page PGIOForm Data IO using html form o o o FORM "PGIOForm" The form name is static "PGIOForm" PGIOForm The input value have to be set in form variables API PGIOForm The API set the output value in form variables. "doTransaction()" To start the transaction, call the unique external API method "doTransaction()" "PGIOscreen" div tag Using "PGIOscreen" div tag to interact with the customer API API "getPGIOresult()" One single callback method "getPGIOresult()" that is called after the transaction completion o "getPGIOresult()" . The merchant is able to define "getPGIOresult()" method.

2.2 API Calling API


HTML <HEAD> SCRIPT TAG Add script tag to HTML <HEAD> location.
<html><head> <script language="JavaScript" type="text/javascript" src="https://api.paygate.net/ajax/common/OpenPayAPI.js"></script> </head>

API The OpenPayAPI location: https://api.paygate.net/ajax/common/OpenPayAPI.js

OpenPayAPI - How to use OpenPayAPI version 3.12

2.3 PGIOForm
2.3.1 PGIOForm Description of PGIOForm variables
Max length

Variable name

Variable title

Description .

charset Page Charset

charset . When merchant send payment information to paygate server, Paygate need charset variable for detect merchant web page charset exactly.

replyMsg Payment result message

Replycode . Replycode 2000 . The payment result message of replycode. (cardreceipt)

ResultScreen Payment result screen

. . 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

OpenPayAPI - How to use OpenPayAPI version 3.12

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

Payment method code

goodname

100

GoodName amount Currency Code Card Code

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

OpenPayAPI - How to use OpenPayAPI version 3.12

. 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

OpenPayAPI - How to use OpenPayAPI version 3.12

"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

OpenPayAPI - How to use OpenPayAPI version 3.12

receipttocountrycode

Country code

"KR" . The country code of the customer. "ON" . Set "ON" on the tax invoice required.

taxflag

Tax flag

taxvatregno

10

Company registration number

( ). 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

The Dept for tax invoice

taxcontactname

50

tax invoice

Contact person for The contact person for arrived tax invoice.

OpenPayAPI - How to use OpenPayAPI version 3.12

taxcontactemail 100 Contact email for 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..

taxcontactphone 50 Contact phone for tax invoice

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 .

2.3.1.2 paymethod list


paymethod description . . card Credit card payment method letting the paygate determine the proper paymethod for each transaction by client's environment and payment informations. 100 (BASIC) . . Credit card BASIC type. Approval with cardnumber and expire date only. (BASIC_AUTH) . . 101 Credit card BASIC_AUTH type. Approval with cardnumber, expire date, first 2 digit of card secret number and last 7 digit of personal SSN(or 10 digit of company registration number) 7

OpenPayAPI - How to use OpenPayAPI version 3.12

(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

2.3.1.3 cardtype list


code 110 210 Card issuers in Korean , KB , KB Card Issuers Kookmin Card, ChukHyup KB Card, Citi(Hanmi) KB Card KEB Card

OpenPayAPI - How to use OpenPayAPI version 3.12

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

2.3.1.4 bankcode list


bankcode 03 04 11 20 26 81 71 Bank name Kiup Bank Kookmin Bank (KB Star) NongHyup bank Woori bank Shinhan bank Hana bank Korea Post Office bank

OpenPayAPI - How to use OpenPayAPI version 3.12

2.3.1.5 currencycode list


bankcode WON USD JPY EUR AUD BRL GBP CAD CNY DKK HKD ISK INR MYR MXN NZD NOK SGD ZAR SEK CHF TWD THB Region Korea USA Japan Europe Australia Brazil Great Britain Canada China Denmark Hong Kong Iceland India Malaysia Mexico New Zealand Norway Singapore South Africa Sweden Swiss Taiwan Thailand Currency Name Korean Won US Dollar Japan Yen Euro Australian Dollar Brazilian Real Pound Sterling Canadian Dollar Yuan Renminbi Danish Kron Hong Kong Dollar Iceland Krona Indian Rupee Malaysian Ringgit Mexican Nuevo Peso New Zealand Dollar Norwegian Krone Singapore Dollar South African Rand Swedish Krona Swiss Franc Taiwan Dollar Thai Baht

10

OpenPayAPI - How to use OpenPayAPI version 3.12

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

2.3.2.1 (BASIC) Credit Card basic type transaction (BASIC)


Input example "paygateshop" "100" variable name mid paymethod IN OUT Output example

Type

Req Req

Req

"TEST GOODS"

goodname

Req Req Req Vre Vre Vre Vre Vre Vre Vre Vre Vre

"230000" "WON" "00" "07" "2008" "310" "4242424242424242"

unitprice goodcurrency cardquota cardexpiremonth cardexpireyear cardtype cardnumber replycode replyMsg ResultScreen cardauthcode tid

"301310" "42424242********" "0000" "" "SUCCESS" "...." "08433653" "paygateshop_060724.132123" 11

OpenPayAPI - How to use OpenPayAPI version 3.12

Opt Opt Opt Opt

"KR" "A32Q4324" "Mountie Lee" "7001011432321"

langcode mb_serial_no receipttoname socialnumber

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.

2.3.2.2 (BASIC_AUTH) Credit card Authentication Type transaction (BASIC_AUTH)


Type Input example Req Req Req Req Req Vre Vre Req "paygateshop" "101" "TEST GOODS" "230000" "WON" "07" "2008" "00" variable name mid paymethod goodname unitprice goodcurrency cardexpiremonth cardexpireyear cardquota IN 12 OUT Output example

OpenPayAPI - How to use OpenPayAPI version 3.12

Vre Vre Vre Vre Vre Vre Vre Vre Vre Opt Opt Opt Opt Opt Opt

"12" "1432321" "310" "4242424242424242"

cardsecretnumber cardownernumber cardtype cardnumber replycode replyMsg ResultScreen cardauthcode tid

"301310" "42424242********" "0000" "" "." "08433653" "paygateshop_060724.132123"

"KR" "A32Q4324" "Mountie Lee" "7001011432321" "mt@paygate.net" "0112108432"

langcode mb_serial_no receipttoname socialnumber receipttoemail receipttotel

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

OpenPayAPI - How to use OpenPayAPI version 3.12

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

"" "0000" "" "." "08433653" "paygateshop_060724.132123" "301310"

"KR" "A32Q4324" "Mountie Lee" "7001011432321" "mt@paygate.net" "0112108432"

langcode mb_serial_no receipttoname socialnumber receipttoemail receipttotel

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

OpenPayAPI - How to use OpenPayAPI version 3.12

, , Only available for BC, KB, Woori card issuers

2.3.2.4 (VISA3D) Credit card 3D Secure type transaction (VISA3D)


Type Input example Req Req Req Req Req Req Vre Vre Opt Opt Opt Opt Vre Vre Vre Vre Vre Opt Opt Opt Opt "KR" "A32Q4324" "Mountie Lee" "7001011432321" "paygateshop" "103" "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 15 IN "0000" "" "." "08433653" "paygateshop_060724.132123" "301510" "42424242********" OUT Output example

OpenPayAPI - How to use OpenPayAPI version 3.12

Opt Opt

"mt@paygate.net" "0112108432"

receipttoemail receipttotel

Opt

"KR"

receipttocountrycode

called "AnSim Click" as the Korea localized Visa 3D Secure transaction

2.3.2.5 (BASIC_DEMO) credit card demo type transaction (BASIC_DEMO)


Type Input example Req Req Req Req Req Req Req Req Req Req Opt Opt Req Req Req Req Req "paygateshop" "9" "TEST GOODS" "230000" "WON" "00" "310" "4242424242424242" "07" "2008" "12" "1432321" variable name mid paymethod goodname unitprice goodcurrency cardquota cardtype cardnumber cardexpiremonth cardexpireyear cardsecretnumber cardownernumber replycode replyMsg ResultScreen cardauthcode tid IN "0000" "" "." "08433653" "paygateshop_060724.132123" "301510" "42424242********" OUT Output example

16

OpenPayAPI - How to use OpenPayAPI version 3.12

Opt Opt Opt Opt Opt Opt

"KR" "A32Q4324" "Mountie Lee" "7001011432321" "mt@paygate.net" "0112108432"

langcode mb_serial_no receipttoname socialnumber receipttoemail receipttotel

Opt

"KR"

receipttocountrycode

credit card demo transaction do not send the approval request to card issuers. replycode=100 .

2.3.2.6 (BASIC_USD) International credit card US dollar type transaction (BASIC_USD)


( . ex:visa,master,amex,jcb . , ) Type Input example Req Req Req Req Req Req Req Vre Vre "evidentkr2" "104" "TEST GOODS" "100" "USD" "US" "evidentkr Kim" "2008" "2Z0" variable name mid paymethod goodname unitprice goodcurrency langcode receipttoname cardexpireyear cardtype IN OUT Output example

17

OpenPayAPI - How to use OpenPayAPI version 3.12

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"

cardnumber replycode replyMsg resultScreen cardauthcode tid

"45460500********" "0000" "successfully completed" "." "08433653" "evidentkr_060724.132123"

"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

OpenPayAPI - How to use OpenPayAPI version 3.12

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

OpenPayAPI - How to use OpenPayAPI version 3.12

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

"82 2 2140 2755"

shiptotel

credit card approval with KRW base currency

20

OpenPayAPI - How to use OpenPayAPI version 3.12

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)

2.3.2.8 (BTNOTICE) Bank Transfer Notice type transaction(BTNOTICE)


Type Input example Req Req Req Req "paygateshop" "7" "TEST GOODS" "230000" variable name mid paymethod goodname unitprice IN OUT Output example

Req

"04"

bankcode

"00404" 004

Req Req Req Req Req Vre

"2007" "08" "02" "Mountie Lee" "WON"

bankexpyear bankexpmonth bankexpday receipttoname goodcurrency replycode

"0000" "Mountie Lee"

21

OpenPayAPI - How to use OpenPayAPI version 3.12

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 ->

"" "." "paygateshop_060724.132123"

"3214234567" ""

" 10321"

taxflag

taxvatregno taxcompanyname taxrepresentative taxaddr taxbiztype taxbizitem taxdepartment taxcontactname

Opt

taxcontactemail

22

OpenPayAPI - How to use OpenPayAPI version 3.12

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 .

2.3.2.10 (transinfo) View transaction information type transaction (transinfo)


Type Input example Req Req Req Req Req Req Req Req "paygateshop" "transinfo" "paygateshop_060724.132123" variable name mid paymethod tid replycode replyMsg ResultScreen trnsctn_st mb_serial_no IN "0000" "" "." "304182" "APL14578" OUT Output example

23

OpenPayAPI - How to use OpenPayAPI version 3.12

Req Req Req Req

crd_prfx_no mrchnt_no mem_no trnsctn_dt

"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

2.3.2.11 (cardreceipt) view card receipt type transaction (cardreceipt)


Type Input example variable name IN OUT Output example

24

OpenPayAPI - How to use OpenPayAPI version 3.12

Req Req Req Req Req Req Req

"paygateshop" "cardreceipt" "61097538 "20060719"

mid paymethod cardauthcode fromDT replycode replyMsg ResultScreen

"0000" "" [card Receipt HTML code]

2.3.2.12 (RTBT) Real time bank transfer type transaction (RTBT)


Type Input example Req Req Req Req Req Req Vre Vre Vre Vre Vre Opt Opt "abcd@yahoo.co.kr" "0221402753" "paygateshop" "400" "Mac Mini" "4" "HongGilDong" "7102281122334" "escrow" variable name mid unitprice goodname paymethod receipttoname socialnumber loanSt tid ResultScreen replycode replyMsg receipttoemail receipttotel IN "paygateshop_060724.132123" "." "0000" "" OUT Output example

25

OpenPayAPI - How to use OpenPayAPI version 3.12

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

taxvatregno taxcompanyname taxrepresentative taxaddr taxbiztype taxbizitem taxdepartment taxcontactname taxcontactemail

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)

2.3.2.13 (PHONE) mobile phone type payment (PHONE)


Type Input example Req Req "mrshin" "400" variable name mid unitprice IN OUT Output example

26

OpenPayAPI - How to use OpenPayAPI version 3.12

Req Req Req Opt Req Req Req Req Req Req Req Req

"Music 5" "801" "WON" "HongGilDong" "KR" "011" "0112345678"

goodname paymethod goodcurrency receipttoname langcode carrier receipttotel

"mrshin_061103.1234" "1234219439123749132" "0000" "tid:.."

"7102281122334" socialnumber tid cardauthcode replycode ResultScreen

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.

2.3.2.14 (card) Credit card paymethod auto detection (card)


Type

27

OpenPayAPI - How to use OpenPayAPI version 3.12

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********"

"0000" "" "." "08433653" "paygateshop_060724.132123"

Opt

"KR"

receipttocountrycode

PayGate API automatically detect the proper paymethod by the client's environment and payment informations. 28

OpenPayAPI - How to use OpenPayAPI version 3.12

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

OpenPayAPI - How to use OpenPayAPI version 3.12

2.5.1 Style of PGIOscreen


6 UI CSS . To apply dynamic design to PGIOscreen, paygate provide 6 types of design options. "kindcss" 0, 1, 2, 3, 4, 5, . Use "kindcss" to select the design option. Valid variables are between "0" ~ "5" "kindcss" "kindcss" 0 1~5 0 . If the "kindcss" variable is not exist or the value is invalid, default value "0" will be selected. #PGIOscreen . If the merchant want to apply it's own css design, set the "kindcss" value to "no". and define private style as following example.

ex) <style> #PGIOscreen {font-family:Tahoma, verdana;} #PGIOscreen { <style>

30

OpenPayAPI - How to use OpenPayAPI version 3.12

............... <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

OpenPayAPI - How to use OpenPayAPI version 3.12

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

OpenPayAPI - How to use OpenPayAPI version 3.12

padding-top:3px; cursor: pointer; color: #ad8a0c; background-color:#FFFFFF; } </style>

2.5.1.2 CSS Style Screen Shot.


Style "0" (default)

Style "1"

Style "2"

33

OpenPayAPI - How to use OpenPayAPI version 3.12

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

OpenPayAPI - How to use OpenPayAPI version 3.12

<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 .

document.PGIOForm.submit(); } else { alert('transaction failed'); history.back(-1); } } </script> : getPGIOresult() alert . alert('') .

35

You might also like