transaction method
Future<Transaction?>
transaction({
- required double value,
- required TypeTransactionEnum typeTransaction,
- int installment = 1,
- bool? printReceipt,
- ValueChanged<
String> ? onPixQrCode,
override
Transaction
Implementation
@override
Future<Transaction?> transaction({
required double value,
required TypeTransactionEnum typeTransaction,
int installment = 1,
bool? printReceipt,
ValueChanged<String>? onPixQrCode,
}) async {
try {
if (_paymentInProgress) {
return null;
}
_paymentInProgress = true;
_currentOnPixQrCode = onPixQrCode;
final result = await methodChannel.invokeMethod<String>(
'transaction',
<String, dynamic>{
'value': value,
'typeTransaction': typeTransaction.value,
'installment': installment,
'printReceipt': printReceipt,
},
);
if (result == null) {
return null;
}
_paymentInProgress = false;
return Transaction.fromJson(result);
} catch (e) {
_paymentInProgress = false;
rethrow;
}
}