createHexPacketFromData method
Implementation
@override
Future<Cryptogram?> createHexPacketFromData(String cardNumber, String cardDate, String cardCVC, String publicId, String apiUrl) async {
try {
final api = Api(apiUrl);
final publicKey = await api.publicKey();
final dynamic arguments = await methodChannel.invokeMethod<dynamic>('createHexPacketFromData',
{
'cardNumber': cardNumber,
'cardDate': cardDate,
'cardCVC': cardCVC,
'publicId': publicId,
'publicKey': publicKey.key,
'keyVersion': publicKey.version
});
return Cryptogram(arguments['cryptogram'], arguments['error']);
} catch (e) {
print("Create cryptogram error");
}
}