FlatRateShippingOptions not recognized when specifying CallbackURL for Paypal SetExpressCheckout

StackOverflow https://stackoverflow.com/questions/18840166

Вопрос

I'm using the PayPal Express Checkout SOAP API. I have a SetExpressCheckoutRequest that works until I add the CallbackURL element. It then gives me the following error:

Ack: Failure ShortMessage: Flat-rate shipping options are missing. LongMessage: Flat-rate shipping options are missing; you must specify flat-rate shipping options when you specify a callback URL. ErrorCode: 11825

My request includes the following elements (child elements of <ebl:PaymentDetails>):

<ebl:FlatRateShippingOptions>
  <ebl:ShippingOptionIsDefault>true</ebl:ShippingOptionIsDefault>
  <ebl:ShippingOptionAmount currencyID=""USD"">4.00</ebl:ShippingOptionAmount>
  <ebl:ShippingOptionName>Ground</ebl:ShippingOptionName>
</ebl:FlatRateShippingOptions>

The various SDKs for Soap don't seem to include these elements. After a great deal of searching, I have not been able to find an example of a working SetExpressCheckoutRequest that includes this option. I have tried many variations but nothing seems to work.

Does anyone have a sample SOAP API request that works with this option?

Thanks, CJ

Here is the complete XML request file. It works without the CallbackURL line and the FlatRateShippingOptions section. I've tried it with and without the ShippingOptions element since the documentation seems inconsistent as to whether or not it is required.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:ebay:api:PayPalAPI" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:ed="urn:ebay:apis:EnhancedDataTypes">
<soapenv:Header>
  <ns:RequesterCredentials>
    <ebl:Credentials>
      <ebl:Username>sdk-three_api1.sdk.com</ebl:Username>
      <ebl:Password>QFZCWN5HZM8VBG7Q</ebl:Password>
      <ebl:Signature>A-IzJhZZjhg29XQ2qnhapuwxIDzyAZQ92FRP5dqBzVesOkzbdUONzmOU</ebl:Signature>
    </ebl:Credentials>
  </ns:RequesterCredentials>
</soapenv:Header>
<soapenv:Body>
  <ns:SetExpressCheckoutReq>
    <ns:SetExpressCheckoutRequest>
      <ebl:Version>106.0</ebl:Version>
      <ebl:SetExpressCheckoutRequestDetails>
        <ebl:MaxAmount currencyID="USD">20.00</ebl:MaxAmount>
        <ebl:ReturnURL>https://www.domain.com/final.asp</ebl:ReturnURL>
        <ebl:CancelURL>https://www.domain.com/reviewcart.asp</ebl:CancelURL>
        <ebl:NoShipping>2</ebl:NoShipping>
        <ebl:AddressOverride>1</ebl:AddressOverride>
        <ebl:LocaleCode>US</ebl:LocaleCode>
        <ebl:SolutionType>Sole</ebl:SolutionType>
        <ebl:BuyerEmail>platfo_1255077030_biz@gmail.com</ebl:BuyerEmail>
        <ebl:CallbackURL>https://www.domain.com/paypalcallback.asp</ebl:CallbackURL>
        <ebl:PaymentDetails>
          <ebl:FlatRateShippingOptions>
            <ebl:ShippingOptions>
              <ebl:ShippingOptionIsDefault>true</ebl:ShippingOptionIsDefault>
              <ebl:ShippingOptionAmount currencyID="USD">4.00</ebl:ShippingOptionAmount>
              <ebl:ShippingOptionName>Ground</ebl:ShippingOptionName>
            </ebl:ShippingOptions>
            <ebl:ShippingOptions>
              <ebl:ShippingOptionIsDefault>false</ebl:ShippingOptionIsDefault>
              <ebl:ShippingOptionAmount currencyID="USD">20.00</ebl:ShippingOptionAmount>
              <ebl:ShippingOptionName>NextDayAir</ebl:ShippingOptionName>
            </ebl:ShippingOptions>
          </ebl:FlatRateShippingOptions>
          <ebl:OrderTotal currencyID="USD">20.00</ebl:OrderTotal>
          <ebl:ItemTotal currencyID="USD">16.00</ebl:ItemTotal>
          <ebl:ShippingTotal currencyID="USD">4.00</ebl:ShippingTotal>
          <ebl:HandlingTotal currencyID="USD">0.00</ebl:HandlingTotal>
          <ebl:TaxTotal currencyID="USD">0.00</ebl:TaxTotal>
          <ebl:OrderDescription>Cart ID 123456</ebl:OrderDescription>
          <ebl:ShipToAddress>
            <ebl:Name>John Doe</ebl:Name>
            <ebl:Street1>123 Main St</ebl:Street1>
            <ebl:Street2>Apt 2</ebl:Street2>
            <ebl:CityName>Chicago</ebl:CityName>
            <ebl:StateOrProvince>IL</ebl:StateOrProvince>
            <ebl:Country>US</ebl:Country>
            <ebl:Phone>312-555-1234</ebl:Phone>
            <ebl:PostalCode>60610</ebl:PostalCode>
          </ebl:ShipToAddress>
          <ebl:PaymentDetailsItem>
            <ebl:Name>3001</ebl:Name>
            <ebl:Quantity>2</ebl:Quantity>
            <ebl:Tax currencyID="USD">0.00</ebl:Tax>
            <ebl:Amount currencyID="USD">6.00</ebl:Amount>
            <ebl:Description>test order</ebl:Description>
            <ebl:ItemCategory>Physical</ebl:ItemCategory>
          </ebl:PaymentDetailsItem>
          <ebl:PaymentDetailsItem>
            <ebl:Name>3002</ebl:Name>
            <ebl:Quantity>4</ebl:Quantity>
            <ebl:Tax currencyID="USD">0.00</ebl:Tax>
            <ebl:Amount currencyID="USD">1.00</ebl:Amount>
            <ebl:Description>test order</ebl:Description>
            <ebl:ItemCategory>Physical</ebl:ItemCategory>
          </ebl:PaymentDetailsItem>
          <ebl:PaymentAction>Sale</ebl:PaymentAction>
        </ebl:PaymentDetails>
        <ebl:ChannelType>Merchant</ebl:ChannelType>
        <ebl:CustomerServiceNumber>3125559876</ebl:CustomerServiceNumber>
        <ebl:BuyerEmailOptinEnable>1</ebl:BuyerEmailOptinEnable>
        <ebl:TotalType>EstimatedTotal</ebl:TotalType>
        <ebl:NoteToBuyer>Sample note to buyer.</ebl:NoteToBuyer>
        <ebl:PaymentReason>None</ebl:PaymentReason>
        <ebl:BuyerEmailOptinEnable xmlns="">1</ebl:BuyerEmailOptinEnable>
      </ebl:SetExpressCheckoutRequestDetails>
    </ns:SetExpressCheckoutRequest>
  </ns:SetExpressCheckoutReq>
</soapenv:Body>
</soapenv:Envelope>

I finally got it to work. I had to move the FlatRateShippingOptions section below the PaymentDetails section. Here is the complete working XML request:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:ebay:api:PayPalAPI" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:ed="urn:ebay:apis:EnhancedDataTypes">
<soapenv:Header>
  <ns:RequesterCredentials>
    <ebl:Credentials>
      <ebl:Username>sdk-three_api1.sdk.com</ebl:Username>
      <ebl:Password>QFZCWN5HZM8VBG7Q</ebl:Password>
      <ebl:Signature>A-IzJhZZjhg29XQ2qnhapuwxIDzyAZQ92FRP5dqBzVesOkzbdUONzmOU</ebl:Signature>
    </ebl:Credentials>
  </ns:RequesterCredentials>
</soapenv:Header>
<soapenv:Body>
  <ns:SetExpressCheckoutReq>
    <ns:SetExpressCheckoutRequest>
      <ebl:Version>106.0</ebl:Version>
      <ebl:SetExpressCheckoutRequestDetails>
        <ebl:MaxAmount currencyID="USD">20.00</ebl:MaxAmount>
        <ebl:ReturnURL>https://www.domain.com/final.asp</ebl:ReturnURL>
        <ebl:CancelURL>https://www.domain.com/reviewcart.asp</ebl:CancelURL>
        <ebl:NoShipping>2</ebl:NoShipping>
        <ebl:AddressOverride>1</ebl:AddressOverride>
        <ebl:LocaleCode>US</ebl:LocaleCode>
        <ebl:SolutionType>Sole</ebl:SolutionType>
        <ebl:BuyerEmail>platfo_1255077030_biz@gmail.com</ebl:BuyerEmail>
        <ebl:CallbackURL>https://www.domain.com/paypalcallback.asp</ebl:CallbackURL>
        <ebl:PaymentDetails>
          <ebl:OrderTotal currencyID="USD">20.00</ebl:OrderTotal>
          <ebl:ItemTotal currencyID="USD">16.00</ebl:ItemTotal>
          <ebl:ShippingTotal currencyID="USD">4.00</ebl:ShippingTotal>
          <ebl:HandlingTotal currencyID="USD">0.00</ebl:HandlingTotal>
          <ebl:TaxTotal currencyID="USD">0.00</ebl:TaxTotal>
          <ebl:OrderDescription>Cart ID 123456</ebl:OrderDescription>
          <ebl:ShipToAddress>
            <ebl:Name>John Doe</ebl:Name>
            <ebl:Street1>123 Main St</ebl:Street1>
            <ebl:Street2>Apt 2</ebl:Street2>
            <ebl:CityName>Chicago</ebl:CityName>
            <ebl:StateOrProvince>IL</ebl:StateOrProvince>
            <ebl:Country>US</ebl:Country>
            <ebl:Phone>312-555-1234</ebl:Phone>
            <ebl:PostalCode>60610</ebl:PostalCode>
          </ebl:ShipToAddress>
          <ebl:PaymentDetailsItem>
            <ebl:Name>3001</ebl:Name>
            <ebl:Quantity>2</ebl:Quantity>
            <ebl:Tax currencyID="USD">0.00</ebl:Tax>
            <ebl:Amount currencyID="USD">6.00</ebl:Amount>
            <ebl:Description>test order</ebl:Description>
            <ebl:ItemCategory>Physical</ebl:ItemCategory>
          </ebl:PaymentDetailsItem>
          <ebl:PaymentDetailsItem>
            <ebl:Name>3002</ebl:Name>
            <ebl:Quantity>4</ebl:Quantity>
            <ebl:Tax currencyID="USD">0.00</ebl:Tax>
            <ebl:Amount currencyID="USD">1.00</ebl:Amount>
            <ebl:Description>test order</ebl:Description>
            <ebl:ItemCategory>Physical</ebl:ItemCategory>
          </ebl:PaymentDetailsItem>
          <ebl:PaymentAction>Sale</ebl:PaymentAction>
        </ebl:PaymentDetails>
        <ebl:FlatRateShippingOptions>
          <ebl:ShippingOptionIsDefault>true</ebl:ShippingOptionIsDefault>
          <ebl:ShippingOptionAmount currencyID="USD">4.00</ebl:ShippingOptionAmount>
          <ebl:ShippingOptionName>Ground</ebl:ShippingOptionName>
        </ebl:FlatRateShippingOptions>
        <ebl:FlatRateShippingOptions>
          <ebl:ShippingOptionIsDefault>false</ebl:ShippingOptionIsDefault>
          <ebl:ShippingOptionAmount currencyID="USD">20.00</ebl:ShippingOptionAmount>
          <ebl:ShippingOptionName>NextDayAir</ebl:ShippingOptionName>
        </ebl:FlatRateShippingOptions>
        <ebl:CallbackTimeout>6</ebl:CallbackTimeout>
        <ebl:ChannelType>Merchant</ebl:ChannelType>
        <ebl:CustomerServiceNumber>3125559876</ebl:CustomerServiceNumber>
        <ebl:BuyerEmailOptinEnable>1</ebl:BuyerEmailOptinEnable>
        <ebl:TotalType>EstimatedTotal</ebl:TotalType>
        <ebl:NoteToBuyer>Sample note to buyer.</ebl:NoteToBuyer>
        <ebl:PaymentReason>None</ebl:PaymentReason>
        <ebl:BuyerEmailOptinEnable xmlns="">1</ebl:BuyerEmailOptinEnable>
      </ebl:SetExpressCheckoutRequestDetails>
    </ns:SetExpressCheckoutRequest>
 </ns:SetExpressCheckoutReq>
</soapenv:Body>
</soapenv:Envelope>

Thanks for your help in resolving this!

Это было полезно?

Решение

Here's a working sample of SetExpressCheckout with callback included, but it's using NVP instead of SOAP.

If you want to post a sample of your entire XML request I'll see if I can reproduce the issue and figure out the problem.

I think your problem is that you've got the FlatRateShippingOptions as a child element within PaymentDetails. Looking at the PayPal SOAP documentation for SEC, it looks like FlatRateShippingOptions should be above that, on the same level as CallbackURL.

Try moving it out of PaymentDetails and see if that helps.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top