Skip to Content
Menu
This question has been flagged
3 Replies
3361 Views

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
Discard

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

Best Answer

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
Discard
Author Best Answer

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
Discard

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

Best Answer

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
Discard
Related Posts Replies Views Activity
1
Mar 24
1723
0
May 24
1089
3
Jan 25
1900
2
Mar 25
829
1
Sep 24
1219