Paypal:尝试使用捐赠按钮传递金额 [英] Paypal: trying to pass an amount with a Donation button

查看:34
本文介绍了Paypal:尝试使用捐赠按钮传递金额的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了一个捐赠按钮,供用户输入捐赠金额.我正在尝试使用按钮发送金额.我可以在按钮设置的添加高级变量中输入 amount=1.00 - 效果很好.但是,我没有成功将金额作为 URL 的一部分发送.我在 PayPal 按钮表单中添加了以下行:

I have a Donate button set up for the user to enter the donation amount. I am trying to send an amount with the button. I can enter amount=1.00 in the Add Advanced Variables in the button setup - that works fine. However, I have had no success sending the amount as part of the URL. I have added the following line to the PayPal button form:

<input type="hidden" name="amount" value="9.99" />

但是当我使用 PayPal 时,金额字段是空白的.任何想法我做错了什么?

but the amount field is blank when I get to PayPal. Any thoughts what I am doing wrong?

推荐答案

如果您要创建所谓的托管按钮"(即按钮详细信息存储在 PayPal 端的按钮),则对于对 https://www.paypal.com/cgi-bin/的请求,将忽略数量的 POST 参数网页浏览器.
这是一项安全功能,可防止人们操纵传递给 PayPal 进行结账的金额.

If you're creating a so called 'hosted button' (that is, a button where the button details are stored on the PayPal side), then the 'amount' POST parameter is ignored for requests to https://www.paypal.com/cgi-bin/webscr.
This is a security feature to prevent people from being able to manipulate the amount passed to PayPal for checkout.

您可以通过以下数据确定您是否在使用托管按钮;
托管按钮将具有 _s-xclickcmd 值,并包含 hosted_button_id 参数.

You can identify whether you're using a hosted button by the following data;
Hosted buttons will have a value for cmd of _s-xclick and include the hosted_button_id parameter.

如果是这种情况,您无法通过传入额外的 amount POST 参数来更新金额.

If this is the case, you cannot update the amount by passing in an extra amount POST parameter.

但是,由于您正在处理捐款,而且金额根据定义是灵活的,因此您实际上并不需要托管按钮".在按钮创建表单中,关闭使用 PayPal 托管按钮",或编写自己的按钮以指向 PayPal.
如果您这样做,您可以通过 amount POST 参数设置金额.

However, because you're dealing with donations and the amount is flexible by definition, you don't in fact need a 'hosted button'. In the button creation form, turn off 'Host button with PayPal', or write your own to point to PayPal.
If you do this, you can set the amount via the amount POST parameter.

例如,下面的工作正常;

For example, the below works fine;

<form method="POST" action="https://www.paypal.com/cgi-bin/webscr">
<input type="hidden" name="cmd" value="_donations">
<label for="amount">Amount: </label><input type="text" name="amount" value="">
<input type="submit" name="submit" value="Pay with PayPal">
</form>

这篇关于Paypal:尝试使用捐赠按钮传递金额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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