buildQrcode static method

Future<String> buildQrcode(
  1. int amount,
  2. Currency currency,
  3. String description
)

Implementation

static Future<String> buildQrcode(
    int amount, Currency currency, String description) async {
  String response = "";
  String currencyCode = PayOneDataHelper.getCurrencyCode(currency);
  var stringParams = <String, dynamic>{
    'amount': amount.toString(),
    'currency': currencyCode,
    'invoiceid': 'comet' + DateTime.now().microsecondsSinceEpoch.toString(),
    'description': description
  };

  try {
    final result = await _channel.invokeMethod('buildqrcode', stringParams);
    response = result.toString();
    return response;
  } on PlatformException catch (e) {
    return "Failed to Invoke: '${e.message}'.";
  }
}