# 支付系统

# 一、介绍

可用于支付游戏币、获取余额等。

TIP

支付系统目前只支持微信、手 Q 平台的 Android 环境。

# 二、使用

# 导入支付系统

import { paymentSystem } from '@timi/mogs-sdk';
1

# 查询余额

const res = await paymentSystem.getBalance();
console.log(
  res.balance,
  res.giftedBalance,
  res.totalAmount,
  res.totalGiftedAmount,
  res.totalConsumedAmount,
  res.totalChargedAmount,
  res.isFirstRechargeAvailable
);
1
2
3
4
5
6
7
8
9
10

# 支付游戏币

const res = await paymentSystem.pay({
  billNo: 'SOME_UNIQUE_BILL_NO',
  payItem: 'SOME_ITEM_INFO',
  amount: 123,
});
console.log(res.billNo, res.balance, res.consumedGiftedAmount);
1
2
3
4
5
6

TIP

更多支付系统的 API 请参考 支付系统