2013-03-26 43 views
0

我在想以下代碼的「Pay Now」按鈕有什麼問題。點擊它後,它會顯示網站上的錯誤消息「錯誤處理付款」(https://securepayments.sandbox.paypal.com/cgi-bin/webscr)。「Pay Now」按鈕在buttonmanager-sdk-dotnet SDK示例項目中不起作用

我使用了git集線器中的buttonmanager-sdk-dotnet,並且按照soap響應中的說明生成按鈕代碼。爲了生成「立即購買」按鈕,似乎沒問題,我可以點擊並從PayPal查看付款頁面,而不是錯誤頁面。

這真的讓我感到困惑。誰能幫我?

謝謝!

<form target="_top" action="https://securepayments.sandbox.paypal.com/cgi-bin/webscr" method="post"> 
<input type="hidden" name="cmd" value="_s-xclick"> 
<input type="hidden" name="hosted_button_id" value="HSS-BswQHPdTagwZHwncBBJAK6K0RKijQJ91"> 
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_paynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 
</form> 

SOAP請求:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:ebay:api:smileytongue:ayPalAPI" 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>jb-us-seller_api1.paypal.com</ebl:Username><ebl:smileytongue:assword>WX4WTU3S8MY44S7F</ebl:smileytongue:assword><ebl:smileyfrustrated:ignature>AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy</ebl:smileyfrustrated:ignature></ebl:Credentials></ns:RequesterCredentials></soapenv:Header><soapenv:Body><ns:BMCreateButtonReq><ns:BMCreateButtonRequest><ebl:Version>98.0</ebl:Version><ns:ButtonType>PAYMENT</ns:ButtonType><ns:ButtonCode>TOKEN</ns:ButtonCode><ns:ButtonVar>item_name=Widget</ns:ButtonVar><ns:ButtonVar>return=</ns:ButtonVar><ns:ButtonVar>business=jb-us-seller_paypal.com</ns:ButtonVar><ns:ButtonVar>notify_url=</ns:ButtonVar><ns:ButtonVar>subtotal=2.00</ns:ButtonVar></ns:BMCreateButtonRequest></ns:BMCreateButtonReq></soapenv:Body></soapenv:Envelope> 

SOAP響應:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI"><SOAP-ENV:Header><Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"></Security><RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType"><Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType"><Username xsi:type="xs:string"></Username><Password xsi:type="xs:string"></Password><Signature xsi:type="xs:string"></Signature><Subject xsi:type="xs:string"></Subject></Credentials></RequesterCredentials></SOAP-ENV:Header><SOAP-ENV:Body id="_0"><BMCreateButtonResponse xmlns="urn:ebay:api:PayPalAPI"><Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2013-03-26T00:47:07Z</Timestamp><Ack xmlns="urn:ebay:apis:eBLBaseComponents">Success</Ack><CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">4077039977e32</CorrelationID><Version xmlns="urn:ebay:apis:eBLBaseComponents">98.0</Version><Build xmlns="urn:ebay:apis:eBLBaseComponents">5479129</Build><Website xsi:type="xs:string"><form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_xclick"><input type="hidden" name="business" value="[email protected]"><input type="hidden" name="item_name" value="Widget"><input type="hidden" name="button_subtype" value="products"><input type="hidden" name="bn" value="TWLK53YN7GDM6:PP-BuyNowBF_P"><input type="hidden" name="no_note" value="0"><input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"></form></Website><Email xsi:type="xs:string">https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_xclick&business=jb%2dus%2dseller%40paypal%2ecom&item_name=Widget&button_subtype=products&bn=TWLK53YN7GDM6%3aPP%2dBuyNowBF_P&no_note=0</Email></BMCreateButtonResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> 

回答

0

嘗試使用以下行,而不是該行的當前正在使用

<form target="_top" action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
+0

我改變了帖子的URL,它仍然無法正常工作。包含URL的HTML表單通過API調用返回,應該沒問題。我猜這個賬戶沒有爲交易類型付款設置。該錯誤消息對錯誤頁面也不是很有幫助。 – 2013-03-26 19:16:02

0

我設法改爲使用「立即購買」按鈕。我希望貝寶文檔可以更清晰。