AngularJs PayPal Express Checkout'Access-Control-Allow-Origin'错误

时间:2015-10-01 06:12:56

标签: angularjs paypal cors paypal-sandbox

我正在尝试为我的angularjs应用设置付款,我使用了paypal并开始使用此guide

这是我的http reuqest。

    var req = {
        url: "https://api-3t.sandbox.paypal.com/nvp",
        USER: email,
        PWD: pwd,
        SIGNATURE: sign,
        VERSION: 93,
        METHOD: "SetExpressCheckout",
        PAYMENTREQUEST_0_PAYMENTACTION: "SALE",
        PAYMENTREQUEST_0_AMT: price,
        PAYMENTREQUEST_0_CURRENCYCODE: "USD",
        RETURNURL: returnUrl,
        CANCELURL: cancelUrl
    }
    $http(req).then(function(response){
        console.log("PAYPAL SUCCESS", response);
    }, function(error){
        console.log("PAYPAL ERROR", error);
    })

这是错误。

XMLHttpRequest cannot load https://api-3t.sandbox.paypal.com/nvp. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.

知道为什么会这样吗?

0 个答案:

没有答案