Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
5349 Visualizzazioni

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
Abbandona

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

Risposta migliore

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
Abbandona
Autore Risposta migliore

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
Abbandona

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

Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
mar 24
2992
0
mag 24
1659
1
set 25
2649
3
gen 25
6590
2
giu 25
2441