首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在为Paypal FlatRateShippingOptions指定CallbackURL时无法识别SetExpressCheckout

在为Paypal FlatRateShippingOptions指定CallbackURL时无法识别SetExpressCheckout
EN

Stack Overflow用户
提问于 2013-09-17 02:02:46
回答 1查看 662关注 0票数 1

我正在使用PayPal快捷签出SOAP。我有一个SetExpressCheckoutRequest,它可以工作,直到我添加CallbackURL元素。然后,它给出了以下错误:

失败ShortMessage:没有统一费率的运输选项。LongMessage:缺少统一费率传送选项;当您指定回调URL时,必须指定统一费率传送选项。ErrorCode: 11825

代码语言:javascript
复制
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>

Soap的各种SDK似乎不包括这些元素。在进行了大量搜索之后,我还没有找到一个包含此选项的工作SetExpressCheckoutRequest示例。我尝试过许多不同的方法,但似乎没有什么效果。

有人有使用此选项的示例SOAP请求吗?

谢谢,CJ

以下是完整的XML请求文件。它不需要CallbackURL行和FlatRateShippingOptions部分。我尝试过使用和不使用ShippingOptions元素,因为文档对于是否需要它似乎不一致。

代码语言:javascript
复制
<?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>

我终于让它开始工作了。我不得不将FlatRateShippingOptions部分移到PaymentDetails部分下面。以下是完整的工作XML请求:

代码语言:javascript
复制
<?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>

谢谢你帮忙解决这个问题!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-09-17 03:08:45

这是一个包含回调的工作样品 of SetExpressCheckout,但是它使用的是NVP而不是SOAP。

如果您想发布整个XML请求的示例,我将看看是否能够重现问题并解决问题。

我认为您的问题是,您已经将FlatRateShippingOptions作为PaymentDetails中的子元素。从SEC的PayPal SOAP文档来看,FlatRateShippingOptions应该在与CallbackURL相同的水平上。

尝试将它移出PaymentDetails,看看这是否有帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18840166

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档