<legend id='0QYwv'><style id='0QYwv'><dir id='0QYwv'><q id='0QYwv'></q></dir></style></legend>
  • <small id='0QYwv'></small><noframes id='0QYwv'>

      1. <i id='0QYwv'><tr id='0QYwv'><dt id='0QYwv'><q id='0QYwv'><span id='0QYwv'><b id='0QYwv'><form id='0QYwv'><ins id='0QYwv'></ins><ul id='0QYwv'></ul><sub id='0QYwv'></sub></form><legend id='0QYwv'></legend><bdo id='0QYwv'><pre id='0QYwv'><center id='0QYwv'></center></pre></bdo></b><th id='0QYwv'></th></span></q></dt></tr></i><div id='0QYwv'><tfoot id='0QYwv'></tfoot><dl id='0QYwv'><fieldset id='0QYwv'></fieldset></dl></div>

          <bdo id='0QYwv'></bdo><ul id='0QYwv'></ul>
        <tfoot id='0QYwv'></tfoot>

      2. 贝宝:将电子邮件地址传递给退货/“谢谢";页

        时间:2023-06-23
        <legend id='6ySAW'><style id='6ySAW'><dir id='6ySAW'><q id='6ySAW'></q></dir></style></legend>
        • <bdo id='6ySAW'></bdo><ul id='6ySAW'></ul>
            <tbody id='6ySAW'></tbody>

          <i id='6ySAW'><tr id='6ySAW'><dt id='6ySAW'><q id='6ySAW'><span id='6ySAW'><b id='6ySAW'><form id='6ySAW'><ins id='6ySAW'></ins><ul id='6ySAW'></ul><sub id='6ySAW'></sub></form><legend id='6ySAW'></legend><bdo id='6ySAW'><pre id='6ySAW'><center id='6ySAW'></center></pre></bdo></b><th id='6ySAW'></th></span></q></dt></tr></i><div id='6ySAW'><tfoot id='6ySAW'></tfoot><dl id='6ySAW'><fieldset id='6ySAW'></fieldset></dl></div>

          <small id='6ySAW'></small><noframes id='6ySAW'>

                • <tfoot id='6ySAW'></tfoot>
                  本文介绍了贝宝:将电子邮件地址传递给退货/“谢谢";页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我已经使用 PayPal IPN 和监听器.按钮本身是向导生成的.

                  I've successfully created a small "pay now" button with PayPal IPN and a listener. The button itself is wizard-generated.

                  付款后,用户被重定向到我的主机上的返回/谢谢"页面.

                  After the payment, the user is redirected to a return/"thank you" page on my host.

                  一切都按预期进行,但我也需要在谢谢"页面上收到客户电子邮件:我该怎么做?

                  Everything works as expected, but I need to receive the customer e-mail on the "thank you" page too: how can I do that?

                  推荐答案

                  您可以使用付款数据传输 (PDT) 来获取用户电子邮件,它会将名为 tx 的 GET 变量发送到您的重定向 url.

                  You can get the user email using the Payment Data Transfer (PDT), which sends a GET variable named tx to your redirect url.

                  tx 变量包含一个交易号,您可以使用它发送到 Paypal 服务器的 post 请求并检索交易信息.

                  The tx variable contains a transaction number which you can use to send to a post request to Paypal's server and retrieve the transaction information.

                  我上次使用 PDT 是在一年前,但我相信您的 Paypal 帐户中有一个设置,您需要启用并设置重定向 URL 才能使其工作.

                  The last time I used PDT was a year ago, but I believe there is a setting in your Paypal account that you need to enable and set a redirect url for this to work.

                  以下是一些更详细描述 PDT 的链接:

                  Here are some links that describes PDT in further detail:

                  • https://www.paypal.com/us/cgi-bin/webscr?cmd=p/xcl/rec/pdt-techview-outside
                  • https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_html_paymentdatatransfer

                  这里是一个如何解析向Paypal发送post请求并解析数据的示例.我只是从旧文件中挖掘出来的.所以不能保证它有效.这是基于 Paypal 用作 php 示例的脚本.您可以改用 curl,这可能是更好的选择.我认为使用 fsockopen 存在某种安全问题.

                  Here is an example of how to parse send a post request to Paypal and parse the data. I just dug this up from an old file. So no guarantees that it works. This is based off a script that Paypal uses as an example for php. You can use curl instead, and that's probably the better choice. I think there is some kind of security issue with using fsockopen.

                  //Paypal will give you a token to use once you enable PDT
                  $auth_token = 'token';
                  
                  //Transaction number
                  $tx_token = $_GET['tx'];
                  
                  $payPalUrl = ( $dev === true ) ? 'ssl://www.sandbox.paypal.com' : 'ssl://www.paypal.com';
                  
                  $req = 'cmd=_notify-synch';
                  $req .= "&tx=$tx_token&at=$auth_token";
                  
                  
                  $header .= "POST /cgi-bin/webscr HTTP/1.0
                  ";
                  $header .= "Content-Type: application/x-www-form-urlencoded
                  ";
                  $header .= "Content-Length: " . strlen($req) . "
                  
                  ";
                  $fp = fsockopen ($payPalUrl, 443, $errno, $errstr, 30);
                  
                  $keyarray = false;
                  
                  if ( $fp ) {
                      fputs ($fp, $header . $req);
                  
                      $res = '';
                      $headerdone = false;
                      while (!feof($fp)) {
                          $line = fgets ($fp, 1024);
                          if (strcmp($line, "
                  ") == 0) {
                              $headerdone = true;
                          }
                          else if ($headerdone) {
                              $res .= $line;
                          }
                      }
                  
                      $lines = explode("
                  ", $res);
                  
                      if (strcmp ($lines[0], "SUCCESS") == 0) {
                              //If successful we can now get the data returned in an associative array
                          $keyarray = array();
                          for ($i=1; $i<count($lines);$i++){
                              list($key,$val) = explode("=", $lines[$i]);
                              $keyarray[urldecode($key)] = urldecode($val);
                          }
                      }
                  }
                  fclose ($fp);
                  return $keyarray;
                  

                  这篇关于贝宝:将电子邮件地址传递给退货/“谢谢";页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Braintree 自定义贝宝按钮 下一篇:为什么 tlstest.paypal.com 可以在浏览器中运行,但不能在我的 PHP 代码中运行(对 Paypal I

                  相关文章

                • <small id='VypyJ'></small><noframes id='VypyJ'>

                  <legend id='VypyJ'><style id='VypyJ'><dir id='VypyJ'><q id='VypyJ'></q></dir></style></legend>

                      • <bdo id='VypyJ'></bdo><ul id='VypyJ'></ul>
                      <tfoot id='VypyJ'></tfoot>
                      <i id='VypyJ'><tr id='VypyJ'><dt id='VypyJ'><q id='VypyJ'><span id='VypyJ'><b id='VypyJ'><form id='VypyJ'><ins id='VypyJ'></ins><ul id='VypyJ'></ul><sub id='VypyJ'></sub></form><legend id='VypyJ'></legend><bdo id='VypyJ'><pre id='VypyJ'><center id='VypyJ'></center></pre></bdo></b><th id='VypyJ'></th></span></q></dt></tr></i><div id='VypyJ'><tfoot id='VypyJ'></tfoot><dl id='VypyJ'><fieldset id='VypyJ'></fieldset></dl></div>