Payfort CORS错误付款API

时间:2017-09-05 12:15:18

标签: javascript cors payfort

从客户端整合Payfort,但我在第二步遇到CORS错误。 使用ASP.Net完成了这种集成,并且工作正常。

payfort不支持客户端集成吗? 以下是回复 enter image description here

以下是代码

 _getAPIData = (paymentData) => {
    var apiData = {};
    apiData.command = paymentData.cmsData.command;
    apiData.currency = paymentData.currency;
    apiData.eci = paymentData.cmsData.eci;
    apiData.amount = paymentData.price;
    apiData.token_name = parseQueryString("token_name");
    apiData.merchant_reference = paymentData.merchantReference;
    apiData.customer_email = paymentData.cmsData.customerEmail;
    apiData.customer_ip = paymentData.cmsData.customerIP;
    apiData.remember_me = paymentData.cmsData.rememberMe;
    apiData.access_code = paymentData.cmsData.accessCode;
    apiData.merchant_identifier = paymentData.cmsData.merchantIdentifier;
    apiData.language = paymentData.language;
    apiData.return_url = paymentData.cmsData.interMediatePageUrl2;
    apiData.signature = paymentData.signature;

    return apiData;
}
_get3dUrl = (paymentData) => {
    let apiData = this._getAPIData(paymentData);
    let payfortConfig = {
        method: "POST",
        url: paymentData.cmsData.payFortUrl2,
        headers: {
            "Content-Type": "application/json",
            "Accept": "application/json",
        },
        data: apiData
    }
    debugger;
    // return api.platformService(payfortConfig);
    return axios(payfortConfig);
}

0 个答案:

没有答案