Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

微信小游戏支付接入

接入文档v2

相关接口

getBalance

pay_v2.getBalance

  • signature = hmac_sha256( rawData + session_key )
POST https://api.weixin.qq.com/wxa/game/getbalance?access_token=ACCESS_TOKEN&signature=SIGNATURE&sig_method=SIG_METHOD&pay_sig=PAY_SIGNATURE
  • 请求demo
curl -d '{
  "offer_id": "12345678",
  "openid": "oUrsfxxxxxxxxxx",
  "ts": 1668512428,
  "zone_id": "1",
  "env": 0,
  "bill_no": "test_pay_1668512428",
  "amount": 1,
  "payitem": "钻石",
  "remark": "测试"
}' \
  -H "Content-Type: application/json" \
  -X POST \
  'https://api.weixin.qq.com/wxa/game/pay?access_token=62_so84Zyl5MuPCjXGiR3eb1ysa1lr6aRpcprEnNpZ9ds8676ivjqRn5Zroi2Rxxx9-Yvh2zIl9oEt1hIzK0x2OrMCT5zk8nB_TG98obD_ad3tFPftfFmB7xXtcZv4PVPcbFATZT&signature=f6a57637cea4f81eb3f64d4123ce07ae692e6c34225350ccb8d7c315d58bda34&pay_sig=6ea7866f25d94a0578656b1f889ae1fa35076ab61c18ce34c18f48b56d60de4d&sig_method=hmac_sha256'

pay_v2.pay

pay_v2.cancelPay