import { UniPaymentProvider, RequestPayment, RequestPaymentOptions} from "../interface.uts"; import { RequestPaymentFailImpl } from '../unierror.uts'; import { UTSiOS } from "DCloudUTSFoundation"; export const requestPayment : RequestPayment = function (options : RequestPaymentOptions) { const provider = UTSiOS.getExtApiProvider<UniPaymentProvider>("payment", options.provider) if(provider != null){ provider!.requestPayment(options) } else {
const err = new RequestPaymentFailImpl(700716);
options.fail?.(err) options.complete?.(err) } };