gpt4 book ai didi

soap - 为 Paypal SetExpressCheckout 指定 CallbackURL 时无法识别 FlatRateShippingOptions

转载 作者:太空宇宙 更新时间:2023-11-03 16:02:43 26 4
gpt4 key购买 nike

我正在使用 PayPal Express Checkout SOAP API。我有一个 SetExpressCheckoutRequest,在我添加 CallbackURL 元素之前一直有效。然后它给我以下错误:

确认:失败ShortMessage:缺少统一运费选项。LongMessage:缺少统一运费选项;您必须在指定回调 URL 时指定统一运费选项。错误代码: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>

Soap 的各种 SDK 似乎不包含这些元素。经过大量搜索,我无法找到包含此选项的有效 SetExpressCheckoutRequest 示例。我尝试了很多变体,但似乎没有任何效果。

有没有人有适用于此选项的示例 SOAP API 请求?

谢谢,希杰

这是完整的 XML 请求文件。它在没有 CallbackURL 行和 FlatRateShippingOptions 部分的情况下工作。我已经尝试过使用和不使用 ShippingOptions 元素,因为文档在是否需要它方面似乎不一致。

<?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 请求:

<?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>

感谢您帮助解决这个问题!

最佳答案

这是一个 working sample包含回调的 SetExpressCheckout,但它使用 NVP 而不是 SOAP。

如果您想发布整个 XML 请求的示例,我会看看是否可以重现问题并找出问题所在。

我认为您的问题是您将 FlatRateShippingOptions 作为 PaymentDetails 中的子元素。查看 SEC 的 PayPal SOAP 文档,看起来 FlatRateShippingOptions 应该高于该文档,与 CallbackURL 处于同一级别。

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

关于soap - 为 Paypal SetExpressCheckout 指定 CallbackURL 时无法识别 FlatRateShippingOptions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18840166/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com