orderiom-api-package
Advanced tools
Comparing version 0.4.73 to 0.4.74
{ | ||
"name": "orderiom-api-package", | ||
"version": "0.4.73", | ||
"version": "0.4.74", | ||
"description": "This package will install all necessary API calls for every orderiom restaurant", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1117,33 +1117,17 @@ import { | ||
}, | ||
payTableExternalOrder( | ||
{ rootState }, | ||
{ tablePaymentId, paymentType, qrcode = null, pin = null } | ||
) { | ||
return $http | ||
.post("/api/table-payments/pay", { | ||
tablePaymentId, | ||
paymentType, | ||
...(paymentType === "payFix" && { | ||
qrCode: qrcode, | ||
pin: pin, | ||
}), | ||
}) | ||
.then((res) => { | ||
window.location = res.data.data.paymentLink; | ||
return res; | ||
}) | ||
.catch(commonErrorCallback()); | ||
broadcastTablePaymentEvent({ commit }, { tablePaymentId, basketItems, action, socketId}) { | ||
$http.interceptors.request.use((config) => { | ||
// we need to send this header so we don't receive events | ||
// dispatched by the same client | ||
if (socketId) { | ||
config.headers['X-Socket-Id'] = socketId; | ||
} | ||
return config; | ||
}); | ||
return $http.post('/api/table-payments/events', { | ||
tablePaymentId, | ||
basketItems, | ||
action | ||
}).catch(commonErrorCallback()); | ||
}, | ||
updateTablePaymentStatus({ commit }, { tablePaymentId, status , orderId }) { | ||
return $http | ||
.get(`/api/table-payments/update`, { | ||
params: { tablePaymentId, status, orderId }, | ||
}) | ||
.then((res) => { | ||
const status = res.data.data.status; | ||
commit("setTablePaymentStatus", status); | ||
return res; | ||
}) | ||
.catch(commonErrorCallback()); | ||
}, | ||
getExternalTableOrdersFromPayment({ commit }, { tablePaymentId }) { | ||
@@ -1150,0 +1134,0 @@ return $http |
127641
3195