Repository
odoo/odoo · module folder
Module version
1.0
Category
Sales/Point of Sale
Folder size
0.56 MB
License
LGPL-3
Application
No
Auto-installable
No
Website
None
Last tracking update
2026-08-08 22:45:31
Authors
Odoo S.A.
Maintainers
Odoo S.A.
Committers
Odoo Translation Bot, Dylan Kiss (dyki), Max Whale, Radu Macocian (admac), Léopold Cantraine
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
None
Description

Code Analysis

Views touched (1)
XML IDNameModelTypeStatus
pos_payment_method_view_form_inherit_pos_safaricom pos.payment.method.form.inherit.safaricom pos.payment.method form Inherits point_of_sale.pos_payment_method_view_form
HTTP endpoints (3)
Route(s)HandlerAuthTypeMethodsFlags
/c2b/confirmation/callback SafaricomController.c2b_confirmation_callback public http POST csrf off sudo
/c2b/validation/callback SafaricomController.c2b_validation_callback public http POST csrf off sudo
/pos_safaricom/callback SafaricomController.safaricom_callback public http POST csrf off sudo
Models touched (2)

New fields (6)
  • business_short_code Char
    help="The business short code and till number combination as 'shortcode-tillnumber' (ex: 123456-789012)" string='Business Short Code'
  • consumer_key Char
    string='Consumer Key'
  • consumer_secret Char
    string='Consumer Secret'
  • passkey Char
    help='The passkey is used to generate the password for the STK Push' string='Passkey'
  • safaricom_payment_type Selection
    default='mpesa_express' selection=[('mpesa_express', 'M-PESA Express'), ('lipa_na_mpesa', 'Lipa na M-PESA')] string='Payment Type'
  • safaricom_test_mode Boolean
    default=True help='Use sandbox environment' string='Test Mode'
Public methods (5)
  • create(self, vals_list)
    @api.model_create_multi
    Override create to automatically register URLs for Lipa na M-PESA payment methods
  • generate_qr_code(self, data)
    Generate QR Code for Lipa na M-PESA with all informations needed to pay
  • lipa_na_mpesa_register_urls(self)
    Register C2B URLs for Lipa na M-PESA The ValidationURL is the URL that will be called to validate the payment before charges the customer if business has activated it. The ConfirmationURL is the URL that will be called when the payment is successful or unsuccessful. The ResponseType is set to Completed to charge the customer even if the ValidationURL returns an error or is unreachable. This is a one-time API call. URLs should only be registered once unless force_register is True.
  • mark_transaction_used(self, transaction_id)
  • mpesa_express_send_payment_request(self, data)
    Send STK Push payment request to customer's phone

New fields (5)
  • amount Integer
    string='Amount'
  • name Char
    string='Name'
  • number Char
    string='Number'
  • received_at Datetime
    string='Received At'
  • trans_id Char
    string='Transaction ID'
Public methods (0)

No public methods.