Paypal PDT如何获取单品价格

Paypal PDT如何获取单品价格,paypal,paypal-sandbox,Paypal,Paypal Sandbox,我的单件商品价格为2.00,如果买方购买2个数量,“mc_总值”将变为4.00。我的“项目编号”值为1。因此,我尝试使用“mc_gross_1”获取单个项目的值,但返回空值 我临时解决的是使用“mc_gross”/“quantity”来获得单个项目的价格。我指的是 我的网站只有一个“立即购买”按钮和单一物品,而不是购物车 我的代码如下: <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" ta

我的单件商品价格为2.00,如果买方购买2个数量,“mc_总值”将变为4.00。我的“项目编号”值为1。因此,我尝试使用“mc_gross_1”获取单个项目的值,但返回空值

我临时解决的是使用“mc_gross”/“quantity”来获得单个项目的价格。我指的是

我的网站只有一个“立即购买”按钮和单一物品,而不是购物车

我的代码如下:

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="QAZN7GVGZPERC">
<input type="image" src="https://www.paypalobjects.com/webstatic/en_US/btn/btn_buynow_pp_142x27.png" 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>

Html与我使用的代码相同:

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="XXX-facilitator@gmail.com">
<input type="hidden" name="currency_code" value="US">

<input type="hidden" name="item_name_1" value="IT SERVER">
<input type="hidden" name="amount_1" value="15">

<input type="hidden" name="item_name_2" value="convenience fees">
<input type="hidden" name="amount_2" value="5.00">
<input type="hidden" name="return" value="http://localhost/justbuy/pdtreturn.php">
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

我的只有一个项目,只有一个立即购买按钮,而不是购物车。mc_gross_1只允许多个项目?是的,它适用于多个项目,添加了我的html示例代码。那么你知道如何仅获取单个项目的单个价格吗?好的,没有直接的方法获取单个项目的价格,你必须手动执行,例如:mc_gross-(装运+税务)表示类似于此公式(mc_gross-装运+税务)/数量?
mc_gross=30.80
protection_eligibility=Eligible
address_status=confirmed
item_number1=
tax=0.80
item_number2=
payer_id=ZK5AUW8MWY9CW
ebay_txn_id1=
address_street=1+Main+St
ebay_txn_id2=
payment_date=01%3A11%3A41+Feb+04%2C+2016+PST
payment_status=Completed
charset=UTF-8
address_zip=95131
mc_shipping=10.00
mc_handling=0.00
first_name=vimalbuyer
mc_fee=1.19
address_country_code=US
address_name=vimalbuyer+ravichandran
custom=
payer_status=verified
business=vimal53-facilitator%40gmail.com
address_country=United+States
num_cart_items=2
mc_handling1=0.00
mc_handling2=0.00
address_city=San+Jose
payer_email=vimalbuyer%40gmail.com
mc_shipping1=0.00
mc_shipping2=0.00
tax1=0.00
tax2=0.00
contact_phone=408-329-3451
txn_id=99E872700B3517715
payment_type=instant
last_name=ravichandran
address_state=CA
item_name1=IT+SERVER
receiver_email=vimal-facilitator%40gmail.com
item_name2=convenience+fees
payment_fee=1.19
shipping_discount=0.00
quantity1=1
insurance_amount=0.00
quantity2=1
receiver_id=S4X5XW328WAYY
txn_type=cart
discount=0.00
mc_gross_1=15.00
mc_currency=USD
mc_gross_2=5.00
residence_country=US
shipping_method=Express
transaction_subject=
payment_gross=30.80