createInvoice method

Future<DecryptedInvoice> createInvoice(
  1. String sdkId,
  2. DecryptedInvoice entity,
  3. String? prefix
)

Implementation

Future<DecryptedInvoice> createInvoice(String sdkId, DecryptedInvoice entity, String? prefix) async {
	final res = await _methodChannel.invokeMethod<String>(
		'InvoiceApi.createInvoice',
		{
			"sdkId": sdkId,
			"entity": jsonEncode(DecryptedInvoice.encode(entity)),
			"prefix": jsonEncode(prefix),
		}
	);
	if (res == null) throw AssertionError("received null result from platform method createInvoice");
	final parsedResJson = jsonDecode(res);
	return DecryptedInvoice.fromJSON(parsedResJson);
}