[英]PayPal with image button ASP.NET ( sandbox account) incorrectly formatted item amount
[英]Paypal Button Incorrectly Formatted Item Amount
大家好! 我在ASP.NET C#項目中我的貝寶按鈕遇到問題,每當我單擊“添加到購物車”時,貝寶都會給我以下錯誤:
“ 您用於進入PayPal系統的鏈接包含格式錯誤的項目金額。 ”
我的按鈕如下所示:
<form target="_self" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="MyEmail@Email.com">
<!-- Specify a PayPal Shopping Cart Add to Cart button. -->
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="<%# Eval("ProductName") %>">
<input type="hidden" name="amount" value="<%# Eval("ProductPrice", "{0:0.00}") %>">
<input type="hidden" name="currency_code" value="DKK">
<input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif"
alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif">
</form>
在我的SQL數據庫中,我的“ ProductPrice ”是一個數據類型:decimal( 18,0 )我試圖將其更改為數據類型:money ,但是沒有成功。
我想提一下,我不是像你們這樣的有經驗的編碼員/程序員,我收到的每一個答復都會很感激我:)
謝謝!
快速解決:
<input type="hidden" name="amount" value="<%# Eval("ProductPrice", "{0:0.00}").ToString().Replace(",", ".") %>">
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.