0

を使用して、次のような確認アラートを作成しようとしてPhonegap notificationいます: 本当に購入しますか? はい・いいえ。したがって、はいを押すと、サンドボックスの Paypal Web に移動します。いいえを押すと、同じページにいます。

問題は、フォームのアクションを変更してサンドボックスのペイパル ページを呼び出すことができないことです。

から変更すると、<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>
4

2 に答える 2

0

主な問題は、アクションから URL を削除すると、サンドボックスのペイパル ページを正しく読み込めないことです。サンドボックスのペイパルを開くことはできますが、商品の購入を確認できるページは表示されません。ペイパルのページ、理由がわかりません!!

また、アクション URL を削除しない場合、「確認フォーム」を押すと、通知からの許可なしにサンドボックス ページが直接正しく開かれます。

ということですか?

ありがとう

于 2013-10-11T08:16:05.290 に答える
0

テスト中にhttp://developer.paypal.comにサインインしていますか? そうでない場合は、サンドボックスを使用する前にサインインする必要があることを示すページが表示される可能性があります。ただし、別のタブでサインインしている場合は、期待どおりに PayPal サンドボックス ログインが表示されるはずです。

于 2013-10-11T03:23:10.603 に答える