简体   繁体   English

如何将自定义变量传递给PayPal定期付款

[英]How to pass custom variables to the PayPal recurring payments

My task is to create a PayPal recurring payments on my website. 我的任务是在我的网站上创建PayPal定期付款。 This can be done using PayPal API. 可以使用PayPal API来完成。

If you want to create recurring payments, you first have to create a recurring profile in the PayPal account of the buyer. 如果要创建定期付款,则首先必须在买方的PayPal帐户中创建一个定期配置文件。 You can create recurring by calling Paypal API createRecurringPayment method. 您可以通过调用Paypal API createRecurringPayment方法来创建重复。 What you should do before this call you can read here . 您可以在此处阅读此电话之前应该做什么。

Let's say that every month we want charge user for 10$. 假设我们每个月要向用户收取10美元。 As per PayPal documentation, my IPN listener every moth will be notified about this transaction and this is fine. 根据贝宝(PayPal)文档,我的IPN侦听器将被告知有关此交易的一切信息,这很好。 But the problem is that I have to pass custom values to my IPN lister (user ID) to identify the user and then to extend it's subscription. 但是问题是我必须将自定义值传递给我的IPN列表程序(用户ID),以标识用户,然后扩展其订阅。 How to pass the custom variables when recurring payment happens automatically? 自动发生定期付款时如何传递自定义变量?

Please can someone help me with this? 请有人可以帮我吗?

<input type="hidden" name="custom" value='<?php echo json_encode(array('user_id' => $user_id, 'product' => 'property-advert')) ?>' />

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

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