【问题标题】:Notification Phonegap with paypal form, is not correct带有贝宝形式的通知Phonegap,不正确
【发布时间】:2013-10-18 15:27:30
【问题描述】:

我正在尝试使用Phonegap notification 创建一个确认提醒,显示:您确定要购买吗?是/否。因此,如果您按“是”,您将进入沙盒 Paypal 网站。如果按否,则您在同一页面上。

问题是我无法更改表单中的操作来调用 沙盒贝宝页面。

如果我从 <form action="htpp:sandobox..."> 更改,它无法正常工作。它加载一个主要的贝宝页面,而不是沙盒购买页面。

这是我的代码,有帮助吗?

function onConfirm(button){
    alert("button="+button);
    if(button==2){
        return false;
    }else{
        if(button==1){
           document.form.action="https://www.sandbox.paypal.com/cgi-bin/webscr"; 
           return true;
        }
    }
}

function openPaypal(){
    navigator.notification.confirm(
               'Pressing Yes will continue to the final part of the order, you will not be able to come back from this point.',      // mensaje (message)
                onConfirm,      // función 'callback' a llamar con el índice del botón pulsado (confirmCallback)
               'Personalised Playing Cards: Are you sure?',            // titulo (title)
               'Yes,Cancel'          // botones (buttonLabels)
                );
}
<form  name="formulario" id="formulario" action="" method="post" onSubmit="return openPaypal()">
    <!-- Indica que vamos a hacer una compra tipo boton comprar ahora -->
    <input type="hidden" name="cmd" value="_xclick">
    <!-- Indica que no se presente un campo para notas extras  -->
    <input type="hidden" name="no_note" value="1">
    <!-- la moneda correspondiente  -->
    <input type="hidden" name="currency_code" value="GBP">
    <input  type="image" src="../images/confirmbutton-passive.png" id="button1" style="width:100%; margin: 0px auto;" border="0" name="submit" alt="Comprar" title="Comprar">
</form>

【问题讨论】:

    标签: javascript html cordova paypal


    【解决方案1】:

    主要问题是,如果我从操作中删除 url,我将无法正确加载沙盒 paypal 页面,我可以实现打开沙盒 paypal 但无法看到您购买产品的页面等...您打开另一个贝宝页面,我不知道为什么!!

    如果我不删除操作 URL,当您按“确认表单”时,沙箱页面会直接正确打开,而无需通知的任何许可。

    你的意思是?

    谢谢

    【讨论】:

      【解决方案2】:

      您在测试期间是否登录了http://developer.paypal.com?如果没有,您会得到一个页面,告诉您需要先登录,然后才能使用沙盒。但是,如果您在单独的选项卡中登录,您应该会看到 PayPal 沙箱登录如预期的那样。

      【讨论】:

      • 问题是,如果我改变这个结构,就像表单无法发送到贝宝商店......我不知道为什么......
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-15
      • 2021-07-18
      • 2012-11-08
      • 2013-04-04
      • 2016-07-18
      相关资源
      最近更新 更多