App购买物品

流程

创建一个订单

URL: /formetas/thirdRecharge/createThirdOrder

Type: POST

Content-Type: application/json; charset=utf-8

Description: 创建一个订单

Body-parameters:

Parameter

Type

Description

Required

Since

thirdId

int64

用户id

true

-

goodId

int32

物品id 原样返回

true

-

gameId

int32

gameId

true

-

rechargeAmount

number

No comments found.

true

-no

notify_url

string

通知地址

page_url

string

前端通知地址

extra

string

原样返回内容

Request-example:

 curl -X POST -H 'Content-Type: application/json; charset=utf-8' -i http://47.100.198.111/formetas/thirdRecharge/createThirdOrder --data '{
   "thirdId": 640,
   "goodId": 929,
   "gameId": 935,
   "rechargeAmount": 373
 }'

Response-fields:

Field

Type

Description

Since

status

int32

返回码 1 表示成功

-

msg

string

返回信息 错误时必给错误信息

-

data

int64

返回值 (ActualType: Long)

-

Response-example:

 {
   "status": 1,
   "msg": "server error",
   "data": 235
 }

跳转支付页面

使用webview或浏览器跳转到页面: https://指定环境+'/#/pages/pay/detail?id=' + orderId

支付成功后参数说明

pageUrl: 跳转到app的地址,schemeUrl,可空(创建订单时提交)

notifyUrl: 服务端通知地址,支付成功后调用可空(创建订单时提交)

param: 回调参数(需要进行RSA加密,同登录)

// Some code
{
  "gameId": 22,
  "rechargeAmount": 3.44,
  "orderId": 1738513709476610049,  //订单号
  "extra": "extra",                 //extra 原样返回    
  "goodId": 1,                     //物品id
  "userId": 167123123123,         //用户id
  "status": 1                    //1 支付成功,成功才会调用
}

查询一个订单号状态

URL:/formetas/thirdRecharge/queryMyOrder

Type: POST

Content-Type: application/json; charset=utf-8

Description: 查询一个订单号状态

Body-parameters:

Parameter

Type

Description

Required

Since

id

int64

No comments found.

false

-

Request-example:

 curl -X POST -H 'Content-Type: application/json; charset=utf-8' -i http://47.100.198.111/formetas/thirdRecharge/queryMyOrder --data '{
   "id": 692
 }'

Response-fields:

Field

Type

Description

Since

status

int32

返回码 1 表示成功

-

msg

string

返回信息 错误时必给错误信息

-

data

object

返回值 (ActualType: ThirdOrderVo)

-

└─orderId

int64

订单号

-

└─userId

int64

用户id等同于thirdId

-

└─gameId

int32

游戏id

-

└─goodId

int32

物品id,游戏端给出,原样返回

-

└─rechargeAmount

number

充值金额 美金

-

└─status

int32

状态 0支付中 -1 关闭支付 1 成功

-

└─createTime

string

创建时间

-

Response-example:

 {
   "status": 1,
   "msg": "server error",
   "data": {
     "orderId": 697,
     "userId": 824,
     "gameId": 588,
     "goodId": 5,
     "rechargeAmount": 324,
     "status": 383,
     "createTime": "2023-11-13 16:43:27"
   }
 }

Last updated