getPrepay(data: GetPrepayParams)
Requires:
@tuya-miniapp/cloud-api≥1.6.1
Additional notesRead the full notes
This API depends on cloud capabilities. Configure authorization in Development Settings - Cloud Capabilities on the Mini App Developer Platform. orderId comes from the return value of createOrderV2; paymentProvider and paymentType come from paidProviderName and paidTypeName in the paidConfigList returned by getSkuPayment. Populate commodityRelateContactInfos as needed based on the fulfillment target: for home-level fulfillment, set code: '3' (content includes home info: groupId, groupName); for device-level fulfillment, set code: '4' (content includes device info: devId, deviceName, uuid). clientInfo is optional and should be provided as required by the payment channel: when paymentProvider is apple_iap_pay, set packageName; when an alternativePay token exists, set googleIapReportToken (Google IAP reporting).
Description
Initiate order prepayment and obtain payment page information (e.g., cashier redirect URL).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Yes | Request parameters |
Return Value
Type: Promise<GetPrepayResult>
Prepayment information, including order ID, payment URL, and prepayment order ID
Referenced Types
interface
GetPrepayResultPreorder (initiate payment) result| Property | Type | Description |
|---|---|---|
orderId | string | Order number |
paymentUrl | string | Payment URL used to redirect to the payment page |
preFlowCode | string | Prepayment order number |
| Extended information |
enum
VasPaymentOS| Value | Actual Value | Description |
|---|---|---|
VasPaymentOS.ANDROID | 1 | Android |
VasPaymentOS.IOS | 2 | iOS |
Valid Values
VasPaymentOS
| Value | Description | Since |
|---|---|---|
1 | Android | - |
2 | iOS | - |