Skip to content

Instantly share code, notes, and snippets.

@MichalKalita
Created August 28, 2020 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MichalKalita/cd5e3e646e1054d4fda8e5eafb7f5d7b to your computer and use it in GitHub Desktop.
Save MichalKalita/cd5e3e646e1054d4fda8e5eafb7f5d7b to your computer and use it in GitHub Desktop.
Ceneo pl report order as a function, typescript
declare global {
interface Window {
ceneo_client_email: string;
ceneo_order_id: string;
ceneo_shop_product_ids: string;
}
}
/**
* API documented on url https://www.ceneo.pl/poradniki/Podrecznik-integracji-ZO-platformy
* @param ceneoGUID
* @param orderID
* @param email
* @param productIDs
*/
export default function ceneoReportOrder(
ceneoGUID: string,
orderID: string | number,
email: string,
productIDs: (string | number)[]
) {
window.ceneo_order_id = "" + orderID;
window.ceneo_client_email = email;
window.ceneo_shop_product_ids = "#" + productIDs.join("#") + "#";
const script = document.createElement("script");
script.src =
"https://ssl.ceneo.pl/transactions/track/v2/script.js?accountGuid=" +
ceneoGUID;
document.head.appendChild(script);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment