2017-06-20 3 views
0

Wenn wir checkout.js für die Express Checkout-Schaltfläche verwenden, bin ich mir nicht sicher, was CREATE_PAYMENT_URL eigentlich sein soll?PayPal Express Checkout CREATE_PAYMENT_URL

Soll das unsere sandbox.paypal.com Website sein?

Ich traf die Express Checkout-Taste auf meiner Website, und ich bekomme 404 Fehler, sagen, dass was auch immer URL (ich weiß, nicht die '', die derzeit dort ist) ich als CREATE_PAYMENT_URL nicht als Ressource gefunden werden kann.

   var CREATE_PAYMENT_URL = ''; 
       var EXECUTE_PAYMENT_URL = ''; 

       paypal.Button.render({ 
        env: 'sandbox', // Or 'sandbox', 
        commit: true, // Show a 'Pay Now' button 

        payment: function(resolve, reject) { 
         return paypal.request.post(CREATE_PAYMENT_URL).then(function (data) { 
          resolve(data.paymentID); 
         }) 
          .catch(function (err) { 
           reject(err); 
          }); 
        }, 
        onAuthorize: function(data, actions) { 
         return paypal.request.post(EXECUTE_PAYMENT_URL, { 
          paymentID: data.paymentID, 
          payerID: data.payerID 
         }).then(function() { 

          // The payment is complete! 
          // You can now show a confirmation message to the customer 
         }); 
        } 

       }, '#paypal-button'); 

Antwort

Verwandte Themen