Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
5134 Vistas

Hi

I am developing a custom payment provider and I can't find a way to do it.

My goal is to appear on the payment providers list and set the Journal to bank


__manifest__.py
{

'name': 'Payment Provider: CreateTest',

  'version': '1.0',

'category': 'Payment',

'depends': ['payment'],

'data': [ 'data/data.xml',

'views/templates.xml', ],

'installable': True,

'auto_install': False,

'license': 'LGPL-3',

}


models.py

from odoo import models, fields
class CreateTestPaymentProvider(models.Model):

_inherit = 'payment.provider'
​code = fields.Selection(selection_add=[('createtest', ​'CreateTest')], ondelete={'createtest': 'set default'})


data.xml (Sorry, I am not allowed xml tags in the msg)

odoo

​record id="payment.payment_provider_create_test" model="payment.provider"

​field name="name">CreateTest

​field name="code">createtest

​record

odoo


When I Install this module and when I go to Payment Providers it doesn't allow me to select Journal (Bank).


Also, this payment provider doesn't appear account_payment_method_line database where all other installed providers Demo and Stripe do.


Is there proper documentation for how to develop payment provider in odoo? I see that I am clearly missing some steps.

Avatar
Descartar

There is no documentation yet, but it is planned (count a few weeks/months). In the meantime, it's probably best to start with an existing standard payment provider module and convert it step by step to the provider you want to integrate with. I recommend starting with https://github.com/odoo/odoo/tree/16.0/addons/payment_flutterwave

Mejor respuesta

Hi,

Inherit the payment.provider and add this code


@api.model

def _get_payment_method_information(self):

"""Override to add createtest payment method information to the

existing methods.

"""

res = super()._get_payment_method_information()

res['createtest'] = {'mode': 'unique', 'domain': [('type', '=', 'bank')]}

return res
After completing these steps, your custom payment provider should appear on the list of available payment providers, and you can set the journal to "bank" as specified in your code. 

Hope it helps

Avatar
Descartar
Autor Mejor respuesta

Reverse engineering doesn't help. My custom module (payment provider) works and I can implement post-processing steps with it. But the main issue is it doesn't connect with account_payment_method table and I cannot assign payment journal. That means upon activating my custom payment provider it doesn't perform some silly steps that are eiher hidden from community or this is lacking some major support.

Avatar
Descartar

I am also stuck in the same situation. Do you have any guidance on how to implement a custom payment provider?

Mejor respuesta

Hi,


There is no official documentation for the same. But you can refer to existing payment providers and develop your own provider. Other than default payment providers you have a lot of third party payment providers which is available for free in the odoo app store, to which you can look to understand how the module is developed and working.

Thanks

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 24
2880
0
may 24
1611
3
ene 25
4975
2
jun 25
2321
1
sept 24
2479