简体   繁体   English

如何通过PayPal IPN传递自定义数据

[英]How to pass custom data via PayPal IPN

I use following code for the RETURN URL . 我将以下代码用于RETURN URL

 @foreach (var item in Model)
                    {
                        <form action='@item.PayPalURL2 ' method='post'>
                            <input type='hidden' name='cmd' value='_xclick' />
                            <input type='hidden' name='business' value='@item.BusinessEmail' />
                            <input name='item_name' value='@item.Name' class="ppField" readonly="readonly"/>
                            <input type='hidden' name='item_number'  value='@item.ID' />
                            <input name='amount' value='@item.Price2' class="ppField" readonly="readonly"/>
                            <input type='hidden' name='return' value='@item.ReturnURL' />
                            <input type='hidden' name='custom' value='@item.UserID' />
                            <input type='submit' value='Buy' />
                        </form>
                    }

Any clue how to pass custom filed to IPN message and get it via Listener ? 任何线索如何将custom IPN message传递到IPN message并通过Listener获取?

Thank you!!! 谢谢!!!

You've already got the "custom" field included in your form. 您已经在表单中包含“自定义”字段。 Whatever value you have in @item.UserID will be getting sent along with the payment and will come back as a POST value called "custom" within your IPN solution. @ item.UserID中的任何值将与付款一起发送,并作为IPN解决方案中称为“ custom”的POST值返回。

So, it looks like you're already got what you need. 因此,看来您已经拥有了所需的东西。 You just need to make sure $item.UserID actually contains what you expect it to contain, and that you're looking for the custom field in your IPN listener. 您只需要确保$ item.UserID实际上包含您期望它包含的内容,并且您正在IPN侦听器中查找自定义字段即可。

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

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