I am trying to call a global variable from a 3rd party service’s file that I fetched. However, I am unable to do so and have been getting a ‘Checkout is not defined’ error. Any ideas on how to do that? Thank you.
const proxyurl = "https://cors-anywhere.herokuapp.com/";
const url = "https://ap-gateway.mastercard.com/checkout/version/57/checkout.js"; //
const res = await fetch(proxyurl + url);
const data = await res.text();
console.log(data);
Checkout.configure({
session: {
id: '111111'
},
interaction: {
merchant: {
name: 'Your merchant name',
address: {
line1: '200 Sample St',
line2: '1234 Example Town'
}
}
}
});