Created
August 28, 2020 17:03
-
-
Save MichalKalita/cd5e3e646e1054d4fda8e5eafb7f5d7b to your computer and use it in GitHub Desktop.
Ceneo pl report order as a function, typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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