Paypal button + IPN (pass payer username)

筅森魡賤 提交于 2019-12-06 07:03:16

问题


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.


回答1:


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 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.

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).



来源:https://stackoverflow.com/questions/12736674/paypal-button-ipn-pass-payer-username

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!