added gk lib for appenablement
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
var oAppEnablementCommonInstance = new comGkSoftwareGkrAppEnablementApi.Common();
|
||||
var oAppEnablementPosInstance = new comGkSoftwareGkrAppEnablementApi.Pos();
|
||||
var oAppEnablementPosEXTInstance = new comGkSoftwareGkrAppEnablementApi.Pos_EXT();
|
||||
|
||||
async function searchCompany() {
|
||||
const country = document.getElementById("country").value;
|
||||
const vatNumber = document.getElementById("vat_number").value.trim();
|
||||
@@ -56,6 +60,14 @@ function saveData() {
|
||||
};
|
||||
|
||||
alert(JSON.stringify(payload, null, 2));
|
||||
|
||||
|
||||
var customer = {
|
||||
"customerId":"17600703312990"
|
||||
}
|
||||
var oRegisterCustomerRequest = JSON.stringify(customer)
|
||||
oAppEnablementPosInstance.registerCustomer('registerDataOk', 'registerDataFailed', oRegisterCustomerRequest);
|
||||
|
||||
}
|
||||
|
||||
function clearForm() {
|
||||
@@ -81,5 +93,35 @@ function updateVatPlaceholder() {
|
||||
}
|
||||
}
|
||||
|
||||
function closeBrowser() {
|
||||
oAppEnablementCommonInstance.closeBrowser();
|
||||
}
|
||||
|
||||
// customer registration - uses standard Pos
|
||||
|
||||
function registerLoyaltyCall(customerId) {
|
||||
var request = JSON.stringify({
|
||||
"customerId": customerId,
|
||||
"customerServiceTypeCode": null,
|
||||
"preferredReceiptPrintoutTypeCode": null
|
||||
});
|
||||
|
||||
oAppEnablementPosInstance.registerCustomer(
|
||||
'onSuccess',
|
||||
'onError',
|
||||
request
|
||||
);
|
||||
}
|
||||
|
||||
// Callback functions
|
||||
function onSuccess(result) {
|
||||
document.getElementById("status").textContent = "Thank you.";
|
||||
closeBrowser();
|
||||
}
|
||||
|
||||
function onError(error) {
|
||||
document.getElementById("status").textContent = "Company registration in receipt failed. Please try again.";
|
||||
}
|
||||
|
||||
document.getElementById("country").addEventListener("change", updateVatPlaceholder);
|
||||
window.addEventListener("DOMContentLoaded", updateVatPlaceholder);
|
||||
|
||||
Reference in New Issue
Block a user