Skip to main content

VGP Payment flow

Flow

flow_update.png

VGP Payment Notification URL

Description

VGP Server notifies user payment to partner

Request

Protocol

GET

URL

http://{vendor_payment_url}?event=onPayment&orderid={orderid}&loginname={vgp_id}&golden={golden}&serverid={serverid}&characterid={characterid}&ptoken={ptoken}&ticket={ticket}&tstamp={tstamp}

in which

NoParameterTypeNoteRequired
1eventStringFixed String onPaymentx
2orderidStringVGP transaction id which must be unique.x
3loginnamelong (bigint)VGP Identificationx
4goldenStringItem ID which user paid for. Game server only accepts specified item list which will be sent privatelyx
5serveridStringserver_id which called by game client
6characteridStringcharacter_id which called by game client
7ptokenStringpartnertoken which called by game client. Accepted length: 0- 50
8tstamplongunix timestamp at paid timex
9ticketStringVerified code which is calculated as belowx

How to calculate verifying string. Md5 of the following String.

{Payment_Token_Verification}golden{golden}loginname{loginname}orderid{orderid}serverid{serverid}characterid{characterid}ptoken{ptoken}tstamp{tstamp}

In which

  • Payment_Token_Verification is unique payment token which is sent privately to each partner.
  • In case of missing value of serverid, characterid, ptoken, to calculate verified string, remove also parameter name. e.g. when ptoken is null, remove _ptoken{ptoken}_ from string to calculate md5.

Note:

  • Game server only accepts payment request from VGP payment IP(s) which are sent privately to partner.

Content-Type

application/json

Parameter(s)

None

Response

Content-Type

application/json

Success

{
"code":0,
"desc" :"charge success!",
"loginname":{vgp_id},
"item":{item_id},
}
NoVariableTypeNote
1vgp_idlong (bigint)VGP Identification
2item_idStringItem ID which user paid for

Failure

{
"code": 1,
"desc" :{description}
}

in which

NoVariableTypeNote
1descriptionStringFailure description

Check partner token API

Purpose:

Check info from partner token

Input

Type: GET Parameters:

  • ptoken: partner token from client
  • t : timestamp (unix time)
  • c : check sum. Md5(t+ptoken)

Response:

{"code": {code}, "message": {message}, "loginname" : {loginname}, "golden": {golden}}

In which:

  • code: 200 if valid token. Other if wrong
  • message: Message from partner. Maybe error message
  • loginname: VGP ID made this purchase
  • golden: Package id of purchase