db = $db; $this->numero = 104900; $this->rights_class = 'mpesapay'; $this->family = 'payment'; $this->name = "M-Pesa Payment Module"; $this->description = "Accept M-Pesa payments in Dolibarr."; $this->version = '1.0.0'; $this->const = array( array('MPESAPAY_PAYBILL', 'chaine', '', 'M-Pesa Paybill Number', 0, 'current', 1), array('MPESAPAY_PASSKEY', 'chaine', '', 'M-Pesa Passkey', 0, 'current', 1) ); $this->module_parts = array('hooks' => array('invoicecard', 'payment')); $this->config_page_url = "mpesapay_setup.php"; $this->dirs = array('/mpesapay'); $this->picto = 'payment'; } // Generate Payment URL function generatePaymentUrl($invoiceId) { $token = base64_encode(hash('sha256', $invoiceId . time())); return DOL_URL_ROOT . "/custom/mpesapay/payment.php?invoice_id={$invoiceId}&token={$token}"; } } ?>