Hi, I'm a software developer new to Odoo and want to develop a new module so that customers can pay with an electronic community local currency. I'm a bit confused about Odoo structure so I'd appreciate help on how to structure it.
The goal is to have an additional payment method in PoS. When this payment is selected, an API call is done and the payment is either fulfilled or rejected immediately. The customer payment account needs to be previously registered as part of the customer data, and of course this method does not work unless the seller identifies the customer.
The question is: how this should be done in terms of architecture? More concrete questions:
- How to do an API call before PoS validate the payment? I've been able to add new Payment methods in PoS through Journals, but they get automatically verified. I'd like to have a hook so that it only verifies the payment if the call to the payment gateway returns ok, and show an error message otherwise.
- How to add the account to customers? I understand that the proper way is to add a new bank account to each customer, and therefore probably create a new Bank for the local currency. Perhaps a new account type too (the account numbers are not standard).
Thanks!