2017-06-30 4 views
1

こんにちは、私は次のセットアップを使用していますペイパルは、イベントがサンドボックス内でトリガされていないウェブフック

  • 作成したPayPalの商人と顧客サンドボックスアカウント
  • 設定済みPayPalのRESTのAPIアプリ
  • を追加しました私のサーバーへのウェブフックURLとそれは実装がhere
を発見したのjavascriptエクスプレスチェックアウトを使用し webhook simulator
  • を使用して動作することを検証してい10

    サンドボックスで通知を表示すると正常に支払いが行われますが、ウェブフックはまだ起動されません???

    以下は、使用しているJavaScript実装のサンプルです。coldfusionスクリプトファイルに埋め込まれているので、ハッシュタグを使用してください。

    `

    var items = #paypalItems#; 
    
    // Render the PayPal button 
    paypal.Button.render({ 
    
        env: '#application.config.paypal.bSandbox ? "sandbox" : "production"#', // sandbox | production 
        commit: true, 
    
        //style the button 
        style: { 
         label: 'pay' 
        }, 
    
        // PayPal Client IDs - replace with your own 
        client: { 
         sandbox: '#application.config.paypal.sandbox_key#', 
         production: '#application.config.paypal.live_key#' 
        }, 
    
        // Wait for the PayPal button to be clicked 
        payment: function(data, actions) { 
    
         // Make a client-side call to the REST api to create the payment 
         return actions.payment.create({ 
          payment: { 
           transactions: [{ 
            amount: { 
             total: #trim(numberFormat(application.oCart.getTotal(bDiscount=1,bShipping=1) , "99999999.99"))#, 
             currency: "AUD", 
             details: { 
             subtotal: #trim(numberFormat(application.oCart.getTotal() - application.oCart.getAmountGST(amount=application.oCart.getTotal(bDiscount=1), addGST=false), "99999999.99"))#, 
             tax: #trim(numberFormat(application.oCart.getAmountGST(amount=application.oCart.getTotal(bDiscount=1), addGST=false), "99999999.99"))#, 
             shipping: #trim(numberFormat(application.oCart.oShipping.getCartShippingAmount(country=session.fcbshoppingCart.order.shippingCountry), "99999999.99"))# 
             } 
            }, 
            invoice_number: "#orderNumber#", 
            item_list: { 
             items: items, 
             shipping_address: { 
             recipient_name: "#session.fcbshoppingCart.customer.firstName# #session.fcbshoppingCart.customer.lastName#", 
             line1: "#session.fcbshoppingCart.order.shippingAddress1#", 
             line2: "#session.fcbshoppingCart.order.shippingAddress2#", 
             city: "#session.fcbshoppingCart.order.shippingSuburb#", 
             country_code: "#paypalCountryCode#", 
             postal_code: "#session.fcbshoppingCart.order.shippingPostCode#", 
             state: "#session.fcbshoppingCart.order.shippingState#" 
             } 
            } 
           }] 
          } 
         }); 
        }, 
    
        // Wait for the payment to be authorized by the customer 
        onAuthorize: function(data, actions) { 
    
         console.log("Paypal Authorize:", data); 
    
         // Execute the payment 
         return actions.payment.execute().then(function(payment) { 
    
          console.log("Paypal Response:", payment); 
    
          //payment has been accepted so we can now generate an order 
          $.ajax({ 
           type: "get", 
           url: "/apps/paypal/createOrder.cfm", 
           data: { 
            transactionNumber: "#orderNumber#", 
            payPalPaymentId: data.paymentID 
           }, 
           dataType: "json", 
           success: function(res) { 
            console.log('edharry create order data', res); 
    
            if(res.BPAYMENTPROCEED) { 
             $('##paypal-message').addClass("show success").text('Payment Successfully Complete!'); 
             //lets redirect to the checkout success page. 
             window.location.href = window.location.origin + '/shop/checkout/confirmation?productOrder=' + res.PRODUCTORDER.OBJECTID; 
            } else { 
             //need to handle a failed transaction 
             $('##paypal-message').addClass("show failure").text('Payment did not complete on server!'); 
            } 
           }, 
           error: function() { 
            //lets show an error 
            $('##paypal-message').addClass("show failure").text('Payment did not complete on server!'); 
           } 
          }) 
    
          $('##paypal-message').addClass("show success").text('Payment Successfully Complete!'); 
         }); 
        }, 
    
        onCancel: function(data) { 
         console.log('The payment was cancelled!'); 
        } 
    
    }, '##paypal-button-container');` 
    
  • 答えて

    0

    これは、ペイパルとの継続的な問題です。彼らはこの問題を認識しており、現在これを解決するために取り組んでいます。

    +0

    この問題に関する最新情報はありますか? – Dimitri

    関連する問題