fix: 接入抖音原生支付并修复App支付服务缺失
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { InitOptions, PayOptions, PayCallback } from '../interface.uts'
|
||||
import { configure, invoke } from '../common.uts'
|
||||
|
||||
export function initDypay(options: InitOptions): boolean {
|
||||
if (!configure(options.appId)) return false
|
||||
TbDouyinPayNative.initialize(options.appId)
|
||||
return true
|
||||
}
|
||||
|
||||
export function canOpenDypay(): boolean {
|
||||
return TbDouyinPayNative.available()
|
||||
}
|
||||
|
||||
export function openDypay(options: PayOptions, callback: PayCallback): void {
|
||||
invoke(options, callback, (payload: string, loading: boolean, done: (raw: string) => void) => {
|
||||
TbDouyinPayNative.pay(payload, loading, done)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user