- HTTP request
- Request body
- Response body
- CancelMandateResponse
- CancelMandateResult
- ErrorResponse
- ErrorResponseResult
- InvalidApiVersion
- InvalidPayloadSignature
- InvalidPayloadEncryption
- RequestTimestampOutOfRange
- InvalidIdentifier
- IdempotencyViolation
- InvalidFieldValue
- MissingRequiredField
- PreconditionViolation
- UserActionInProgress
- InvalidDecryptedRequest
- Forbidden
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 ( |
Fields | |
---|---|
requestHeader |
REQUIRED: Common header for all requests. |
mandateId |
REQUIRED: The payment integrator generated ID that represents the mandate for this recurring payment. This is returned in the |
customerReferenceId |
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 |
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 |
|
HTTP 4XX / 5XX Status |
|
CancelMandateResponse
Response object for the cancel mandate method.
JSON representation |
---|
{ "responseHeader": { object ( |
Fields | |
---|---|
responseHeader |
REQUIRED: Common header for all responses. |
result |
REQUIRED: Result of this mandate cancellation. |
CancelMandateResult
Result codes for cancel mandate.
JSON representation |
---|
{
"success": {
object ( |
Fields | |
---|---|
success |
The mandate was successfully cancelled. |
ErrorResponse
Error Response object for all methods.
JSON representation |
---|
{ "responseHeader": { object ( |
Fields | |
---|---|
responseHeader |
REQUIRED: Common header for all responses. |
errorDescription |
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 |
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 |
OPTIONAL: A code that captures the type of error that occurred. |
ErrorResponseResult
Error Codes
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field
|
|
invalidApiVersion |
Used if the request's API version is unsupported. Advised HTTP Code: 400 |
invalidPayloadSignature |
Used if the signature of the payload is to an unknown or inactive key. Advised HTTP Code: 401 |
invalidPayloadEncryption |
Used if the encryption of the payload is to an unknown or inactive key. Advised HTTP Code: 400 |
requestTimestampOutOfRange |
Used if the requestTimestamp is not ± 60s of now. Advised HTTP Code: 400 |
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 |
Used if the request violates the idempotency requirements for the request. Advised HTTP Code: 412 |
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 |
Used if a field that is required is unset in the request. Advised HTTP Code: 400 |
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 |
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 |
Used if the request payload could be decrypted, but the resulting message could not be parsed. Advised HTTP Code: 400 |
forbidden |
Access to the requested resource is forbidden. Advised Http Code: 403 |
InvalidApiVersion
JSON representation |
---|
{ "requestVersion": { object ( |
Fields | |
---|---|
requestVersion |
REQUIRED: The invalid version that was specified on the request. |
expectedVersion |
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 ( |
Fields | |
---|---|
requestTimestamp |
REQUIRED: The timestamp provided in the request |
serverTimestampAtReceipt |
REQUIRED: The server time at receipt, used for comparison |
InvalidIdentifier
JSON representation |
---|
{ "invalidIdentifierType": string } |
Fields | |
---|---|
invalidIdentifierType |
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 |
REQUIRED: The name of the field that was found to be invalid. |
MissingRequiredField
JSON representation |
---|
{ "missingFieldNames": [ string ] } |
Fields | |
---|---|
missingFieldNames[] |
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.