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

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

问题描述

过去 2 天一直被这个问题困扰.

Got stuck with this issue for last 2 days.

我们有一个基于网络的产品,用户可以免费注册 14 天,然后每月订阅 60.00 美元.一旦用户点击Pay with 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 天收费而不是免费,然后返回所有查询字符串.我们的流程取决于自定义参数,其中我们将 Pay pal 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天全站免登陆