Radial Integration | 2016

Retail Order Management > Order Processing > Order Management API Tutorial > How to Build an Order Create API Request > CreditCardAuthReply → OrderCreateRequest

CreditCardAuthReply → OrderCreateRequest

An OrderCreateRequest has elements under Payments, one of which can be a CreditCard. Several fields in the CreditCard are supplied from the CreditCardAuthReply from an earlier corresponding CreditCardAuthRequest.

Mapping

The CreditCardAuthReply field mappings start at: /CreditCardAuthReply
The OrderCreateRequest field mappings start at: /OrderCreateRequest/Payment/Payments/CreditCard

CreditCardAuthReply Field OrderCreateRequest Field Transform Comment

//PaymentContext/OrderId

//PaymentContext/PaymentSessionId

copy as is

//PaymentContext/PaymentAccountUniqueId

//PaymentContext/PaymentAccountUniqueId

copy as is

//AuthorizationResponseCode

//Authorization/ResponseCode

See response code transformation.

//BankAuthorizationCode

//Authorization/BankAuthorizationCode

copy as is

//CVV2ResponseCode

//Authorization/CVV2ResponseCode

copy as is

//AVSResponseCode

//Authorization/AVSResponseCode

copy as is

//PhoneResponseCode

//Authorization/PhoneResponseCode

copy as is

Required for Amex.

//NameResponseCode

//Authorization/NameResponseCode

copy as is

Required for Amex.

//EmailResponseCode

//Authorization/EmailResponseCode

copy as is

Required for Amex.

//AmountAuthorized

//Authorization/AmountAuthorized

copy as is

Mapping Example

<?xml version="1.0" encoding="UTF-8"?>
<CreditCardAuthReply
    xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
  <PaymentContext>
    <OrderId>12345</OrderId> (1)
    <PaymentAccountUniqueId isToken="true">123abc</PaymentAccountUniqueId> (2)
  </PaymentContext>
  <AuthorizationResponseCode>AP01</AuthorizationResponseCode> (3)
  <BankAuthorizationCode>123456</BankAuthorizationCode> (4)
  <CVV2ResponseCode>M</CVV2ResponseCode> (5)
  <AVSResponseCode>AM</AVSResponseCode> (6)
  <PhoneResponseCode>U</PhoneResponseCode> (7)
  <NameResponseCode>Y</NameResponseCode> (8)
  <EmailResponseCode>N</EmailResponseCode> (9)
  <AmountAuthorized currencyCode="USD">12.34</AmountAuthorized> (10)
</CreditCardAuthReply>
<OrderCreateRequest
    xmlns="http://api.gsicommerce.com/schema/checkout/1.0"
    requestId="123456789">
  <Order customerOrderId="12345">
    ...
    <Payment>
      ...
      <Payments>
        <CreditCard>
          <PaymentContext>
            <PaymentSessionId>12345</PaymentSessionId> (1)
            <TenderType>AM</TenderType>
            <PaymentAccountUniqueId isToken="true">123abc</PaymentAccountUniqueId> (2)
          </PaymentContext>
          <PaymentRequestId>456xyz</PaymentRequestId>
          <CreateTimeStamp>2016-02-12T23:08:20+00:00</CreateTimeStamp>
          <Amount>12.34</Amount>
          <Authorization>
            <ResponseCode>APPROVED</ResponseCode> (3)
            <BankAuthorizationCode>123456</BankAuthorizationCode> (4)
            <CVV2ResponseCode>M</CVV2ResponseCode> (5)
            <AVSResponseCode>AM</AVSResponseCode> (6)
            <PhoneResponseCode>U</PhoneResponseCode> (7)
            <NameResponseCode>Y</NameResponseCode> (8)
            <EmailResponseCode>N</EmailResponseCode> (9)
            <AmountAuthorized>12.34</AmountAuthorized> (10)
          </Authorization>
          <ExpirationDate>2020-01</ExpirationDate>
        </CreditCard>
      </Payments>
    </Payment>
    ...
  </Order>
  ...
</OrderCreateRequest>

Transforms

Response Code Transform

The response code at //Authorization/ResponseCode in the CreditCardAuthReply can have many values. The relevant mapping are below (lowercase x’s mean any character):

CreditCardAuthReply OrderCreateRequest Comment

AP01

APPROVED

AP01 is the only code that means the payment was approved.

NDxx, NCxx, NRxx, NSxx

-

Any response starting with ND, NC, NR, or NS means the card was declined. As such an OrderCreateRequest shouldn’t even be made with such a payment method.

TO01

PaymentProcessorTimeout

 

Copyright © 2017 Radial. All rights reserved.