在Windows中加载WePay嵌入式Checkout IFrame时出错

时间:2015-01-27 09:01:19

标签: javascript cakephp iframe

我正在尝试设置WePay API以通过Embedded Checkout在我的网站上接受付款,我遇到了一些问题。该网站目前托管在我的本地机器上进行测试,并在Cakephp中创建。当我在我正在使用Linux操作系统在浏览器(谷歌浏览器,Firefox)中执行它.IFrame正确加载了很多次,但如果我尝试在Windows操作系统浏览器(Firefox,谷歌浏览器)中执行它,我们只会加载2次wepay IFrame结帐,之后,它没有加载IFrame。

内部控制器:

Wepay::useStaging($client_id, $client_secret);

$wepay = new WePay($access_token);

try {
    $checkout= $wepay->request('/checkout/create', array(
        'account_id' => $account_id, 
        'amount' => $amount,
        'short_description' => "this is a test payment",
        'type' => "donation",
        'redirect_uri'=> LIVE_SITE.'/users/thanks/'.$aid.'/'.$lid,
        'mode' => "iframe"

        )
    );
}
catch (WePayException $e) {
    $error = $e->getMessage();
}

$this->set('checkoutnews',$checkout); 

在查看文件下:

        <script type="text/javascript" src="https://stage.wepay.com/js/iframe.wepay.js">
        </script>

        <script type="text/javascript">
        WePay.iframe_checkout("checkout_div", "<?php echo $checkoutnews->checkout_uri ?>");
        </script>

1 个答案:

答案 0 :(得分:2)

替换:

'mode' => 'iframe'

'hosted_checkout' => ['mode' => 'iframe']