Paypal button + IPN (pass payer username)(Paypal 按钮 + 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 指定的字段 此处(即输入 name
是自定义",因为 PayPal 特别允许 - 如果您有将 name
设置为 'username' 它将被忽略).
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).
这篇关于Paypal 按钮 + IPN(通过付款人用户名)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Paypal 按钮 + IPN(通过付款人用户名)


- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- PHP - if 语句中的倒序 2021-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- PHP foreach() 与数组中的数组? 2022-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01