decline method
Declines a payment request.
Declines an existing payment request by invoking the 'm10.Request'
action with a DECLINED
status.
Parameters:
operator
(required): The platform operator (e.g. "m10").fromAccountId
(required): The ID of the from account of the request.targetAccountId
(required): The ID of the target account of the request.contextId
(required): The context ID of the original payment request.
Returns:
- A
TransactionResponseDoc
object representing the decline transaction.
Throws:
- An Exception if payment request decline fails.
Implementation
Future<TransactionResponseDoc> decline({
required String operator,
required String fromAccountId,
required String targetAccountId,
required String contextId,
}) async =>
invokeAction(
operator: operator,
name: requestActionName,
fromAccountId: fromAccountId,
targetAccountId: targetAccountId,
payload: (PaymentRequest()
..status = PaymentRequest_PaymentRequestStatus.DECLINED)
.writeToBuffer(),
contextId: contextId,
);