[关闭]
@JackieQu 2018-08-11T15:03:55.000000Z 字数 3832 阅读 382

游戏区域解锁购买

儿童编程


解锁游戏区域生成订单

Method and Url Structure

Method Resource URL
POST /program_face2face/market/product/game_region/${pk}/

cURL Example

  1. curl -X POST -H 'Authorization: Token tester001' -d data{...}
  2. https://app.bcjiaoyu.com/program_face2face/market/product/game_region/6/

JSON Response

  1. {
  2. "amount": "0.00",
  3. "final_amount": "40.00",
  4. "channel": "product",
  5. "order_number": "17003299904677935262497468",
  6. "channel_display": "product",
  7. "status": 0,
  8. "create_time": "2018-08-06T16:47:13.335328",
  9. "status_display": "待付款",
  10. "bought_product_set": [
  11. {
  12. "product": null,
  13. "game_region": 6,
  14. "quantity": 1,
  15. "amount": "4000.00"
  16. }
  17. ],
  18. "product_type": "game",
  19. "product_type_display": "游戏"
  20. }
  21. # 或账户中红钻足够解锁时,生成订单为已付款状态,不用调支付接口
  22. {
  23. "amount": "4000.00",
  24. "final_amount": "0.00",
  25. "channel": "recharge",
  26. "order_number": "17003299907538005262497468",
  27. "channel_display": "recharge",
  28. "status": 1,
  29. "create_time": "2018-08-06T16:50:16.736250",
  30. "status_display": "已付款",
  31. "bought_product_set": [
  32. {
  33. "product": null,
  34. "game_region": 6,
  35. "quantity": 1,
  36. "amount": "4000.00"
  37. }
  38. ],
  39. "product_type": "game",
  40. "product_type_display": "游戏"
  41. }
  42. # 或
  43. {
  44. "status": -4,
  45. "message": "该游戏区域免费,无需解锁"
  46. }

订单支付

Method and Url Structure

Method Resource URL
PUT /program_face2face/market/order/payment/${order_number}/

Request and Parameters

Name Description Required Default
order_number 订单号 YES
channel 支付方式 NO alipay
success_url 成功支付地址 NO
cancel_url 取消支付地址 NO

Request

  1. {
  2. "channel": "wx",
  3. }
  4. {
  5. "channel": "alipay_wap",
  6. // alipay_wap 两个都写,alipay_pc_direct 只传成功的
  7. "success_url" : "xxx.xxx.xxx",
  8. "cancel_url" : "xxx.xxx.xxx",
  9. }
  10. 支付宝: alipay
  11. 微信: wx
  12. 支付宝web: alipay_pc_direct
  13. 支付宝wap: alipay_wap
  14. 微信扫码: wx_pub_qr
  15. 微信公众号: wx_pub

cURL Example

  1. curl -X PUT -H 'Authorization: Token tester001' -d data{...}
  2. https://app.bcjiaoyu.com/program_face2face/market/order/payment/17003299909996905262497468/

JSON Response

  1. {
  2. "status": 0,
  3. "message": "",
  4. "charge": {
  5. "order_no": "17003299909996905262497468",
  6. "extra": {},
  7. "app": "app_HOafLKjbnLm1jXrP",
  8. "livemode": true,
  9. "currency": "cny",
  10. "time_settle": null,
  11. "time_expire": 1533632256,
  12. "id": "ch_S4CKC8aTiznHXnnbPSfrvb1C",
  13. "subject": "儿童编程#1700329990999690526249",
  14. "failure_msg": null,
  15. "channel": "alipay",
  16. "metadata": {
  17. "owner": "tester001",
  18. "order_type": "ProductOrder",
  19. "order_no": "17003299909996905262497468"
  20. },
  21. "body": "儿童编程#17003299909996905262497468",
  22. "credential": {
  23. "alipay": {
  24. "orderInfo": "service=\"mobile.securitypay.pay\"&_input_charset=\"utf-8\"&notify_url=\"https%3A%2F%2Fnotify.pingxx.com%2Fnotify%2Fcharges%2Fch_S4CKC8aTiznHXnnbPSfrvb1C\"&partner=\"2088821771831750\"&out_trade_no=\"17003299909996905262497468\"&subject=\"儿童编程#1700329990999690526249\"&body=\"儿童编程#17003299909996905262497468 ch_S4CKC8aTiznHXnnbPSfrvb1C\"&total_fee=\"40.00\"&payment_type=\"1\"&seller_id=\"2088821771831750\"&it_b_pay=\"2018-08-07 16:57:36\"&sign=\"Kkd1z93n7Xdnuq2l3cdkLZzy5iiKwsIAc9i%2F7o8esKu6u%2B%2BfGpCfGjq3h74pS%2BI6gY9k5uQH1U67VXoiscidTbnr2KS1EPSWNrhl%2FCQNutLO7aXDUWKOEwP4oOe6GSJTVufkGU4rk82XknYwoKqTZ4xiX5cwVOLuKx5ORumhJzI%3D\"&sign_type=\"RSA\""
  25. },
  26. "object": "credential"
  27. },
  28. "client_ip": "127.0.0.1",
  29. "description": null,
  30. "amount_refunded": 0,
  31. "refunded": false,
  32. "reversed": false,
  33. "object": "charge",
  34. "paid": false,
  35. "amount_settle": 4000,
  36. "time_paid": null,
  37. "failure_code": null,
  38. "refunds": {
  39. "url": "/v1/charges/ch_S4CKC8aTiznHXnnbPSfrvb1C/refunds",
  40. "has_more": false,
  41. "object": "list",
  42. "data": []
  43. },
  44. "created": 1533545856,
  45. "transaction_no": null,
  46. "amount": 4000
  47. }
  48. }

直接购买红钻

Method and Url Structure

Method Resource URL
POST program_face2face/market/product/diamond/

cURL Example

  1. curl -X GET -H 'Authorization: Token tester001' -d data{...}
  2. https://app.bcjiaoyu.com/program_face2face/market/product/diamond/?number=1000

Request and Parameters

Name Description Required Default
number 红钻数 YES

Request

  1. ?number=1000

JSON Response

  1. {
  2. "amount": "0.00",
  3. "final_amount": "10.00",
  4. "channel": "alipay",
  5. "order_number": "17003299903291845262497468",
  6. "channel_display": "支付宝",
  7. "status": 0,
  8. "create_time": "2018-08-06T17:16:56.873658",
  9. "status_display": "待付款",
  10. "bought_product_set": [
  11. {
  12. "product": null,
  13. "game_region": null,
  14. "quantity": 1,
  15. "amount": "1000.00"
  16. }
  17. ],
  18. "product_type": "course",
  19. "product_type_display": "课程"
  20. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注