payment method
Triggers a sale / purchase. The terminal prompts for a card and this call resolves once the card flow is complete.
amount is in major units (e.g. 1.50 for € 1,50). A transactionId is
generated automatically when omitted; it is returned on the response so
you can store it for a later void or status query.
Implementation
Future<TransactionResponse> payment({
required num amount,
num? tip,
String? forceTip,
String? reference,
String? transactionId,
String? currency,
String? language,
}) {
final body = _txBody(
amount: amount,
tip: tip,
forceTip: forceTip,
reference: reference,
transactionId: transactionId ?? _newTransactionId(),
currency: currency,
language: language,
transactionType: HpsTransactionType.sale.code,
);
return _sendTransaction('POST', 'api/transaction/payment', body);
}