window.addEventListener("message", function receiveMessage(event) {

 if (event.origin !== "https://clouderp.io")

    return;


 // event.data is {approvalType: "",authNum: "",referenceNumber: "1234567",voucherNumber: "1234567",transactionSum: 100,numOfPayments: 1,otherPaymentsSum: 0,firstPaymentSum: 0}

});