import { UniPaymentProvider, RequestPaymentOptions, RequestPayment, RequestPaymentSuccessCallback } from "../interface.uts"; import { RequestPaymentFailImpl } from '../unierror.uts' export const requestPayment : RequestPayment = function (options : RequestPaymentOptions) { //获取provider实例,hx自动生成,其中UniPaymentProvider为在interface中定义的接口 const provider = UTSAndroid.getExtApiProvider("payment", options.provider) if (provider != null) { provider.requestPayment(options) } else { let err = new RequestPaymentFailImpl(700000); options.fail?.(err) options.complete?.(err) } };