Php Paypal自适应支付浏览器

Php Paypal自适应支付浏览器,php,codeigniter,paypal,Php,Codeigniter,Paypal,我正在尝试使用PHP中的Codeigniter框架为我的产品使用Paypal adaptive payment using mini browser选项。当我单击“付款”按钮时,迷你浏览器将打开,但当我单击“登录”按钮时,新选项卡将打开,但我希望在现有迷你浏览器中打开此登录 查看文件: <html> <head> <script src="https://www.paypalobjects.com/js/external/a

我正在尝试使用PHP中的Codeigniter框架为我的产品使用Paypal adaptive payment using mini browser选项。当我单击“付款”按钮时,迷你浏览器将打开,但当我单击“登录”按钮时,新选项卡将打开,但我希望在现有迷你浏览器中打开此登录

查看文件:

       <html>
       <head>
       <script src="https://www.paypalobjects.com/js/external/apdg.js" type="text/javascript"></script>
     </head>
     <body>
      <?php echo form_open_multipart('pay/splitPay','target="PPDGFrame"', 'class="standard"', 'id="mini-form"'); ?>
  <label for="buy">Buy Now:</label>
     <input type="image" id="submitBtn" value="Pay with PayPal" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif">
    <input id="type" type="hidden" name="expType" value="mini">
    <input id="paykey" type="hidden" name="paykey" value="10">
    </form>
     <script type="text/javascript" charset="utf-8">
        var returnFromPayPal = function(){

        alert("Returned from PayPal");
     // Here you would need to pass on the payKey to your server side handle to call the PaymentDetails API to make sure Payment has been successful or not
  // based on the payment status- redirect to your success or cancel/failed urls
      }
     var dgFlowMini = new PAYPAL.apps.DGFlowMini({trigger: 'submitBtn', expType: 'mini', callbackFunction: 'returnFromPayPal'});
     </script>

PayPal有一些安全要求,在某些情况下强制使用新窗口(javascript强制执行)。一般来说,当用户输入登录凭证时,他们需要这样做,这可能是您在问题中使用“登录”与“付款”按钮所指的登录凭证

这样做是为了通过跨站点脚本攻击将凭据被盗的风险降至最低,并确保用户看到“chrome”(例如,安全连接符号和PayPal URL),并在输入凭据时验证窗口是否安全连接到PayPal(出于反钓鱼原因)


一些较新的PayPal产品正在放宽这些要求,但我相当肯定Adaptive在这一模式中是稳固的。

有没有办法强迫登录在现有的迷你浏览器中打开,而不是打开一个新的选项卡?我不知道。这不是开发流程时的预期用途。但是你需要检查文件;我不知道所有的自适应选项。
     function splitPay() {
       $createPacket = array (
        "actionType" => "PAY",
        "currencyCode" => 'USD',
        "receiverList" => array(
                "receiver" => array(
                    array("amount"=>'2.00', "email"=>'bhomnath@salyani.com.np'),
                    array("amount"=>'4.00', "email"=>'infotechnab_api1@yahoo.com'),
                )
            ),
        "returnUrl" => 'http://localhost/paypal/index.php/pay/notify_payment',
        "cancelUrl" => 'http://localhost/paypal/index.php/pay/tempo',
        "requestEnvelope" => $this->envelope
    );

    $response = $this->_paypalSend($createPacket,"Pay");
    $payKey = $response['payKey'];
    $detailsPacket = array(
        "requestEnvelope" => $this->envelope,
        "payKey" => $payKey,
        "receiverOptions" => array(
            array(
                "receiver"=>array(
                    'email'=>'bhomnath@salyani.com.np'),
                    'invoiceData'=>array(
                    'item'=>array(
                        array(
                            "name"=>'product1',
                            "price"=>'1.00',
                            "identifier"=>'P1'
                        ),
                        array(
                             "name"=>'product2',
                            "price"=>'1.00',
                            "identifier"=>'P2'
                        )
                    )
            )),
            array(
                "receiver"=>array(
                    'email'=>'infotechnab_api1@yahoo.com'),
                    'invoiceData'=>array(
                    'item'=>array(
                        array(
                            "name"=>'product3',
                            "price"=>'2.00',
                            "identifier"=>'P1'
                        ),
                        array(
                             "name"=>'product4',
                            "price"=>'2.00',
                            "identifier"=>'P2'
                        )
                    )
            ))
        )
    );

    $response = $this->_paypalSend($detailsPacket,"SetPaymentOptions");

    $dets = $this->getPaymentOptions($payKey);

    header("Location: ".$this->paypalUrl.$payKey);
}