简体   繁体   English

贝宝成功返回URL

[英]Paypal success return URL

I need to set custom variable URL after success paying. 付款成功后,我需要设置自定义变量网址。 For example I need return url to be http://site-address.com/file.php ? 例如,我需要返回网址为http://site-address.com/file.php id=1&code=34hGfrT23Hq&sum=10 . id = 1&code = 34hGfrT23Hq&sum = 10 How can I make this? 我该怎么做? In javascript I build this link. 在javascript中,我建立了此链接。 I inserted it in 我插入了

<input type="hidden" name="notify_url" value="my link"/>

Their support is very slow and useless in this case. 在这种情况下,他们的支持非常缓慢且无用。

If you know where the return URL is intended to be when they arrive back from PayPal to their purchasing page then you could load "my_link" with php variables and use it to redirect when they arrive back: 如果您知道当他们从PayPal返回到购买页面时返回URL的目标位置,那么您可以使用php变量加载"my_link" ,并在它们返回时使用它重定向:

 <?php
 $my_link =  'http://site-address.com/file.php?';
 $my_link .= 'id=' . $id;
 $my_link .= '&code=' . $code;
 $my_link .= '&sum=' . $sum;

 header("Location: $my_link");
 exit;
 ?>

Looking at this page Setting PayPal return URL and making it auto return? 在查看此页面设置PayPal返回URL并使其自动返回? Prashanth Pratapagiri's answer seems to suggest it is the "return" and not the notify_url which does the work, so you would need this on a hidden input for use before it is submitted: Prashanth Pratapagiri的答案似乎表明是“返回”而不是起作用的notify_url,因此在提交之前,您需要在隐藏的输入上使用它:

 <input type="hidden" name="return" value="<?php echo $my_link; ?>"/>

These might have a few pointers to help with setting up query strings with JavaScript: HTML form not changing URL as expected 这些可能有一些指针,以帮助使用JavaScript设置查询字符串: HTML表单未按预期更改URL

IPN -Instant Payment Notification might help, and PayPal provide basic scripts for that which enable you to do processes which are in response to the instant notification when you get it. IPN-即时付款通知可能会有所帮助,贝宝(PayPal)为此提供了基本的脚本,使您能够执行在收到即时通知时做出响应的流程。 This has a fair bit of explanation: using paypal button - can my webpage tell if paypal transaction was successful or not? 这有一个合理的解释: 使用贝宝按钮-我的网页可以告诉我贝宝交易是否成功吗?

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

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