Paypal的后端paypal例证在Plunker

时间:2015-05-07 21:26:38

标签: paypal express-checkout

在Plunker的Paypal文档的一个示例中,用于上下文类型支付,给出了URL,但没有关于该后端内部内容的文档。有人可以帮忙。

<div class="row product">
          <div class="col-md-4">
              <h3>Toy Story Jessie T-Shirt</h3>
              <p>
              <a href="http://166.78.8.98/cgi-bin/aries.cgi?live=1&returnurl=http://166.78.8.98/cgi-bin/return.htm&cancelurl=http://166.78.8.98/cgi-bin/cancel.htm" id="t1" class="checkout">
                  <img class="paypal-button-hidden" src="https://www.paypalobjects.com/fr_FR/i/btn/btn_xpressCheckout.gif" alt="Check out with PayPal" />
              </a>
              </p>
          </div>
      </div>

以下是示例:http://plnkr.co/edit/UhNka4VaaRRGY1TK32LE?p=preview 以下是网址:http://166.78.8.98/cgi-bin/aries.cgi?live=1&returnurl=http://166.78.8.98/cgi-bin/return.htm&cancelurl=http://166.78.8.98/cgi-bin/cancel.htm

1 个答案:

答案 0 :(得分:7)

<强> HTML:

    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    </head>
    <body>
     <form id="myContainer" method="post" action="ec_call.php" accept-charset="UTF-8">

    </form>
         <script>
            window.paypalCheckoutReady = function() {
                paypal.checkout.setup('S4X5XW328WAYY', {
                    container: 'myContainer', 
                    environment: 'sandbox'
                    // button: 'incontext_id'

                });

            }

        </script>
    </body>
<script src="//www.paypalobjects.com/api/checkout.js" async></script>
</html>

现在,在ec_call.php内,您需要运行SetExpresscheckout API调用,并在该返回网址中执行Doexpresscheckout API调用。 就是这样。

您也可以下载PHP样本code