encryptAndSetReceiptAttachment method

Future<EncryptedReceipt> encryptAndSetReceiptAttachment(
  1. String sdkId,
  2. Receipt receipt,
  3. String blobType,
  4. Uint8List attachment,
)

Implementation

Future<EncryptedReceipt> encryptAndSetReceiptAttachment(String sdkId, Receipt receipt, String blobType, Uint8List attachment) async {
	final res = await _methodChannel.invokeMethod<String>(
		'ReceiptApi.encryptAndSetReceiptAttachment',
		{
			"sdkId": sdkId,
			"receipt": jsonEncode(Receipt.encode(receipt)),
			"blobType": jsonEncode(blobType),
			"attachment": jsonEncode(base64Encode(attachment as List<int>)),
		}
	);
	if (res == null) throw AssertionError("received null result from platform method encryptAndSetReceiptAttachment");
	final parsedResJson = jsonDecode(res);
	return EncryptedReceipt.fromJSON(parsedResJson);
}