- Server operating system version
- Centos 7
- Plesk version and microupdate number
- 18.0.40 Update #1
I'm trying to add external payment method integration to my React app. I'm sending a fetch request to the external payment method's API application, but I'm getting the following error.
This is my fetch code.
I got this error
THIS ARTICLE NOT WORKING... !!!
https://support.plesk.com/hc/en-us/...s-origin-resource-sharing-in-Plesk-for-Linux-
This is my fetch code.
JavaScript:
async getPaymentsAccessToken() {
const msg = await request<PaymentsAccessTokenResponse>(`https://apitest.crossdomain.com/accesstoken/get`, {
method: 'POST',
prefix: undefined,
mode: 'cors',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
client_id: this.client.client_id,
client_secret: this.client.client_secret,
'Ocp-Apim-Subscription-Key': this.client['Payments-Subscription-Key'],
},
});
return msg;
}
I got this error
None of the settings I made on Plesk Apache and Nginx work.Access to fetch at 'https://apitest.crossdomain.com/accesstoken/get' from origin 'mydomain.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
THIS ARTICLE NOT WORKING... !!!
https://support.plesk.com/hc/en-us/...s-origin-resource-sharing-in-Plesk-for-Linux-