Method: payment-integrator-authenticated-card-fop-api.cancelMandate

Stay organized with collections Save and categorize content based on your preferences.

Initiates cancelling the mandate that was created for recurring payment.

This cancels the existing mandate on the user's account. The mandateId identifies which mandate is being cancelled. It was generated by the vendor while creating the mandate.

If the mandate has expired or is already cancelled, consider it a successful cancellation rather than an error. Therefore, return a success response code.

The requestId within the header is the idempotency key and uniquely identifies this transaction.

If the endpoint encounters an error while processing the request, the response body from this endpoint should be of type ErrorResponse.

An example request looks like:


{
  "requestHeader": {
    "protocolVersion": {
      "major": 1
    },
    "requestId": "cmVxdWVzdDE",
    "requestTimestamp": {
      "epochMillis": "1481899949606"
    },
    "paymentIntegratorAccountId": "SpeedyPaymentsIndia_INR"
  },
  "mandateId": "MA061B00045154",
  "customerReferenceId": "customer57",
  "recurringPaymentReferenceId": "subscription201"
}

An example response looks like:


{
  "responseHeader": {
    "responseTimestamp": {
      "epochMillis": "1481899949611"
    }
  },
  "result": {
    "success": {}
  }
}

HTTP request

POST https://www.integratorhost.example.com/v1/payment-integrator-authenticated-card-fop-api/cancelMandate

Request body

The request body contains data with the following structure:

JSON representation
{
  "requestHeader": {
    object (RequestHeader)
  },
  "mandateId": string,
  "customerReferenceId": string,
  "recurringPaymentReferenceId": string
}
Fields
requestHeader

object (RequestHeader)

REQUIRED: Common header for all requests.

mandateId

string

REQUIRED: The payment integrator generated ID that represents the mandate for this recurring payment. This is returned in the capture call when the recurring payment is first set up.

customerReferenceId

string

REQUIRED: The Google generated customer reference ID that is associated with the mandate for this recurring payment. It is the same ID that is provided when the mandate creation is requested and is unique to that mandate.

recurringPaymentReferenceId

string

REQUIRED: The Google generated recurring payment ID. It is the same ID that is provided when the mandate creation is requested and is unique to that mandate.

Response body

This method supports multiple return types. For additional information about what 4XX or 5XX HTTP status code to return with an ErrorResponse, consult the ErrorResponse object and HTTP status codes documentation.

Possible response messages
HTTP 200 Status

object (CancelMandateResponse)

HTTP 4XX / 5XX Status

object (ErrorResponse)

CancelMandateResponse

Response object for the cancel mandate method.

JSON representation
{
  "responseHeader": {
    object (ResponseHeader)
  },
  "result": {
    object (CancelMandateResult)
  }
}
Fields
responseHeader

object (ResponseHeader)

REQUIRED: Common header for all responses.

result

object (CancelMandateResult)

REQUIRED: Result of this mandate cancellation.

CancelMandateResult

Result codes for cancel mandate.

JSON representation
{
  "success": {
    object (Empty)
  }
}
Fields
success

object (Empty)

The mandate was successfully cancelled.

ErrorResponse

Error Response object for all methods.

JSON representation
{
  "responseHeader": {
    object (ResponseHeader)
  },
  "errorDescription": string,
  "paymentIntegratorErrorIdentifier": string,
  "errorResponseResult": {
    object (ErrorResponseResult)
  }
}
Fields
responseHeader

object (ResponseHeader)

REQUIRED: Common header for all responses.

errorDescription

string

OPTIONAL: Provide a description of this status for support reps to debug errors. Note that this is never shown to users. It can contain descriptive, non-sensitive text used for debugging. Note that some values for errorResponseCode should be accompanied by additional detail in this field. Warning: Do not include any tokens in this message unless they are defined as public.

paymentIntegratorErrorIdentifier

string

OPTIONAL: This identifier is specific to the integrator and is generated by the integrator. It is used for debugging purposes only in order to identify this call. This is the identifier that the integrator knows this call by.

errorResponseResult

object (ErrorResponseResult)

OPTIONAL: A code that captures the type of error that occurred.

ErrorResponseResult

Error Codes

JSON representation
{

  // Union field result can be only one of the following:
  "invalidApiVersion": {
    object (InvalidApiVersion)
  },
  "invalidPayloadSignature": {
    object (InvalidPayloadSignature)
  },
  "invalidPayloadEncryption": {
    object (InvalidPayloadEncryption)
  },
  "requestTimestampOutOfRange": {
    object (RequestTimestampOutOfRange)
  },
  "invalidIdentifier": {
    object (InvalidIdentifier)
  },
  "idempotencyViolation": {
    object (IdempotencyViolation)
  },
  "invalidFieldValue": {
    object (InvalidFieldValue)
  },
  "missingRequiredField": {
    object (MissingRequiredField)
  },
  "preconditionViolation": {
    object (PreconditionViolation)
  },
  "userActionInProgress": {
    object (UserActionInProgress)
  },
  "invalidDecryptedRequest": {
    object (InvalidDecryptedRequest)
  },
  "forbidden": {
    object (Forbidden)
  }
  // End of list of possible types for union field result.
}
Fields

Union field result.

result can be only one of the following:

invalidApiVersion

object (InvalidApiVersion)

Used if the request's API version is unsupported. Advised HTTP Code: 400

invalidPayloadSignature

object (InvalidPayloadSignature)

Used if the signature of the payload is to an unknown or inactive key. Advised HTTP Code: 401

invalidPayloadEncryption

object (InvalidPayloadEncryption)

Used if the encryption of the payload is to an unknown or inactive key. Advised HTTP Code: 400

requestTimestampOutOfRange

object (RequestTimestampOutOfRange)

Used if the requestTimestamp is not ± 60s of now. Advised HTTP Code: 400

invalidIdentifier

object (InvalidIdentifier)

Used if an identifier sent in the request was invalid or unknown. This may include PIAID, captureRequestId, Google Payment Token, etc. Advised HTTP Code: 404

idempotencyViolation

object (IdempotencyViolation)

Used if the request violates the idempotency requirements for the request. Advised HTTP Code: 412

invalidFieldValue

object (InvalidFieldValue)

Used if the request contains a value for a field that isn't in the set of supported values. Advised HTTP Code: 400

missingRequiredField

object (MissingRequiredField)

Used if a field that is required is unset in the request. Advised HTTP Code: 400

preconditionViolation

object (PreconditionViolation)

Used if a constraint on the operation is violated (e.g. when a request for a refund amount exceeds the amount remaining on the transaction). Advised HTTP Code: 400

userActionInProgress

object (UserActionInProgress)

Used if the request cannot be processed at this time because it would interrupt an in-process user action which effectively acts as a system lock. This code must not be used to indicate failures due to implementation-specific internal concurrency errors. Advised HTTP Code: 423

invalidDecryptedRequest

object (InvalidDecryptedRequest)

Used if the request payload could be decrypted, but the resulting message could not be parsed. Advised HTTP Code: 400

forbidden

object (Forbidden)

Access to the requested resource is forbidden. Advised Http Code: 403

InvalidApiVersion

JSON representation
{
  "requestVersion": {
    object (Version)
  },
  "expectedVersion": {
    object (Version)
  }
}
Fields
requestVersion

object (Version)

REQUIRED: The invalid version that was specified on the request.

expectedVersion

object (Version)

REQUIRED: The expected version.

InvalidPayloadSignature

This message is intentionally empty right now. New fields could be added in the future.

InvalidPayloadEncryption

This message is intentionally empty right now. New fields could be added in the future.

RequestTimestampOutOfRange

JSON representation
{
  "requestTimestamp": {
    object (Timestamp)
  },
  "serverTimestampAtReceipt": {
    object (Timestamp)
  }
}
Fields
requestTimestamp

object (Timestamp)

REQUIRED: The timestamp provided in the request

serverTimestampAtReceipt

object (Timestamp)

REQUIRED: The server time at receipt, used for comparison

InvalidIdentifier

JSON representation
{
  "invalidIdentifierType": string
}
Fields
invalidIdentifierType

string

REQUIRED: The type of identifier that was invalid, e.g. PIAID, captureRequestId, etc.

IdempotencyViolation

This message is intentionally empty right now. New fields could be added in the future.

InvalidFieldValue

JSON representation
{
  "invalidFieldName": string
}
Fields
invalidFieldName

string

REQUIRED: The name of the field that was found to be invalid.

MissingRequiredField

JSON representation
{
  "missingFieldNames": [
    string
  ]
}
Fields
missingFieldNames[]

string

REQUIRED: The names of the missing fields.

PreconditionViolation

This message is intentionally empty right now. New fields could be added in the future.

UserActionInProgress

This message is intentionally empty right now. New fields could be added in the future.

InvalidDecryptedRequest

This message is intentionally empty right now. New fields could be added in the future.

Forbidden

This message is intentionally empty right now. New fields could be added in the future.