Skip to content

Commit

Permalink
[REF] apply pre-commit
Browse files Browse the repository at this point in the history
Applying pre-commit rules and fixing bad code according to it.
  • Loading branch information
oerp-odoo committed Dec 14, 2023
1 parent 51bc9ff commit 409e9d2
Show file tree
Hide file tree
Showing 60 changed files with 6,238 additions and 2,546 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Build VSF

on:
push:
branches: [ 16.0 ]
branches: [16.0]

jobs:
deployment:
runs-on: self-hosted
steps:
- run: |
echo "-------- Deploying https://vsfdemo16.labs.odoogap.com/ "
/home/egap/.scripts/update
- run: |
echo "-------- Deploying https://vsfdemo16.labs.odoogap.com/ "
/home/egap/.scripts/update
1 change: 0 additions & 1 deletion payment_adyen_vsf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2023 ODOOGAP/PROMPTEQUATION LDA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

Expand Down
34 changes: 13 additions & 21 deletions payment_adyen_vsf/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
# -*- coding: utf-8 -*-
# Copyright 2023 ODOOGAP/PROMPTEQUATION LDA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
# Application Information
'name': 'Adyen Payment Acquirer to VSF',
'category': 'Accounting/Payment Acquirers',
'version': '16.0.1.0.1',
'summary': 'Adyen Payment Acquirer: Adapting Adyen to VSF',

"name": "Adyen Payment Acquirer to VSF",
"category": "Accounting/Payment Acquirers",
"version": "16.0.1.0.1",
"summary": "Adyen Payment Acquirer: Adapting Adyen to VSF",
# Author
'author': "OdooGap",
'website': "https://www.odoogap.com/",
'maintainer': 'OdooGap',
'license': 'LGPL-3',

"author": "OdooGap",
"website": "https://www.odoogap.com/",
"maintainer": "OdooGap",
"license": "LGPL-3",
# Dependencies
'depends': [
'payment',
'payment_adyen'
],

"depends": ["payment", "payment_adyen"],
# Views
'data': [],

"data": [],
# Technical
'installable': True,
'application': False,
'auto_install': False,
"installable": True,
"application": False,
"auto_install": False,
}
69 changes: 37 additions & 32 deletions payment_adyen_vsf/const.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
# -*- coding: utf-8 -*-
# Copyright 2023 ODOOGAP/PROMPTEQUATION LDA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo.addons.payment_adyen.const import API_ENDPOINT_VERSIONS, CURRENCY_DECIMALS, RESULT_CODES_MAPPING
from odoo.addons.payment_adyen.const import API_ENDPOINT_VERSIONS, CURRENCY_DECIMALS

# Endpoints of the API.
# See https://docs.adyen.com/api-explorer/#/CheckoutService/v67/overview for Checkout API
# See https://docs.adyen.com/api-explorer/#/Recurring/v49/overview for Recurring API
API_ENDPOINT_VERSIONS.update({
'/payments/{}/reversals': 67, # Checkout API
})
# See for Checkout API:
# https://docs.adyen.com/api-explorer/#/CheckoutService/v67/overview
# See for Recurring API:
# https://docs.adyen.com/api-explorer/#/Recurring/v49/overview
API_ENDPOINT_VERSIONS.update(
{
"/payments/{}/reversals": 67, # Checkout API
}
)

# Adyen-specific mapping of currency codes in ISO 4217 format to the number of decimals.
# Only currencies for which Adyen does not follow the ISO 4217 norm are listed here.
# See https://docs.adyen.com/development-resources/currency-codes
CURRENCY_DECIMALS.update({
"BHD": 3,
"DJF": 0,
"GNF": 0,
"JOD": 3,
"JPY": 0,
"KMF": 0,
"KRW": 0,
"KWD": 3,
"LYD": 3,
"OMR": 3,
"PYG": 0,
"RWF": 0,
"TND": 3,
"UGX": 0,
"VND": 0,
"VUV": 0,
"XAF": 0,
"XOF": 0,
"XPF": 0,
"USD": 2,
"EUR": 2,
"SEK": 2,
"DKK": 2,
})
CURRENCY_DECIMALS.update(
{
"BHD": 3,
"DJF": 0,
"GNF": 0,
"JOD": 3,
"JPY": 0,
"KMF": 0,
"KRW": 0,
"KWD": 3,
"LYD": 3,
"OMR": 3,
"PYG": 0,
"RWF": 0,
"TND": 3,
"UGX": 0,
"VND": 0,
"VUV": 0,
"XAF": 0,
"XOF": 0,
"XPF": 0,
"USD": 2,
"EUR": 2,
"SEK": 2,
"DKK": 2,
}
)
1 change: 0 additions & 1 deletion payment_adyen_vsf/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2023 ODOOGAP/PROMPTEQUATION LDA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

Expand Down
25 changes: 17 additions & 8 deletions payment_adyen_vsf/controllers/apple_pay.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
# -*- coding: utf-8 -*-
# Copyright 2023 ODOOGAP/PROMPTEQUATION LDA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

import os

from odoo import http
from odoo.http import request
import os


class AppleMerchantIDController(http.Controller):

@http.route('/.well-known/apple-developer-merchantid-domain-association', type='http', auth='public')
@http.route(
"/.well-known/apple-developer-merchantid-domain-association",
type="http",
auth="public",
)
def apple_merchant_id(self, **kw):
file_path = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', 'static', 'description', 'apple-developer-merchantid-domain-association')
file_path = os.path.abspath(
os.path.join(
os.path.dirname(__file__),
"..",
"static",
"description",
"apple-developer-merchantid-domain-association",
)
)

try:
with open(file_path, 'r') as file:
with open(file_path) as file:
file_content = file.read()

headers = [('Content-Type', 'text/plain')]
headers = [("Content-Type", "text/plain")]
return request.make_response(file_content, headers)

# Return error 404 - Not Found
Expand Down
Loading

0 comments on commit 409e9d2

Please sign in to comment.