createSign static method
Generates a signed transaction string in Base64 format.
Implementation
static Future<String> createSign({
required String payeeUpiId,
required String payeeName,
required double amount,
String? transactionId,
String? transactionNote,
String? merchantCode,
String? link,
required String secretKey,
}) async {
try {
return await _channel.invokeMethod<String>('createSign', {
'payeeUpiId': payeeUpiId,
'payeeName': payeeName,
'amount': amount.toStringAsFixed(2), // Ensures proper decimal format
if (transactionId != null) 'transactionId': transactionId,
if (transactionNote != null) 'transactionNote': transactionNote,
if (merchantCode != null) 'merchantCode': merchantCode,
if (link != null) 'link': link,
'secretKey': secretKey,
}) ??
'';
} on PlatformException catch (e) {
debugPrint("Error generating signature: ${e.message}");
return '';
}
}