好的,不确定这个问题是什么。我正在尝试通过 cURL 向PayPal发布 API 请求,并得到以下结果。我的电话中是否缺少会导致这种情况?
根据PayPal的说法,调用是正确的,当我使用 PHP cURL 包装器函数时它工作正常......奇怪。
感谢您的帮助!
curl https://api.sandbox.paypal.com/2.0/ -H "X-PAYPAL-SECURITY-USERID: api1.sitetest.com" -H "X-PAYPAL-SECURITY-PASSWORD: 111222222UH24" -H "X-PAYPAL-DEVICE-IPADDRESS: 170.10.125.52" -H "X-PAYPAL-MESSAGE-PROTOCOL: SOAP11" -H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" -E "/Users/Me/Library/PayPal_Keys/cert_key_pem.txt" -d "<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header /><SOAP-ENV:Body><CreateAndSendInvoiceRequest><requestEnvelope><errorLanguage>en_US</errorLanguage></requestEnvelope><invoice><merchantEmail>sweet@sweetsounds.com</merchantEmail><payerEmail>me@testsite.com</payerEmail><businessName>Test Business, Inc.</businessName><logoURL></logoURL><itemList><item><name>Test Item</name><quantity>2</quantity><unitPrice>5.79</unitPrice><taxName>sales</taxName><taxRate>6.0</taxRate></item></itemList></invoice></CreateAndSendInvoiceRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>"
返回
<SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Method not implemented</faultstring></SOAP-ENV:Fault>
解决了
这个问题。PayPal更改了此特定调用的沙盒 API URL,并且没有在其文档中更新该 URL。
沙盒的新网址是"https://api-3t.sandbox.paypal.com/2.0/"。您可以在此处测试您的命令