简体   繁体   English

Paypal IPN集成在PHP中

[英]paypal ipn integration in php

I am building a website that generates invoices, and also creates a 'pay now' button. 我正在建立一个生成发票的网站,并创建一个“立即付款”按钮。 I was looking at paypal IPN as it appears to be the easiest to integrate into the site. 我一直在查看Paypal IPN,因为它似乎最容易集成到站点中。

I had a question regarding it that I couldn't seem to find in the Developer documentation. 我有一个问题,似乎在开发人员文档中找不到。

Is the PayPal IPN only one way? PayPal IPN只是一种方法吗? What I mean, is can I generate a URL that directs a user to Paypal, and along with that URL the customer name, invoice # and payment amount, that paypal can then use to process a payment, and send a paypal IPN back with some (or all) of the values I sent it to begin with? 我的意思是,我可以生成一个将用户定向到Paypal的URL,然后连同该URL一起输入客户名称,发票编号和付款金额,然后该paypal可以用来处理付款,并将Paypal IPN和一些(或所有)我开始发送的值?

For example, if the link for the button was https://paypal.com/paynow/pay?invoice_number=123458&pay_total=109.99 例如,如果按钮的链接为https://paypal.com/paynow/pay?invoice_number=123458&pay_total=109.99

If the user clicked the button on the page (or in the email), they would be sent to paypal where they could fill in their payment details, process the payment, and paypal would send a response back to my listening URL, also giving me back at least the invoice_number parameter that I passed it? 如果用户单击页面上(或电子邮件中)的按钮,他们将被发送到paypal,在那里他们可以填写他们的付款详细信息,处理付款,并且paypal会将响应发送回我的收听URL,同时还给我至少返回我传递的invoice_number参数?

This would be really helpful, and I appreciate all the feedback. 这真的很有帮助,我感谢所有反馈。

For invoice number you would just use the specific parameter available for that, which is called invoice . 对于发票号,您只需使用可用于该发票号的特定参数,称为invoice This would then come back in IPN as $_POST['invoice'] . 然后,它将在IPN中返回为$_POST['invoice']

The total would be part of IPN data by default. 默认情况下,总数将是IPN数据的一部分。 Anything truly custom that you need can be done with the custom parameter, which stores up to 256 characters and would then come back in $_POST['custom'] within your IPN script. 真正需要的任何定制操作都可以通过custom参数完成,该参数最多可以存储256个字符,然后将其返回到IPN脚本中的$_POST['custom']中。

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

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