paypal動態退貨地址 (paypal dynamic return address)


問題描述

paypal動態退貨地址 (paypal dynamic return address)

I have a single product, a file that is dynamically created and I need a paypal to return a customer after payment is done to the address of the file. Simple Buy Now button is elegant but if I put

<input type="hidden" name="return" value="http://www.mysite.com/x727x7e.dat">

into a button's code, simple browser's Page - View Source can reveal the file address before the payment.

Here is a sample of button code:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="return" value="http://www.mysite.com/x727x7e.dat">
<input type="hidden" name="cancel_return" value="http://www.mysite.com/nothanx.html">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="1111111111">
<input type="image" src="https://www.paypal.com/en_AU/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_AU/i/scr/pixel.gif" width="1" height="1"></form>

I assume the right way would be to use PayPal api and to generate the file after the transaction has been sucessfull but since I am noob to paypal and was wondering can this be solved in an elegant way?

Can I make a (asp.net c#) button that makes post method with this parameters to paypal, so that return url in not visible to the customer?


參考解法

方法 1:

Yes, create a hidden input named return and insert your return address.  You can also set a hidden input named cancel_return and insert a cancel-return address that is used if the user tries to cancel the transaction.  Finally you may add one named notify_url that will receive a POST asynchronously after the purchase.  The return address will also receive a POST but only if the user clicks to return. 

EDIT:

I just noticed you want to hide the address.  One, as I mentioned the payment information is posted to that address, which includes a validation code you can ask paypal if the payment is valid.  So this means it's not vital to keep the address secret (besides, after one payment a user could see where he went to anyway).

Two, you may register an SSL key with paypal and then encrypt your fields with it.  Please see their documentation on how to do this.

The worst that a user can do is complete an erroneous payment through paypal -- they'd still be charged money but would have to, with a straight face, claim that your website said it (whatever you are selling) was only $0.01 USD instead of $10.00 USD.

That may or may not be a concern depending on what you are selling.

(by IvanAdam Luter)

參考文件

  1. paypal dynamic return address (CC BY-SA 3.0/4.0)

#ASP.NET #return #url #paypal #C#






相關問題

System.Reflection.Assembly.LoadFile 鎖定文件 (System.Reflection.Assembly.LoadFile Locks File)

如何在沒有全局變量的情況下一直保留我的變量? (How can I keep my variable all the time without global variables?)

C# / ASP.NET - Web 應用程序鎖定 (C# / ASP.NET - Web Application locking)

關閉模態對話框窗口後 ASP.NET 刷新父頁面 (ASP.NET Refresh Parent Page after Closing Modal Dialog Window)

無法將 NULL 值傳遞給數據庫 (Unable to pass NULL value to database)

wcf:將用戶名添加到消息頭是否安全? (wcf: adding username to the message header is this secure?)

使用 ASP.Net 教初學者 Web 開發的小項目想法 (Small projects ideas to teach beginners web development using ASP.Net)

SQL Server - 分組、擁有和計數 (SQL Server - Group by, having and count in a mix)

企業庫異常處理應用程序塊和日誌記錄應用程序塊在 ASP.NET 中的正確使用 (Enterprise Library Exception Handling Application Block and Logging Application Block proper use in ASP.NET)

來自proc的asp.net多個結果集:是否有必要將結果映射到類?如果是這樣,怎麼做? (asp.net multiple result set from proc: is it necessary to map results to class? If so, how?)

如何在測試工具中實例化 asp.net 代碼隱藏類? (How can I instantiate an asp.net codebehind class in a test harness?)

Web 窗體用戶控制事件,需要在頁面加載後添加 (Web Form User Control Event, needs to be added after page loads)







留言討論