Radial Integration | 2016

Payments, Tax & Fraud > Asynchronous API Operations > Payment Authorization Cancel

Payment Authorization Cancel

Overview

A PaymentAuthCancelRequest message should be sent to cancel an authorization if an order is canceled. This removes any holds or pending charges on the customer's account.

An alternate request format, PaymentSettlementRequestList, groups several events together in a single message, and is intended for clients using the Webhooks Implementation for Asynchronous Messages. If you are using the Webhooks implemention, see Payment Authorization Cancel List Event, below.

 

URI Summary

Action URI Template URI Example Non-URI Request Response
POST /v[M.m]/stores/[StoreID]/
payments/auth/cancel/[TenderType].[format]
/v1.0/stores/ABCXYZ/
payments/auth/cancel/VC.xml
XML 200 + XML response

Request Examples

The request is a PaymentAuthCancelRequest message.

With a Payment Account Number

<?xml version="1.0" encoding="UTF-8"?>
<PaymentAuthCancelRequest requestId="123" xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
   <PaymentContext>
      <OrderId>12345</OrderId>
      <PaymentAccountUniqueId isToken="true">4111110PASeK1111</PaymentAccountUniqueId>
   </PaymentContext>
   <Amount currencyCode="USD">100.00</Amount>
</PaymentAuthCancelRequest>

Without a Payment Account Number (For Example, PayPal)

<?xml version="1.0" encoding="UTF-8"?>
<PaymentAuthCancelRequest requestId="123" xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
   <PaymentContextBase>
      <OrderId>12345</OrderId>
   </PaymentContextBase>
   <Amount currencyCode="USD">100.00</Amount>
</PaymentAuthCancelRequest>

Request Elements

Element Required Description Type Restriction
PaymentAuthCancelRequest/
@requestId
Yes Attribute that provides a unique ID for this request String Max 40 characters
PaymentContext Choice of PaymentContext (when a PaymentAccountUniqueId value is available) or PaymentContextBase (when a PaymentAccountUniqueId value is not available) Sequence of OrderId, PaymentAccountUniqueId ComplexType  
PaymentContext/
OrderId
Yes (when PaymentContext is present) Order ID String Max 20 characters
PaymentContext/
PaymentAccountUniqueId
Yes (when PaymentContext is present) Tokenized payment account number (for example, a credit card number) String Max 22 characters
PaymentContext/
PaymentAccountUniqueId/
@isToken
Yes (when PaymentContext is present) Attribute that indicates whether the payment account number is tokenized String true
PaymentContextBase Choice of PaymentContext (when a PaymentAccountUniqueId value is available) or PaymentContextBase (when a PaymentAccountUniqueId value is not available) Sequence of OrderId ComplexType  
PaymentContextBase/
OrderId
Yes (when PaymentContextBase is present) Order ID String Max 20 characters
Amount Yes Amount authorized on the credit card String

Positive decimal, up to two decimal places (for example, 4.75)

Amount/
@currencyCode
Yes Attribute that indicates the type of currency used for the order String 3-character ISO 4217 code (for example, USD, CAD, EUR). See http://en.wikipedia.org/
wiki/ISO_4217.

HTTP Reply

<?xml version="1.0" encoding="UTF-8"?>
<AckReply xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
   <Received/>
</AckReply>

Queue Format

q.Payments.AuthCancels.Status.<RABBIT_MQ_USERNAME>

Response Example

The response is a PaymentAuthCancelReply message.

With a Payment Account Number)

<?xml version="1.0" encoding="UTF-8"?>
<PaymentAuthCancelReply xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
   <PaymentContext>
      <OrderId>12345</OrderId>
      <PaymentAccountUniqueId isToken="true">4111110PASeK1111</PaymentAccountUniqueId>
   </PaymentContext>
   <TenderType>VC</TenderType>
   <ResponseCode>Success</ResponseCode>
   <Amount currencyCode="USD">1.00</Amount>
   <ExtendedResponseCode/>
   <StoreId>ABCXYZ</StoreId>
</PaymentAuthCancelReply>

Without a Payment Account Number

<?xml version="1.0" encoding="UTF-8"?>
<PaymentAuthCancelReply xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
   <PaymentContextBase>
      <OrderId>12345</OrderId>
   </PaymentContextBase>
   <TenderType>PY</TenderType>
   <ResponseCode>Success</ResponseCode>
   <Amount currencyCode="USD">100.00</Amount>
   <ExtendedResponseCode/>
   <StoreId>ABCXYZ</StoreId>
</PaymentAuthCancelReply>

Response Elements

Element Required Description Type Restriction
PaymentContext Choice of PaymentContext or PaymentContextBase. The same element that was used in the request is returned in the reply.      
PaymentContext/
OrderId
Yes (when PaymentContext is present) Order ID String Max 20 characters
PaymentContext/
PaymentAccountUniqueId
Yes (when PaymentContext is present) Tokenized payment account number (for example, credit card number) String Max 22 characters
PaymentContext/
PaymentAccountUniqueId/
@isToken
Yes (when PaymentContext is present) Attribute that indicates whether the payment account number is tokenized String true
PaymentContextBase Choice of PaymentContextBase or PaymentContext. The same element that was used in the request is returned in the reply.      

PaymentContextBase/
OrderId

Yes (when PaymentContextBase is present) Order ID String Max 20 characters
TenderType Yes Tender type identifier String 2 to 4 characters
ResponseCode Yes Authorization cancel response code String Success
Fail
Timeout
Amount Yes Amount authorized on the credit card String

Positive decimal, up to two decimal places (for example, 4.75)

Amount/
@currencyCode
Yes Attribute that indicates the type of currency used for the order String 3-character ISO 4217 code (for example, USD, CAD, EUR). See http://en.wikipedia.org/
wiki/ISO_4217.
ExtendedResponseCode Yes Additional response code details for failures String
StoreId Yes Store identifier String Max 100 characters

Payment Authorization Cancel List Event

The xml response (mentioned below) contains a list of PaymentAuthCancelReply messages all clubbed under one parent element and is available only for clients using webhook. This message cannot be obtained from a queue in RabbitMQ and hence the queue format is not applicable here. In case you want to sign up for these events please contact customer service.

However individual PaymentAuthCancelReply message continues to live on RabbitMQ server and can be accessed using the information provided above.

Response Example

The response is a list of PaymentAuthCancelReply messages. Instead of returning single PaymentAuthCancelReply message, a list/batch of messsages are getting returned.

With a Payment Account Number

<?xml version="1.0" encoding="UTF-8"?>
<PaymentAuthCancelReplyList xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
    <PaymentAuthCancelReply>
       <PaymentContext>
          <OrderId>12345</OrderId>
          <PaymentAccountUniqueId isToken="true">4111110PASeK1111</PaymentAccountUniqueId>
       </PaymentContext>
       <TenderType>VC</TenderType>
       <ResponseCode>Success</ResponseCode>
       <Amount currencyCode="USD">1.00</Amount>
       <ExtendedResponseCode/>
       <StoreId>ABCXYZ</StoreId>
    </PaymentAuthCancelReply>
    <PaymentAuthCancelReply>
       <PaymentContext>
          <OrderId>12890</OrderId>
          <PaymentAccountUniqueId isToken="true">4222220PASeK2222</PaymentAccountUniqueId>
       </PaymentContext>
       <TenderType>VC</TenderType>
       <ResponseCode>Success</ResponseCode>
       <Amount currencyCode="USD">25.00</Amount>
       <ExtendedResponseCode/>
       <StoreId>ABC</StoreId>
    </PaymentAuthCancelReply>
</PaymentAuthCancelReplyList>

Without a Payment Account Number

<?xml version="1.0" encoding="UTF-8"?>
<PaymentAuthCancelReplyList xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
    <PaymentAuthCancelReply>
       <PaymentContextBase>
          <OrderId>12345</OrderId>
       </PaymentContextBase>
       <TenderType>PY</TenderType>
       <ResponseCode>Success</ResponseCode>
       <Amount currencyCode="USD">100.00</Amount>
       <ExtendedResponseCode/>
       <StoreId>ABCXYZ</StoreId>
    </PaymentAuthCancelReply>
    <PaymentAuthCancelReply>
       <PaymentContextBase>
          <OrderId>906735</OrderId>
       </PaymentContextBase>
       <TenderType>PY</TenderType>
       <ResponseCode>Success</ResponseCode>
       <Amount currencyCode="USD">200.00</Amount>
       <ExtendedResponseCode/>
       <StoreId>ABC</StoreId>
    </PaymentAuthCancelReply>
</PaymentAuthCancelReplyList>

Response Elements

Element Required Description Type Restriction
PaymentAuthCancelReplyList A wrapper/parent object for all the PaymentAuthCancelReply elements Sequence of PaymentAuthCancelReply elements ComplexType  
PaymentAuthCancelReply A wrapper/parent object for all the sub-elements such as PaymentContextBase, TenderType, ResponseCode, Amount, ExtendedResponseCode, StoreId etc. Sequence of PaymentContextBase, TenderType, ResponseCode, Amount, ExtendedResponseCode, StoreId ComplexType  
PaymentContext Choice of PaymentContext or PaymentContextBase. The same element that was used in the request is returned in the reply.      
PaymentContext/
OrderId
Yes (when PaymentContext is present) Order ID String Max 20 characters
PaymentContext/
PaymentAccountUniqueId
Yes (when PaymentContext is present) Tokenized payment account number (for example, credit card number) String Max 22 characters
PaymentContext/
PaymentAccountUniqueId/
@isToken
Yes (when PaymentContext is present) Attribute that indicates whether the payment account number is tokenized String true
PaymentContextBase Choice of PaymentContextBase or PaymentContext. The same element that was used in the request is returned in the reply.      

PaymentContextBase/
OrderId

Yes (when PaymentContextBase is present) Order ID String Max 20 characters
TenderType Yes Tender type identifier String 2 to 4 characters
ResponseCode Yes Authorization cancel response code String Success
Fail
Timeout
Amount Yes Amount authorized on the credit card String

Positive decimal, up to two decimal places (for example, 4.75)

Amount/
@currencyCode
Yes Attribute that indicates the type of currency used for the order String 3-character ISO 4217 code (for example, USD, CAD, EUR). See http://en.wikipedia.org/
wiki/ISO_4217.
ExtendedResponseCode Yes Additional response code details for failures String
StoreId Yes Store identifier String Max 100 characters

 

Copyright © 2017 Radial. All rights reserved.