简体   繁体   English

Paypal按钮+ IPN(通过付款人用户名)

[英]Paypal button + IPN (pass payer username)

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. 我不能强迫我的用户在我的网站上使用paypal(最初由paypal返回)使用相同的电子邮件地址。 Passing an additional username would be a great help for easily checking the payer's identity. 传递额外的用户名对于轻松查看付款人的身份非常有帮助。

You can include a custom hidden field in the form that is posted to PayPal, like this: 您可以在张贴到PayPal的表单中包含自定义隐藏字段,如下所示:

<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 will then pass that value back to you with the rest of the IPN data. 然后,PayPal将使用其余的IPN数据将该值传递给您。 Note that the maximum number of characters permitted for this field is 256. 请注意,此字段允许的最大字符数为256。

Also, you can't define just any field - you can only use the ones that PayPal specifies here (ie the input name is 'custom' because PayPal specifically allows it - if you had set the name to 'username' it would be ignored). 此外,您不能只定义任何字段 - 您只能使用PayPal 在此处指定的字段(即输入name为'custom',因为PayPal专门允许它 - 如果您将name设置为'username'则会被忽略)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM