A OrderCreateRequest has elements under Payments, one of which can be a PayPal element. Only a few elements map directly from PaypalDoAuthorizationReply to OrderCreateRequest, but a successful reply from authorization is required first before including a PayPal payment in the OrderCreateRequest.

Mapping

The PayPalDoAuthorizationReply field mappings start at : /PayPalDoAuthorizationReply
The OrderCreateRequest field mappings start at: /OrderCreateRequest/Payment/Payments/PayPal

PayPalDoAuthorizationReply Field OrderCreateRequest Field Transform Comment

//OrderId

//PaymentContext/PaymentSessionId

copy as is

//PaymentContext/TenderType

constant: PY

//PaymentContext/PaymentAccountUniqueId

constant: PAYPAL

//PaymentContext/PaymentAccountUniqueId/@isToken

constant: true

//ResponseCode

//Authorization/ResponseCode

if Success, constant: APPROVED

If PayPal authorization did not return a ResponseCode of Success then order creation shouldn’t be attempted with that payment.

Mapping Example

<?xml version="1.0" encoding="UTF-8"?>
<PayPalDoAuthorizationReply
    xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
  <OrderId>123456</OrderId> <!-- MAP1 --> 
  <ResponseCode>Success</ResponseCode> <!-- MAP2 --> 
  <AuthorizationInfo/>
</PayPalDoAuthorizationReply>
<OrderCreateRequest
    xmlns="http://api.gsicommerce.com/schema/checkout/1.0"
    requestId="123456789">
  <Order customerOrderId="12345">
    ...
    <Payment>
      ...
      <Payments>
        <PayPal>
          <Amount>12.34</Amount>
          <AmountAuthorized>12.34</AmountAuthorized>
          <PaymentContext>
            <PaymentSessionId>123456</PaymentSessionId> <!-- MAP1 --> 
            <TenderType>PY</TenderType>
            <PaymentAccountUniqueId 
                isToken="true">PAYPAL</PaymentAccountUniqueId>
          </PaymentContext>
          <CreateTimeStamp>2016-02-01T04:58:34</CreateTimeStamp>
          <PaymentRequestId>123456abcdef</PaymentRequestId>
          <Authorization>
            <ResponseCode>APPROVED</ResponseCode> <!-- MAP2 --> 
          </Authorization>
        </PayPal>
      </Payments>
    </Payment>
    ...
  </Order>
  ...
</OrderCreateRequest>