Calling function from 3rd party service

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'            
                    }    
                }
           }
        });

You will need to read about how to access 3rd party services in the article Corvid: How to Access 3rd-Party Services with the Fetch API .

A nice simple example to start with is Create a Weather Widget . Also, t ake a look at the Advanced examples , many of them access 3rd party services. A couple of good examples to start with are: Example: Using the Places API from Google Maps services and Example: Send email with the SendGrid REST interface .

You will need to check with the service provider’s technical support to find out how to use their API.