从客户端集成 Payfort,但我在第二步遇到 CORS 错误。已使用 ASP.Net 完成此集成,并且运行良好。
下面是代码
_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);
}