2026-09-09 12:00:13 +08:00
|
|
|
export type InitOptions = {
|
|
|
|
|
appId: string,
|
2026-09-11 13:58:55 +08:00
|
|
|
// Host's registered scheme; iOS converts it to <scheme>://dypay for the SDK.
|
2026-09-09 12:00:13 +08:00
|
|
|
callbackScheme: string,
|
|
|
|
|
universalLink?: string | null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// All fields must come from the authenticated server prepay response.
|
|
|
|
|
export type PayInfo = {
|
|
|
|
|
appid: string,
|
|
|
|
|
partnerid: string,
|
|
|
|
|
prepayid: string,
|
|
|
|
|
package: string,
|
|
|
|
|
noncestr: string,
|
|
|
|
|
timestamp: string,
|
|
|
|
|
sign: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type PayOptions = {
|
|
|
|
|
payInfo: PayInfo,
|
|
|
|
|
showLoading?: boolean | null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Code 0 is only an SDK hint, never proof that the order was paid.
|
|
|
|
|
export type PayResult = {
|
|
|
|
|
resultCode: string,
|
|
|
|
|
errorMsg: string,
|
|
|
|
|
needsQuery: boolean
|
|
|
|
|
}
|
|
|
|
|
export type PayCallback = (result: PayResult) => void
|