paymentInvokeBuilder<T> method

FutureOr<T> paymentInvokeBuilder<T>({
  1. required GeneralPaymentAuth generalPaymentAuth,
  2. required InvokeFunctionBuilder<T> onXendit,
  3. required InvokeFunctionBuilder<T> onMidtrans,
  4. required InvokeFunctionBuilder<T> onCoinlox,
  5. required InvokeFunctionBuilder<T> onUnknown,
})

Implementation

FutureOr<T> paymentInvokeBuilder<T>({
  required GeneralPaymentAuth generalPaymentAuth,
  required InvokeFunctionBuilder<T> onXendit,
  required InvokeFunctionBuilder<T> onMidtrans,
  required InvokeFunctionBuilder<T> onCoinlox,
  required InvokeFunctionBuilder<T> onUnknown,
}) async {
  switch (generalPaymentAuth.generalPaymentType) {
    case GeneralPaymentType.xendit:
      return await onXendit(generalPaymentAuth);
    case GeneralPaymentType.midtrans:
      return await onMidtrans(generalPaymentAuth);
    case GeneralPaymentType.coinlox:
      return await onCoinlox(generalPaymentAuth);
    default:
      return await onUnknown(generalPaymentAuth);
  }
}