Skip to content

Commit 208a82f

Browse files
Kevin Baptisteaprieels
andcommitted
[IMP] adyen_platforms,payment_odoo: add notification support
- Improved onboarding / KYC flow - Display KYC stage for each "document" (identity, bank account, shareholder, etc.) - Only update to the API what's been updated by the user to prevent undergoing another full round of data verification - Show new pricing - Support refund of adyen.transaction - Simplify payouts (let Adyen automatically handle them) - They are now automatically handled by Adyen and not manually triggered by a cron - "Balance" dashboard - Show the balance per currency - List of payouts and their status - Handle account/transaction notifications - Show split of fees - Details on payment method (card country, card type, etc.) used - Display details from the linked payment.transaction - Verify proxy signature for notifications - Notifications are now signed and authenticity verified TaskID: 2129218 Closes odoo#68952 Co-authored-by: Antoine Prieels <anp@odoo.com>
1 parent 8e33f7c commit 208a82f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1951
-863
lines changed

addons/adyen_platforms/__manifest__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111
'data': [
1212
'data/adyen_platforms_data.xml',
1313
'security/ir.model.access.csv',
14+
'security/ir_rule.xml',
1415
'views/adyen_account_templates.xml',
1516
'views/adyen_account_views.xml',
17+
'views/adyen_bank_account_views.xml',
18+
'views/adyen_shareholder_views.xml',
1619
'views/adyen_transaction_views.xml',
1720
],
1821
'installable': True,
1922
'assets': {
2023
'web.assets_backend': [
24+
'adyen_platforms/static/src/scss/**/*',
2125
'adyen_platforms/static/src/js/**/*',
2226
],
2327
'web.assets_qweb': [
Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,45 @@
1-
# -*- coding: utf-8 -*-
21
# Part of Odoo. See LICENSE file for full copyright and licensing details.
32

3+
import logging
4+
from pprint import pformat
5+
46
from odoo import http
57
from odoo.http import request
68

9+
from odoo.addons.adyen_platforms.util import odoo_payments_proxy_control
10+
11+
_logger = logging.getLogger(__name__)
12+
713

814
class AdyenPlatformsController(http.Controller):
915

1016
@http.route('/adyen_platforms/create_account', type='http', auth='user', website=True)
1117
def adyen_platforms_create_account(self, creation_token):
1218
request.session['adyen_creation_token'] = creation_token
1319
return request.redirect('/web?#action=adyen_platforms.adyen_account_action_create')
20+
21+
@odoo_payments_proxy_control
22+
@http.route('/adyen_platforms/account_notification', type='json', auth='public', csrf=False)
23+
def adyen_platforms_notification(self):
24+
data = request.jsonrequest
25+
_logger.debug('Account notification received: %s', pformat(data))
26+
27+
account = request.env['adyen.account'].sudo().search([('adyen_uuid', '=', data['adyen_uuid'])])
28+
if not account:
29+
_logger.error('Received notification for non-existing account: %s', data['adyen_uuid'])
30+
return
31+
32+
account.with_context(update_from_adyen=True)._handle_notification(data)
33+
34+
@odoo_payments_proxy_control
35+
@http.route('/adyen_platforms/transaction_notification', type='json', auth='public', csrf=False)
36+
def adyen_transaction_notification(self):
37+
data = request.jsonrequest
38+
_logger.debug('Transaction notification received: %s', pformat(data))
39+
40+
account = request.env['adyen.account'].sudo().search([('adyen_uuid', '=', data['adyen_uuid'])])
41+
if not account:
42+
_logger.error('Received notification for non-existing account: %s', data['adyen_uuid'])
43+
return
44+
45+
request.env['adyen.transaction'].sudo()._handle_notification(data)

addons/adyen_platforms/data/adyen_platforms_data.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</record>
1313

1414
<record id="adyen_sync_cron" model="ir.cron">
15-
<field name="name">Adyen Sync</field>
15+
<field name="name">Odoo Payments Sync</field>
1616
<field name="model_id" ref="model_adyen_account"/>
1717
<field name="state">code</field>
1818
<field name="code">model._sync_adyen_cron()</field>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# -*- coding: utf-8 -*-
22
# Part of Odoo. See LICENSE file for full copyright and licensing details.
33

4+
from . import adyen_mixins
45
from . import adyen_account
6+
from . import adyen_bank_account
7+
from . import adyen_kyc
8+
from . import adyen_shareholder
59
from . import adyen_transaction
610
from . import res_company

0 commit comments

Comments
 (0)