makeQRPayment static method

Future<CcppPaymentResponse> makeQRPayment(
  1. ChannelQRCode channelCode,
  2. String paymentToken,
  3. String? name,
  4. String? mobileNumber,
  5. String? email,
  6. QRType qrCodeType,
)

Implementation

static Future<CcppPaymentResponse> makeQRPayment(ChannelQRCode channelCode, String paymentToken, String? name, String? mobileNumber, String? email, QRType qrCodeType) async {
  var req = MakeQRPaymentInput();
  req.channelCode = FlutterCcpp.makeChannelQRCode(channelCode);
  req.paymentToken = paymentToken;
  req.name = name;
  req.mobileNumber = mobileNumber;
  req.email = email;
  if (QRType.base64 == qrCodeType) {
    req.qrCodeType = "base64";
  } else if (QRType.raw == qrCodeType) {
    req.qrCodeType = "raw";
  } else if (QRType.url == qrCodeType) {
    req.qrCodeType = "url";
  }
  var resp = await _api.makeQRPayment(req);
  if (resp.error != null) {
    throw Exception(resp.error);
  }
  return resp;
}