Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master mollie #1

Draft
wants to merge 38 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
85ef8d2
[MOLLIE] init commit
pga-odoo Jul 14, 2021
c0d6b97
remove python depandacy
pga-odoo Jul 15, 2021
222e476
[WIP] add custom form
pga-odoo Jul 15, 2021
ca44d3d
WIP
pga-odoo Jul 18, 2021
b361132
WIP component
pga-odoo Jul 19, 2021
9dc8a25
WIP transection values
pga-odoo Jul 20, 2021
ca4bf45
WIP create payment via api
pga-odoo Jul 20, 2021
58ca368
WIP completed whole flow
pga-odoo Jul 21, 2021
f46ede9
WIP completed direct card payment
pga-odoo Jul 21, 2021
4bf7e81
WIP added payment fallback
pga-odoo Jul 21, 2021
fd4cf34
WIP added vouchers and webhook
pga-odoo Jul 21, 2021
ccc3ed0
vouchers improvements
pga-odoo Jul 22, 2021
a35941c
Ref
pga-odoo Jul 22, 2021
226c333
Ref
pga-odoo Jul 22, 2021
1f65586
Ref
pga-odoo Jul 22, 2021
85c9d65
Ref
pga-odoo Jul 22, 2021
8005a82
Ref
pga-odoo Jul 22, 2021
cc447b5
Ref
pga-odoo Jul 22, 2021
9f30b96
webhook comments
pga-odoo Jul 22, 2021
4bee2d7
remove keys from data
pga-odoo Jul 22, 2021
f3b0597
ref mollie.py
pga-odoo Jul 22, 2021
6496a9a
merge api methods
pga-odoo Jul 22, 2021
f8845ec
merge api methods
pga-odoo Jul 22, 2021
ef31e71
reg
pga-odoo Jul 22, 2021
6a060fd
ref
pga-odoo Jul 22, 2021
239d6ff
ref
pga-odoo Jul 22, 2021
ad2e773
ref
pga-odoo Jul 22, 2021
62dab24
ref
pga-odoo Jul 22, 2021
2e55290
ref
pga-odoo Jul 22, 2021
a42cf9b
ref
pga-odoo Jul 22, 2021
62b47a8
ref
pga-odoo Jul 22, 2021
957afba
ref
pga-odoo Jul 22, 2021
66edc6a
ref
pga-odoo Jul 22, 2021
eddc2f1
ref
pga-odoo Jul 22, 2021
0a62608
ref
pga-odoo Jul 22, 2021
fe5fe19
ref
pga-odoo Jul 22, 2021
22af1d5
css ref
pga-odoo Jul 22, 2021
5e6faeb
ref
pga-odoo Jul 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ref
  • Loading branch information
pga-odoo committed Jul 22, 2021
commit 62b47a8505b87cc8ea9a5832ef71469cfbffb8be
12 changes: 6 additions & 6 deletions addons/payment_mollie/models/payment_acquirer.py
Original file line number Diff line number Diff line change
@@ -215,7 +215,7 @@ def _mollie_get_supported_methods(self, order, invoice, amount, currency):
methods = methods.filtered(lambda m: not m.country_ids or country_code in m.country_ids.mapped('code'))

# Hide methods if mollie does not supports them (checks via api call)
supported_methods = self.sudo()._api_mollie_get_active_payment_methods(extra_params=extra_params, silent_errors=True) or {} # sudo as public user do not have access to keys
supported_methods = self.sudo()._api_mollie_get_active_payment_methods(extra_params=extra_params) # sudo as public user do not have access to keys
methods = methods.filtered(lambda m: m.method_code in supported_methods.keys())

return methods
@@ -278,23 +278,23 @@ def _api_mollie_get_active_payment_methods(self, extra_params={}):
params = {'include': 'issuers', 'includeWallets': 'applepay', **extra_params}

# get payment api methods
payemnt_api_methods = self._mollie_make_request('/methods', params=params, method="GET")
if payemnt_api_methods.get('count'):
payemnt_api_methods = self._mollie_make_request('/methods', params=params, method="GET", silent_errors=True)
if payemnt_api_methods and payemnt_api_methods.get('count'):
for method in payemnt_api_methods['_embedded']['methods']:
method['support_payment_api'] = True
result[method['id']] = method

# get order api methods
params['resource'] = 'orders'
order_api_methods = self._mollie_make_request('/methods', params=params, method="GET")
if order_api_methods.get('count'):
order_api_methods = self._mollie_make_request('/methods', params=params, method="GET", silent_errors=True)
if order_api_methods and order_api_methods.get('count'):
for method in order_api_methods['_embedded']['methods']:
if method['id'] in result:
result[method['id']]['support_order_api'] = True
else:
method['support_order_api'] = True
result[method['id']] = method
return result
return result or {}

def _api_mollie_create_payment_record(self, api_type, payment_data):
endpoint = '/orders' if api_type == 'order' else '/payments'