无法在贝宝沙箱中发布商品价格 [英] can't POST item price in paypal sandbox

查看:36
本文介绍了无法在贝宝沙箱中发布商品价格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="YYHZM9FTBZQGW">
<input type="hidden" name="amount" value="20.00">
<input type="image" src="https://www.sandbox.paypal.com/en_US/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.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

这是一个贝宝沙盒按钮.我想要做的就是发布用户在我的网站上购买的所有产品的总价.

this is a paypal sandbox button. all i want to do is to post the TOTAL price of all the product the user buy in my website.

我创建了一个没有什么可发布的按钮,因为基本上我想在将来使用 php 变量动态发布,所以我认为我不需要在沙盒创建按钮功能中设置商品价格、名称、数量.我该怎么做.

I created a button with nothing to post because basically i want to post dynamically in the future using a php variable so I think I don't need to set up the item price, name, quantity in the sandbox create button features. how am i suppose to do that.

这是输出.我希望商品价格与描述和数量一样不可编辑

this is the output. I want the item price to be not editable same as with description and quantity

推荐答案

您不能动态覆盖金额的原因是因为您有一个所谓的PayPal 托管按钮".
使用托管按钮,金额存储在 PayPal 端,不能用金额"变量覆盖.您要么想使用非托管按钮,要么使用 BMUpdateButton API 调用以动态更新按钮的数量.

The reason you can't override the amount dynamically, is because you have a so-called 'PayPal hosted button'.
With a hosted button, the amount is stored on PayPal's side and can't be overwritten with the 'amount' variable. You'll either want to use a non-hosted button, or use the BMUpdateButton API call to dynamically update the button's amount.

BMUpdateButton 的示例请求如下所示:

An example request for BMUpdateButton would look as follows:

USER=Your API username
PWD=Your API password
SIGNATURE=Your API signature
VERSION=82.0
HOSTEDUBTTONID=The value of <input type="hidden" name="hosted_button_id" value="">
BUTTONTYPE=The type of button. E.g. BUYNOW
BUTTONCODE=The type of code you want to get back. E.g. HOSTED
L_BUTTONVAR0=amount=The new amount with a period as separator
L_BUTTONVAR1=item_name=Optional: a new item name if you wish

同样,您也可以使用 BMCreateButton API 创建新按钮,或使用 BMButtonSearch API 用于搜索所有存储的托管按钮列表(例如,自动查找按钮的托管按钮 ID)

Similary, you could also use the BMCreateButton API to create a new button, or use the BMButtonSearch API to search through a list of all your stored hosted buttons (to find the hosted_button_id of your button automatically, for example)

使用托管按钮的原因是它更安全.一个非托管的、未加密的按钮基本上会使金额被操纵.等待发生的欺诈性交易.

The reason to use a hosted button is because it's more secure. A non-hosted, unencrypted button would basically leave the amounts open to manipulation. Fraudulent transactions waiting to happen.

这篇关于无法在贝宝沙箱中发布商品价格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆