cancelAgreementPaymentRequest method

Future<CancelAgreementPaymentRequestOutput> cancelAgreementPaymentRequest({
  1. required String agreementId,
  2. required String paymentRequestId,
})

Allows sellers (proposers) to cancel a payment request that is in PENDING_APPROVAL status. Once cancelled, the payment request transitions to CANCELLED status and can no longer be accepted or rejected by the buyer.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter agreementId : The unique identifier of the agreement associated with the payment request.

Parameter paymentRequestId : The unique identifier of the payment request to cancel.

Implementation

Future<CancelAgreementPaymentRequestOutput> cancelAgreementPaymentRequest({
  required String agreementId,
  required String paymentRequestId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target':
        'AWSMPCommerceService_v20200301.CancelAgreementPaymentRequest'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'agreementId': agreementId,
      'paymentRequestId': paymentRequestId,
    },
  );

  return CancelAgreementPaymentRequestOutput.fromJson(jsonResponse.body);
}