getUpiAppSchema static method

String getUpiAppSchema(
  1. String? paymentApp
)

Returns the UPI app scheme based on the provided payment app name.

This method takes a paymentApp name as input and maps it to the corresponding UPI app scheme. The scheme is used to initiate a UPI payment transaction on iOS. If the paymentApp is not recognized, an empty string is returned.

Supported UPI apps and their schemes:

  • "Amazon Pay" : "amazonToAlipay://pay"
  • "BhimUpi" : "BHIM://pay"
  • "Google Pay" : "tez://upi/pay"
  • "Paytm" : "paytm://pay"
  • "PhonePe" : "phonepe://pay"

Parameters:

  • paymentApp: The name of the UPI payment app.

Returns: A String representing the UPI app scheme.

Implementation

static String getUpiAppSchema(String? paymentApp) {
  String scheme = "";
  switch (paymentApp) {
    case "Amazon Pay":
      scheme = "amazonToAlipay://pay";
      break;
    case "BhimUpi":
      scheme = "BHIM://pay";
      break;
    case "Google Pay":
      scheme = "tez://upi/pay";
      break;
    case "Paytm":
      scheme = "paytm://pay";
      break;
    case "PhonePe":
      scheme = "phonepe://pay";
      break;
  }
  return scheme;
}