
import {UPPayment,UPPayResult,UPPayResultCallback} from 'uppayment'
import common from '@ohos.app.ability.common'
class PaymentManager {
  upPayment: UPPayment;
  constructor() {
    this.upPayment = new UPPayment();
  }
  startPay(tn: string, mode: string, scheme: string,seType?: string): void {
    let context = getContext() as common.UIAbilityContext;
    // “00” – 银联正式环境
    // “01” – 银联测试环境，该环境中不发生真实交易
    this.upPayment.startPay(tn,mode,'uppaymerchantdemo',context,'');
  }

  handlePaymentResult(uri: string,callback:UPPayResultCallback) {
    this.upPayment.handlePaymentResult(uri,callback);
  }

}


export default new PaymentManager();