简体   繁体   English

贝宝直接付款HTML按钮和IPN

[英]Paypal direct payment HTML button together with IPN

I'm using an HTML PayPal button together with IPN to achieve a direct payment on my PHP website. 我正在使用HTML PayPal按钮和IPN来在我的PHP网站上实现直接付款。 The IPN URL is correctly pinged but I need a way to identify the transaction, because I need to update it on my local database during the IPN call. IPN URL已正确ping通,但是我需要一种方法来识别事务,因为在IPN调用期间需要在本地数据库上更新它。

So my question is : is there a simple way to send a token / identifier from the HTML button and get it back on the IPN call, so that I retrieve the transaction? 所以我的问题是:是否有一种简单的方法可以从HTML按钮发送令牌/标识符,并在IPN调用中将其取回,以便我检索交易?

If no, I guess I'll have to use the API but the code samples I found on the PayPal website confused me. 如果没有,我想我必须使用API​​,但是我在PayPal网站上找到的代码示例让我感到困惑。 I need the payment to offer both Paypal / Credit Card options to the user once he lands on the PayPal payment page. 一旦用户登陆PayPal付款页面,我就需要向其提供Paypal /信用卡两种选择。 This is what they call a "Direct Payment" but is there any clear Direct Payment code samples I can use somewhere? 他们称之为“直接付款”,但是我可以在任何地方使用任何清晰的直接付款代码示例吗?

Thanks! 谢谢!

I used the simple form to redirect customers to paypal. 我使用简单的表单将客户重定向到贝宝。 In this form i have a hidden input <input type="hidden" name="invoice" value="myCustomInvoiceId" /> . 在这种形式下,我有一个隐藏的输入<input type="hidden" name="invoice" value="myCustomInvoiceId" />

After the customer finished his payment, paypal will do the IPN call including invoice=myCustomInvoiceId . 客户完成付款后,贝宝将进行IPN呼叫,包括invoice=myCustomInvoiceId So yes. 是的 There are plenty of variables more that paypal can include in their IPN call. 贝宝可以在其IPN呼叫中包含更多变量。 See this link for further reading. 请参阅此链接以进一步阅读。

if i remember correctly, you can chose which variables to include in the IPN call in your merchant paypal account. 如果我没记错的话,您可以选择要在商家Paypal帐户的IPN呼叫中包括哪些变量。

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

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