用PayPal签出重置连接
问题描述:
我有一个使用PayPal结帐的Web应用程序。它几天前运作良好。现在,我尝试做结账和贝宝重置连接。我正在使用沙盒帐户,将请求发送至https://api.sandbox.paypal.com/2.0/。我有来自Paypal的有效证书。我的XML请求是:用PayPal签出重置连接
<?xml version="1.0" encoding="utf-8"?>
<xsi:SetExpressCheckoutReq xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetExpressCheckoutRequest xmlns="urn:ebay:api:PayPalAPI">
<ErrorLanguage xmlns="urn:ebay:apis:eBLBaseComponents">en_US</ErrorLanguage>
<Version xmlns="urn:ebay:apis:eBLBaseComponents">98.0</Version>
<SetExpressCheckoutRequestDetails xmlns="urn:ebay:apis:eBLBaseComponents">
<OrderTotal currencyID="USD" />
<ReturnURL>https://[my url site]?ppec=return</ReturnURL>
<CancelURL>https://[my url site]/checkout.aspx?ppec=cancel</CancelURL>
<Custom>100232</Custom>
<cpp-header-image>https://[my url site]/themes/default/images/layout/invoice_logo.gif</cpp-header-image>
<PaymentAction>Sale</PaymentAction>
<BuyerEmail>[email protected]</BuyerEmail>
<ChannelType>Merchant</ChannelType>
<PaymentDetails>
<OrderTotal currencyID="USD">280.51</OrderTotal>
<ItemTotal currencyID="USD">270.00</ItemTotal>
<ShippingTotal currencyID="USD">10.51</ShippingTotal>
<HandlingTotal currencyID="USD">0.00</HandlingTotal>
<TaxTotal currencyID="USD">0.00</TaxTotal>
<InvoiceID>100232</InvoiceID>
<ShipToAddress>
<Name>NAME SURNAME</Name>
<Street1>717 Some st</Street1>
<Street2 />
<CityName>City</CityName>
<StateOrProvince>ST</StateOrProvince>
<Country>US</Country>
<Phone>+15551234567</Phone>
<PostalCode>00000</PostalCode>
</ShipToAddress>
<PaymentDetailsItem>
<Name>Triángulo Isósceles</Name>
<Number>4444</Number>
<Quantity>1</Quantity>
<Amount currencyID="USD">300.00</Amount>
</PaymentDetailsItem>
<PaymentDetailsItem>
<Name>Discounts</Name>
<Quantity>1</Quantity>
<Amount currencyID="USD">-30.00</Amount>
</PaymentDetailsItem>
</PaymentDetails>
</SetExpressCheckoutRequestDetails>
</SetExpressCheckoutRequest>
</xsi:SetExpressCheckoutReq>
一个月前,我将安全协议类型从Tls更改为Tls1.2。当我做出改变时,我的测试没问题,但知道不起作用。我跟踪了Wireshark的连接,并从沙箱获得了贝宝(173.0.82.78)
443 → 60191 [RST, ACK] Seq=4163 Ack=2365 Win=0 Len=0
任何想法?
感谢。对不起我的英文。如果你因为这个而不明白,不要犹豫,问我什么。
答
有许多apis,由贝宝提供取决于您的位置。 请首先检查您的国家是否支持其他api。 去http://developer.paypal.com这是最大的文档和指南使用贝宝apis我认为快递付款是最适合你它将连接到贝宝网站和结账将在一个非常安全的地方完成。在PayPal网站中记录了文档和api属性,并提供了非常有用的示例。 您必须使用查询字符串将此请求发送到此网址https://api.sandbox.paypal.com/2.0/。 你必须发送的属性可以在paypal网站上找到express checkout api rest。 好运
api支持我的国家和美国,我通过代理进行测试。我再次阅读api文档,并且xml格式良好。我发送了正确的用户,密码和证书,但由于任何原因贝宝关闭了连接。去年六月相同的代码运行良好。 –
更简单的方法是使用查询字符串将所有属性传递给paypal沙箱,并从paypal提供响应,您必须发送api签名和api id,并为每个请求发送其他属性的秘密。 –