VGP Payment flow
Flow

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
| No | Parameter | Type | Note | Required |
|---|---|---|---|---|
| 1 | event | String | Fixed String onPayment | x |
| 2 | orderid | String | VGP transaction id which must be unique. | x |
| 3 | loginname | long (bigint) | VGP Identification | x |
| 4 | golden | String | Item ID which user paid for. Game server only accepts specified item list which will be sent privately | x |
| 5 | serverid | String | server_id which called by game client | |
| 6 | characterid | String | character_id which called by game client | |
| 7 | ptoken | String | partnertoken which called by game client. Accepted length: 0- 50 | |
| 8 | tstamp | long | unix timestamp at paid time | x |
| 9 | ticket | String | Verified code which is calculated as below | x |
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},
}
| No | Variable | Type | Note |
|---|---|---|---|
| 1 | vgp_id | long (bigint) | VGP Identification |
| 2 | item_id | String | Item ID which user paid for |
Failure
{
"code": 1,
"desc" :{description}
}
in which
| No | Variable | Type | Note |
|---|---|---|---|
| 1 | description | String | Failure 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