| 1 |
import { patch } from "@web/core/utils/patch"; |
| 2 |
import { PosStore } from "@point_of_sale/app/services/pos_store"; |
| 3 |
|
| 4 |
patch(PosStore.prototype, { |
| 5 |
// Override |
| 6 |
async setup() { |
| 7 |
await super.setup(...arguments); |
| 8 |
this.data.connectWebSocket("MERCADO_PAGO_LATEST_MESSAGE", (payload) => { |
| 9 |
if (payload.config_id === this.config.id) { |
| 10 |
const pendingLine = this.getPendingPaymentLine("mercado_pago"); |
| 11 |
|
| 12 |
if (pendingLine) { |
| 13 |
pendingLine.payment_method_id.payment_terminal.handleMercadoPagoWebhook(); |
| 14 |
} |
| 15 |
} |
| 16 |
}); |
| 17 |
}, |
| 18 |
}); |