2013-03-26 68 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

我设法改为使用“立即购买”按钮。我希望贝宝文档可以更清晰。