Payfort CORS Error Payment API

732 views Asked by At

Integrating Payfort from client side but I am getting CORS error on second step. Have done this integration using ASP.Net and it worked fine.

Is it that payfort does not support client side integration? Below is the response enter image description here

Below is the code

 _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

There are 0 answers