使用PayPal实施免费试用期不会返回任何自定义参数 [英] Implementation of free trial period with PayPal doesn't return any custom parameter

查看:144
本文介绍了使用PayPal实施免费试用期不会返回任何自定义参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去2天一直困扰于此问题.

Got stuck with this issue for last 2 days.

我们有一个基于Web的产品,用户可以免费注册14天,其后每月订阅费用为$ 60.00.一旦用户单击用Paypal付款"按钮,页面将带用户到Paypal,完成付款后,它将重定向回我们的网站.传递的所有参数看起来都不错,因为我以商人和用户身份使用沙箱进行了测试.我们在网站付款首选项"下的商家资料设置中使用了返回URL"属性.

We have a web based product where users can signup for free for 14 days and thereafter monthly subscription of say $60.00. Once users clicked "Pay with Paypal" button out page will taken users to Paypal and once they have done the payment it redirects back to our website. All the parameters were passed looks fine, since i tested with sandbox as merchant and user. we were using Return URL property on merchant profile setting under Website Payment Preferences.

大多数类似的问题是使用PayPal实施免费试用期 Paypal订阅免费试用无法正常工作,但是我的问题有所不同.同样,第一个问题中指出的文档也不是有效的链接.

Most similar questions are Implementing a free trial period with PayPal and Paypal subscription free trial isn't working but my issue is bit different. And also the document pointed in the first question is not a valid link.

当用户返回到我们的网站时,我们无法检索在最初重定向到PayPal时传入的自定义变量.基本上,这只是一个空白的重定向,没有任何查询字符串或post参数.但是,然后我尝试在前14天而不是免费的时间内收取一定金额,然后返回所有查询字符串.我们的流程取决于自定义参数,在该参数中,我们将付款伙伴ID与实际客户数据进行映射.

When user's being returned back to our website, we can not retrieve custom variable which we passed in during initial redirection to PayPal. Basically it was just a blank redirection without any query-string or post parameter. But then i try to charge an amount for first 14 days instead of free, then all query string returned. Our flow is depend on the custom parameter where we map pay pal id with actual customer data.

我们的代码如下,

<form name='paypal' action='https://www.sandbox.paypal.com/cgi-bin/webscr' method='post'>
<input type='hidden' name='business' value='xxx@xxxxx.com'>
<input type='hidden' name='no_shipping' value='1'>
<input type='hidden' name='cmd' value='_xclick-subscriptions'>
<input type='hidden' name='a3' value='60.00'>
<input type='hidden' name='item_name' value='Product A'>"
<input type='hidden' name='currency_code' value='USD'>
<input type='hidden' name='custom' value='parameter1|parameter2'>
<input type='hidden' name='item_number' value='PlanCode'>
<input type='hidden' name='p3' value='1'>"
<input type='hidden' name='t3' value='M'>"
<input type='hidden' name='a1' value='0'>" 
<input type='hidden' name='p1' value='14'>" 
<input type='hidden' name='t1' value='D'> 
</form>

我尝试添加,

<input type='hidden' name='rm' value='1'>

但是没有运气.

  1. 为什么当"a1 = 0"持续14天时我无法获得回调参数?但是,如果我将"a1"设置为大于0的话,相同的代码也可以工作?
  2. 我缺少任何参数吗?还是我在回叫时使用了错误的方法? (我正在使用返回URL)
  3. 如何使用IPN?我从PayPal网站IPN了解不是实时的.由于我们的应用程序依赖于自定义数据进行下一次注册,因此我想知道是否可以使用它?如果是这样,最初要研究的文档是什么?

推荐答案

我从贝宝(Paypal)论坛获得了有关此问题的回复.我将其添加为答案,因为这将在将来帮助其他开发人员. IPN起点

I got response from paypal forum for this question. I am adding this as answer as this will help other developers in future. Also good starting point for IPN

响应为

如果您使用的是PDT,则不会进行任何付款,因为不会进行任何付款.仅当您进行付款时,才会发送回信息.我建议您使用IPN.rm变量和PDT都取决于如果买方没有返回,例如他们的浏览器窗口意外崩溃并关闭,或者他们只是关闭了该窗口,则不会有任何信息被发送回去,并且会丢失.这就是rm变量和PDT多用于创建动态收据.IPN多用于更新系统,因为它不依赖于买方返回您的站点."

"If you are using PDT, then nothing will be sent back as no payment is taking place. Information will only be sent back if you are making a payment. I would recommend using IPN. Both the rm variable and PDT are dependent on the buyer returning back to your site. If the buyer does not return, such as their browser window unexpectedly crashes and closes, or they simply shut it no information will be sent back and it will be lost. This is why the rm variable and PDT are used more for creating dynamic receipts. IPN is more used for updating your system as it does not rely on the buyer returning back to your site. "

此外,使用IPN,您可以根据需要将数据重新发送到系统,也可以从帐户中查看IPN历史记录.IPN通常在付款完成后立即进行."

"Also with IPN you can resend the data to your system if you need to, and you can also view your IPN history from within your account. IPN usually takes place right after the payment is completed."

请参考原始问题

这篇关于使用PayPal实施免费试用期不会返回任何自定义参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆