贝宝按钮+ IPN(通过付款人用户名) [英] Paypal button + IPN (pass payer username)

查看:66
本文介绍了贝宝按钮+ IPN(通过付款人用户名)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以传递和接收自定义变量(例如付款人的用户名)?我不能强迫我的用户为贝宝使用与我在网站上使用的相同的电子邮件地址(最初由贝宝返回).传递额外的用户名将对轻松检查付款人的身份很有帮助.

Is there a way to also pass and receive the custom variable (for example payer's username)? I cant force my users to use the same email address for paypal (which is originally returned by paypal) as they use on my site. Passing an additional username would be a great help for easily checking the payer's identity.

推荐答案

您可以在发布到PayPal的表单中包含一个自定义隐藏字段,如下所示:

You can include a custom hidden field in the form that is posted to PayPal, like this:

<input type="hidden" name="custom" value="<?php echo $user_name; ?>">  // I don't know php well, so correct that part if it's wrong

然后,PayPal会将该值与其余IPN数据一起传回给您.请注意,此字段允许的最大字符数为256.

PayPal will then pass that value back to you with the rest of the IPN data. Note that the maximum number of characters permitted for this field is 256.

此外,您不能仅定义任何字段-您只能使用PayPal指定的字段

Also, you can't define just any field - you can only use the ones that PayPal specifies here (i.e. the input name is 'custom' because PayPal specifically allows it - if you had set the name to 'username' it would be ignored).

这篇关于贝宝按钮+ IPN(通过付款人用户名)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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