2012-05-02 41 views
0

我使用此代碼將我的價值傳遞給貝寶。 現在我的問題是,付款完成後,我應該在我的頁面上,以便我可以操縱一些事情,如我應該保存令牌供將來參考等。當我再次回到我的頁面時用戶隱式點擊頁面形成的鏈接支付寶付款完成。但這裏的問題是我不能只依靠用戶點擊或做。我想它應該是隱含的,沒有任何用戶干預。 在此先感謝,請一些啓發.....付款後返回我的網站的貝寶

<% 

    String apiusername="USERNAME"; 
    String apipassword="PASSWORD"; 

    String truePath="http://localhost:8080/Befundo/xtraFiles/paypal/paypalResponse.jsp"; 
    String falsePath="http://localhost:8080/PaypalGS/paypalResponseCancel.jsp"; 

    String itemName="Computer Laptop"; 
    String quantity="2"; 
    String amount="100"; 
%> 


<body > 
<form name="paypalForm" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> 
    <input type="text" name="cmd" value="_xclick" /> 
    <input type="text" name="business" value="<%=apiusername %>" /> 
    <input type="text" name="password" value="<%=apipassword %>" /> 
    <input type="text" name="custom" value="1123" /> 
    <input type="text" name="item_name" value="<%=itemName%>" /> 
    <input type="text" name="amount" value="<%=amount%>"/> 
    <input type="hidden" name="quantity" value="<%=quantity %>" /> 
    <input type="text" name="rm" value="1" /> 
    <input type="text" name="return" value="<%=truePath %>" /> 
    <input type="text" name="cancel_return" value="<%=falsePath %>" /> 
    <input type="text" name="cert_id" value="API Singature" /> 
    <input type='submit' value='Pay'> 
</form> 
</body> 

回答

1

是的,你可以通過配置在貝寶的個人資料自動返回URL做到這一點。

要設置自動返回:

1. Log in and click the Profile subtab under My Account. 
2. Click the Website Payment Preferences link under Selling Preferences. 
3. Click the On radio button to enable Auto Return. 
4. Enter the Return URL. 

當你登錄到商戶的個人資料,你會看到:

preferences1

,並點擊網站支付偏好鏈接後,你會看到:

preferences2

在這裏你可以給autoreturn網址。

這將啓用自動返回,這意味着付款成功後,貝寶將自動重定向到您的網站,無需用戶干預。

下面是啓用自動回貝寶指南:https://www.paypal.com/cgi-bin/webscr?cmd=p/mer/express_return_summary-outside

希望這有助於。

+0

這是可以在沙箱a/c?.... –

+0

,因爲我沒有得到任何**鏈接**說你指定的選項 –

+0

是的,Ofcourse .. :-)你可以在沙箱中做到這一點並通過登錄到賣家的賬戶進行配置。 – AlphaMale