Your purchase details:
Thanks so much for your payment.
For your own records, the details of your purchase are as follows:
Item:
Payment Date:
Payment Amount:
As mentioned, we have partnered with Stripe Payments in order to keep your payment fully secure.

You will have received a separate receipt to your email. If you have any questions, please feel free to contact us at your convenience.
Thanks again
Rachel,
Accounts Team,
Corporate Governance Institute.
Email me at [email protected].
/* =================
* PayPal Payment Receipt
* ================= */
/* PayPal Receipt section elements to be replaced by URL paramter values */
const studentNameEl = document.getElementById('customer-name');
const studentEmailEl = document.getElementById('customer-email-wrapper');
const paymentDescriptionlEl = document.getElementById('payment-description');
const itemNameEl = document.getElementById('item-name');
const paymentDateEl = document.getElementById('payment-date');
const paymentAmountEl = document.getElementById('payment-amount');
/* Receipt Section Elements */
const paypalReceiptSection = document.getElementById('paypal-receipt-section');
const stripeReceiptSection = document.getElementById('stripe-receipt-section');
/* Create new URL object so that paramters can be taken from it */
var currentUrl = window.location.href;
var url = new URL(currentUrl);
var paypalFormIdParameter = url.searchParams.get("PayerID");
if(paypalFormIdParameter) {
/* Custom value parameter to JSON object */
var customParameter = url.searchParams.get("custom");
var paymentType = url.searchParams.get("option_selection1");
var customParamterObject = JSON.parse(customParameter);
/* Get values of parameters passed in */
var studentName = customParamterObject.sName;
var studentEmail = customParamterObject.sEmail;
console.log(typeof paymentType);
var paymentDate = url.searchParams.get("payment_date");
var itemName = url.searchParams.get("item_name");
var amountPaid = url.searchParams.get("mc_gross");
var currencyUsed = url.searchParams.get("mc_currency");
/* Place text from URL parameters into PayPal Receipt sectiomn */
studentNameEl.innerText = studentName;
studentEmailEl.innerHTML = `
${studentEmail}`;
paymentDescriptionlEl.innerText = paymentType;
itemNameEl.innerText = itemName;
paymentDateEl.innerText = paymentDate;
paymentAmountEl.innerText = `${amountPaid} ${currencyUsed}`;
/* Switch visibility of two forms */
paypalReceiptSection.style.display = 'block';
stripeReceiptSection.style.display = 'none';
}
/* =================
* Loading bar JS
* ================= */
const emailFound = document.getElementById('customer-email');
const paymentDescription = document.getElementById('payment-description').innerText;
const loaderSection = document.getElementById('loader');
const loadingAccessText = document.getElementById('loading-access-text');
const prefeNotToWaitText = document.getElementById("prefer-not-to-wait-text");
const getStartedBtn = document.getElementById('get-started-btn');
const courseAccessLoader = document.getElementById('course-access-loader-section');
if(paymentDescription === 'Full Amount' || !paymentDescription.includes('Deposit')) {
if(emailFound) {
/* Change loading text */
const loadingText = document.getElementById('loading-text');
var loadingMessagesCounter = 0;
const loadingMessages = ['Getting everything ready','Setting up your account','Preparing the certificate content','Enrolling you to the certificate','Creating the certificate assessment','Adding you to the certificate assessment','Loading the modules with knowledge.','Completing our final checks','Silence the distractions and get ready to learn.'];
const changeMessage = () => {
if(loadingMessagesCounter !== loadingMessages.length) {
loadingText.innerText = loadingMessages[loadingMessagesCounter];
loadingMessagesCounter += 1;
} else {
clearInterval(changeLoadingMessageLoop);
}
}
changeMessage();
var changeLoadingMessageLoop = setInterval(changeMessage, 15000);
/* Change Welcome text and Get started button link */
const customerName = document.getElementById('customer-name').innerText;
const firstName = customerName.split(" ").shift();
const welcomeName = document.getElementById('welcome-name').innerText = ` ${firstName}`;
const customerEmail = emailFound.innerText;
const courseBtn = document.getElementById('course-link-btn');
courseBtn.href = `https://courses.thecorporategovernanceinstitute.com/users/express_signin?email=${customerEmail}`;
// Online DipCorpGov Module 2 thinkific course id
const courseId = '1336573';
// Interval
var counter = 0;
/* Check if user is enroled */
const checkUserInLms = async email => {
if(counter < 50) {
const thinkificURL = `https://tcgi-api.netlify.app/api/lms-account-status?user_email=${encodeURIComponent(email)}&course_id=${courseId}`;
const thinkificSearchForUser = await fetch(thinkificURL, {
method: 'GET'
});
const searchForUserToJson = await thinkificSearchForUser.json();
counter += 1;
if(searchForUserToJson.userFound) {
clearInterval(requestLoop);
clearInterval(changeLoadingMessageLoop);
loaderSection.style.display = 'none';
courseBtn.style.display = 'inline-block';
getStartedBtn.style.display = 'none';
loadingAccessText.innerText = 'You now have access to the learning platform and all your course material. Enjoy your learning experience.';
prefeNotToWaitText.style.display = 'none';
}
} else {
clearInterval(requestLoop);
clearInterval(changeLoadingMessageLoop);
}
}
checkUserInLms(customerEmail);
var requestLoop = setInterval(checkUserInLms, 5000, customerEmail);
}
} else {
courseAccessLoader.style.display = 'none';
}