上次更新时间:2026年10月22日
In-App Purchases
Process one-time payments and display balance pages for in-app purchases.
TTMinis.pay(callback, options)
Initiates a payment using an order.
Parameters
Field | Type | Description | Required |
|
| The order ID. | Yes |
|
| Additional analytics fields. | No |
Callback parameters
Field | Type | Description |
|
| Whether the payment succeeded. |
|
| The order ID. |
|
| Returned on failure. |
Example
TTMinis.pay(
function (res) {
if (res.error) {
console.error('pay failed', res.error);
return;
}
console.log('pay success:', res.trade_order_id);
},
{
trade_order_id: 'order_123456',
},
);TTMinis.openBalance(callback, options)
Opens the balance page.
Parameters
Field | Type | Description | Required |
|
| The balance type. | Yes |
Callback parameters
Field | Type | Description |
|
| Whether the balance page was opened successfully. |
|
| Returned on failure. |
Example
TTMinis.openBalance(
function (res) {
console.log('openBalance result:', res);
},
{
type: 'BEANS',
},
);