-
BINacquirer_payplug/.DS_Store
-
11acquirer_payplug/__init__.py
-
48acquirer_payplug/__manifest__.py
-
3acquirer_payplug/controllers/__init__.py
-
227acquirer_payplug/controllers/main.py
-
125acquirer_payplug/controllers/portal.py
-
4acquirer_payplug/datas/neutralize.sql
-
18acquirer_payplug/datas/payment_icon_data.xml
-
40acquirer_payplug/datas/payment_provider_data.xml
-
614acquirer_payplug/i18n/fr.po
-
3acquirer_payplug/models/__init__.py
-
159acquirer_payplug/models/payment_provider.py
-
271acquirer_payplug/models/payment_transaction.py
-
BINacquirer_payplug/static/.DS_Store
-
BINacquirer_payplug/static/description/MOCKUP_PAIEMENT_EN.png
-
BINacquirer_payplug/static/description/banner.png
-
BINacquirer_payplug/static/description/icon.png
-
161acquirer_payplug/static/description/index.html
-
271acquirer_payplug/static/src/css/website_oney.css
-
BINacquirer_payplug/static/src/img/icon/american_express.png
-
BINacquirer_payplug/static/src/img/icon/amex/payment_amex_icon.png
-
BINacquirer_payplug/static/src/img/icon/bancontact.png
-
BINacquirer_payplug/static/src/img/icon/icon-cb.png
-
BINacquirer_payplug/static/src/img/icon/icon-mastercard.png
-
BINacquirer_payplug/static/src/img/icon/icon-visa.png
-
BINacquirer_payplug/static/src/img/icon/oney/3x-gray.png
-
BINacquirer_payplug/static/src/img/icon/oney/3x-green.png
-
BINacquirer_payplug/static/src/img/icon/oney/4x-gray.png
-
BINacquirer_payplug/static/src/img/icon/oney/4x-green.png
-
BINacquirer_payplug/static/src/img/icon/oney/icon_oney_3x4x_1.png
-
BINacquirer_payplug/static/src/img/icon/oney/icon_oney_3x4x_2.png
-
BINacquirer_payplug/static/src/img/icon/oney/icon_oney_3x4x_3.png
-
BINacquirer_payplug/static/src/img/icon/oney/logo-oney-3xpayant-gray.png
-
BINacquirer_payplug/static/src/img/icon/oney/logo-oney-3xpayant.png
-
BINacquirer_payplug/static/src/img/icon/oney/logo-oney-4xpayant-gray.png
-
BINacquirer_payplug/static/src/img/icon/oney/logo-oney-4xpayant.png
-
BINacquirer_payplug/static/src/img/icon/oney/payment_oney_icon.png
-
BINacquirer_payplug/static/src/img/icon/oney/popin-pedagogique.png
-
BINacquirer_payplug/static/src/img/icon/oney/spinner1.gif
-
BINacquirer_payplug/static/src/img/icon/oney/spinner2.gif
-
BINacquirer_payplug/static/src/img/icon/oney/title_popup.png
-
BINacquirer_payplug/static/src/img/icon/payplug/button_logo.png
-
BINacquirer_payplug/static/src/img/icon/payplug/payment_payplug_icon.png
-
BINacquirer_payplug/static/src/img/icon/payplug/payplug_icon.png
-
199acquirer_payplug/static/src/js/website_oney.js
-
338acquirer_payplug/views/payment_provider_oney_template.xml
-
336acquirer_payplug/views/payment_provider_template.xml
-
168acquirer_payplug/views/payment_provider_view.xml
-
31acquirer_payplug/views/payment_transaction_view.xml
@ -0,0 +1,11 @@ |
|||||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details. |
||||
|
from . import controllers |
||||
|
from . import models |
||||
|
|
||||
|
from odoo.addons.payment import setup_provider, reset_payment_provider |
||||
|
|
||||
|
def post_init_hook(cr, registry): |
||||
|
setup_provider(cr, registry, 'payplug') |
||||
|
|
||||
|
def uninstall_hook(cr, registry): |
||||
|
reset_payment_provider(cr, registry, 'payplug') |
@ -0,0 +1,48 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
||||
|
{ |
||||
|
'name': 'PayPlug Multi-Payments', |
||||
|
'category': 'Accounting/Payment Acquirers', |
||||
|
'summary': 'Several types of payments with PayPlug', |
||||
|
'license': 'LGPL-3', |
||||
|
'version': '3.1', |
||||
|
'author': 'PayPlug & Applylog', |
||||
|
'website': 'www.applylog.com', |
||||
|
'description': """ |
||||
|
- PayPlug Payment by credit cards. |
||||
|
- PayLater 3x 4x by credit cards. |
||||
|
- AmEx Payment by credit cards. |
||||
|
- Bancontact Payment by credit cards. |
||||
|
""", |
||||
|
'depends': [ |
||||
|
'payment', |
||||
|
'account_payment', |
||||
|
'sale_management', |
||||
|
'website', |
||||
|
'website_sale', |
||||
|
'website_payment', |
||||
|
], |
||||
|
'data': [ |
||||
|
'views/payment_transaction_view.xml', |
||||
|
'views/payment_provider_view.xml', |
||||
|
'views/payment_provider_template.xml', |
||||
|
'views/payment_provider_oney_template.xml', |
||||
|
'datas/payment_icon_data.xml', |
||||
|
'datas/payment_provider_data.xml', |
||||
|
], |
||||
|
'external_dependencies': { |
||||
|
'python' : ['payplug==1.3.1'], |
||||
|
}, |
||||
|
'assets': { |
||||
|
'web.assets_frontend' : [ |
||||
|
'acquirer_payplug/static/src/css/website_oney.css', |
||||
|
'acquirer_payplug/static/src/js/website_oney.js', |
||||
|
], |
||||
|
}, |
||||
|
'images': [ |
||||
|
'static/description/banner.png', |
||||
|
], |
||||
|
'application': False, |
||||
|
'post_init_hook': 'post_init_hook', |
||||
|
'uninstall_hook': 'uninstall_hook', |
||||
|
} |
@ -0,0 +1,3 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
from . import main |
||||
|
from . import portal |
@ -0,0 +1,227 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
|
||||
|
#from urllib.parse import urlparse, urljoin |
||||
|
#import werkzeug |
||||
|
from odoo import http |
||||
|
from odoo.http import request |
||||
|
from odoo import fields, http, tools, _ |
||||
|
import base64 |
||||
|
import requests |
||||
|
import json |
||||
|
import logging |
||||
|
_logger = logging.getLogger(__name__) |
||||
|
import payplug |
||||
|
payplug.set_api_version("2019-08-06") |
||||
|
import pprint |
||||
|
from odoo.addons.website_sale.controllers.main import WebsiteSale |
||||
|
from odoo.tools.json import scriptsafe as json_scriptsafe |
||||
|
from odoo.exceptions import AccessError, UserError, ValidationError |
||||
|
|
||||
|
class WebsiteSaleOney(WebsiteSale): |
||||
|
|
||||
|
# CREATE SIMULATION ONEY IN PRODUCT FORM |
||||
|
def _prepare_product_values(self, product, category, search, **kwargs): |
||||
|
res=super(WebsiteSaleOney,self)._prepare_product_values(product, category, search, **kwargs) |
||||
|
# IF PAYMENT ACQUIRER IS ONEY UPDATE VALUES |
||||
|
payment_provider=request.env['payment.provider'].sudo().search([('code','=','payplug')], limit=1) |
||||
|
# ONEY IS ACTIVE |
||||
|
if payment_provider.state != 'disabled' and payment_provider.payment_type_oney == True: |
||||
|
# IF THE PROVIDER IS ALLOWED FROM THE WEBSITE COMPANY |
||||
|
company_ids=request.env.context.get('allowed_company_ids') |
||||
|
if payment_provider.company_id.id in company_ids: |
||||
|
authorized_by_company = True |
||||
|
else: |
||||
|
authorized_by_company = False |
||||
|
# TO VERIFY THAT THE AMOUNT IS IN THE ONEY AUTHORIZED RANGE |
||||
|
amount = res.get('product').list_price |
||||
|
if amount < 100 or amount > 3000 : |
||||
|
authorized_by_oney = False |
||||
|
else: |
||||
|
authorized_by_oney = True |
||||
|
result_simulation=request.env['payment.provider'].sudo()._oney_payment_simulation(amount, 'FR') |
||||
|
# UPDATE DICT WITH SIMULATION ONEY |
||||
|
res.update(result_simulation) |
||||
|
res.update({ |
||||
|
'InformationMessage': payment_provider.oney_information_message, |
||||
|
'FooterMessage': payment_provider.oney_footer_message, |
||||
|
'amount_total_oney': amount, |
||||
|
'authorized_by_oney': authorized_by_oney, |
||||
|
'authorized_by_company': authorized_by_company, |
||||
|
'acquirer': payment_provider, |
||||
|
'currency_symbol': request.website.currency_id.symbol, |
||||
|
}) |
||||
|
else: |
||||
|
res.update({ |
||||
|
'InformationMessage': False, |
||||
|
'FooterMessage': False, |
||||
|
'amount_total_oney': 0, |
||||
|
'authorized_by_oney': None, |
||||
|
'authorized_by_company': None, |
||||
|
'acquirer': payment_provider, |
||||
|
'currency_symbol': request.website.currency_id.symbol, |
||||
|
}) |
||||
|
return res |
||||
|
|
||||
|
#UPDATE CART |
||||
|
@http.route(['/shop/cart'], type='http', auth="public", website=True, sitemap=False) |
||||
|
def cart(self, access_token=None, revive='', **post): |
||||
|
res=super(WebsiteSaleOney,self).cart(access_token, revive, **post) |
||||
|
# IF PAYMENT ACQUIRER IS ONEY UPDATE VALUES |
||||
|
payment_provider=request.env['payment.provider'].sudo().search([('code','=','payplug')], limit=1) |
||||
|
# ONEY IS ACTIVE |
||||
|
if payment_provider.state != 'disabled' and payment_provider.payment_type_oney == True: |
||||
|
amount=res.__dict__['qcontext']['website_sale_order'].amount_total |
||||
|
# IF THE PROVIDER IS ALLOWED FROM THE WEBSITE COMPANY |
||||
|
company_ids=request.env.context.get('allowed_company_ids') |
||||
|
if payment_provider.company_id.id in company_ids: |
||||
|
authorized_by_company = True |
||||
|
else: |
||||
|
authorized_by_company = False |
||||
|
if amount < 100 or amount > 3000 : |
||||
|
authorized_by_oney = False |
||||
|
else: |
||||
|
authorized_by_oney = True |
||||
|
currency=res.__dict__['qcontext']['website_sale_order'].currency_id.symbol |
||||
|
res.__dict__['qcontext'].update({ |
||||
|
'InformationMessage': payment_provider.oney_information_message, |
||||
|
'FooterMessage': payment_provider.oney_footer_message, |
||||
|
'currency_symbol': request.website.currency_id.symbol, |
||||
|
'amount_total_oney': amount, |
||||
|
'authorized_by_oney': authorized_by_oney, |
||||
|
'authorized_by_company': authorized_by_company, |
||||
|
}) |
||||
|
res.__dict__['qcontext'].update({'acquirer': payment_provider}) # IF ONEY IS DISABLED |
||||
|
return res |
||||
|
|
||||
|
# UPDATE ONEY SIMULATION |
||||
|
@http.route(['/shop/product/oney_simulation'], type='json', auth="public", website=True, csrf=False) |
||||
|
def oney_simulation(self, **kw): |
||||
|
values={} |
||||
|
payment_provider=request.env['payment.provider'].sudo().search([('code','=','payplug')], limit=1) |
||||
|
# ONEY IS ACTIVE |
||||
|
if payment_provider.state != 'disabled' and payment_provider.payment_type_oney == True: |
||||
|
result_simulation=request.env['payment.provider'].sudo()._oney_payment_simulation(float(kw.get('product_total_price')), 'FR') |
||||
|
values = { |
||||
|
'amount_total_oney': "%.2f" %(float(kw.get('product_total_price'))), |
||||
|
'payment_3x': result_simulation['payment_3x'], |
||||
|
'payment_4x': result_simulation['payment_4x'], |
||||
|
} |
||||
|
return values |
||||
|
|
||||
|
# CREATE SIMULATION ONEY IN CART PAYMENT |
||||
|
def _get_shop_payment_values(self, order, **kwargs): |
||||
|
res = super(WebsiteSaleOney, self)._get_shop_payment_values(order, **kwargs) |
||||
|
# Return de specific values for Payment Oney |
||||
|
payment_provider = request.env['payment.provider'].sudo().search([('code','=','payplug')], limit=1) |
||||
|
if payment_provider.state != 'disabled': |
||||
|
country=order.partner_id.country_id |
||||
|
if payment_provider.payment_type_oney == True: |
||||
|
result_simulation=request.env['payment.provider'].sudo()._oney_payment_simulation(order.amount_total, 'FR') |
||||
|
res.update(result_simulation) |
||||
|
# ONEY PAYMENT CONTROL BETWEEN €100 AND €3000 |
||||
|
if order.amount_total >= 100.00 and order.amount_total <= 3000.00: |
||||
|
authorized_by_oney=True |
||||
|
else: |
||||
|
authorized_by_oney=False |
||||
|
# AUTHORIZED COUNTRY FOR ONEY |
||||
|
authorized_country_oney=True |
||||
|
if country not in payment_provider.available_oney_country_ids: |
||||
|
authorized_country_oney=False |
||||
|
total_qty_card=0.0 |
||||
|
limit_quantity=False |
||||
|
for line in res['website_sale_order'].order_line: |
||||
|
total_qty_card+=line.product_uom_qty |
||||
|
if total_qty_card > 10.0: |
||||
|
limit_quantity=True |
||||
|
authorized_by_oney=False |
||||
|
res.update({ |
||||
|
'amount_oney': order.amount_total, |
||||
|
'authorized_by_oney': authorized_by_oney, |
||||
|
'limit_quantity': limit_quantity, |
||||
|
'InformationMessage': payment_provider.oney_information_message, |
||||
|
'type_oney': 'oney_x3_with_fees', |
||||
|
'currency_symbol': order.currency_id.symbol, |
||||
|
'authorized_country_oney': authorized_country_oney, |
||||
|
}) |
||||
|
# AUTHORIZED COUNTRY FOR PAYPLUG |
||||
|
if payment_provider.payment_type_payplug == True: |
||||
|
authorized_country_payplug=True |
||||
|
if country not in payment_provider.available_payplug_country_ids: |
||||
|
authorized_country_payplug=False |
||||
|
res.update({'authorized_country_payplug': authorized_country_payplug}) |
||||
|
# AUTHORIZED COUNTRY FOR AMEX |
||||
|
if payment_provider.payment_type_amex == True: |
||||
|
authorized_country_amex=True |
||||
|
if country not in payment_provider.available_amex_country_ids: |
||||
|
authorized_country_amex=False |
||||
|
res.update({'authorized_country_amex': authorized_country_amex}) |
||||
|
# AUTHORIZED COUNTRY FOR BANCONTACT |
||||
|
if payment_provider.payment_type_bancontact == True: |
||||
|
authorized_country_bancontact=True |
||||
|
if country not in payment_provider.available_bancontact_country_ids: |
||||
|
authorized_country_bancontact=False |
||||
|
res.update({'authorized_country_bancontact': authorized_country_bancontact}) |
||||
|
return res |
||||
|
|
||||
|
# UPDATE SESSION WITH PROVIDER PAYPLUG 'payplug','oney','amex','bancontact' AND 'oney_x3_with_fees','oney_x4_with_fees |
||||
|
@http.route(['/provider_payplug'], type='json', auth="public", website=True) |
||||
|
def provider_payplug(self, **kw): |
||||
|
payment_provider = kw.get('provider_payplug') |
||||
|
type_oney = kw.get('type_oney') |
||||
|
if payment_provider is None: |
||||
|
request.session['provider_payplug']='payplug' |
||||
|
else: |
||||
|
request.session['provider_payplug']=payment_provider |
||||
|
if type_oney is None: |
||||
|
request.session['type_oney']='oney_x3_with_fees' |
||||
|
else: |
||||
|
request.session['type_oney']=type_oney |
||||
|
|
||||
|
class PayPlugController(http.Controller): |
||||
|
_return_url = '/payment/payplug/return' |
||||
|
_webhook_url = '/payment/payplug/webhook' |
||||
|
|
||||
|
@http.route( |
||||
|
_return_url, type='http', auth='public', methods=['GET'], csrf=False, save_session=False |
||||
|
) |
||||
|
def payplug_return_from_checkout(self, **post): |
||||
|
payment=request.env['payment.transaction'].sudo().browse(int(post.get('transaction'))) |
||||
|
# SECRET KEY TEST OR LIVE |
||||
|
secret_payplug_key=request.env['payment.provider'].sudo()._key_acquirer_state(payment.provider_id) |
||||
|
# API PAYPLUG |
||||
|
payplug.set_secret_key(secret_payplug_key) |
||||
|
payment_payplug=payplug.Payment.retrieve(str(payment.provider_reference)) |
||||
|
tx_sudo = request.env['payment.transaction'].sudo()._get_tx_from_notification_data('payplug', payment_payplug) |
||||
|
tx_sudo._handle_notification_data('payplug', payment_payplug) |
||||
|
return request.redirect('/payment/status') |
||||
|
|
||||
|
@http.route( |
||||
|
_webhook_url, type='http', auth='public', methods=['GET'], csrf=False |
||||
|
) |
||||
|
def payplug_webhook(self, **post): |
||||
|
payment=request.env['payment.transaction'].sudo().browse(int(post.get('transaction'))) |
||||
|
# DOWNLOAD SECRET KEY PAYPLUG TEST OR LIVE |
||||
|
secret_payplug_key=request.env['payment.provider'].sudo()._key_acquirer_state(payment.provider_id) |
||||
|
# API PAYPLUG |
||||
|
payplug.set_secret_key(secret_payplug_key) |
||||
|
payment_payplug=payplug.Payment.retrieve(str(payment.provider_reference)) |
||||
|
# TRANSACTION CANCEL OR ERROR |
||||
|
CodeError=payment_payplug.failure.__dict__.get('_attributes') |
||||
|
if CodeError['code']=='canceled': |
||||
|
ErrorMessage='PayPlug Error\n' |
||||
|
ErrorMessage+='Transaction canceled by customer' |
||||
|
payment.sudo().write({ |
||||
|
'state_message': ErrorMessage, |
||||
|
'state': 'cancel', |
||||
|
}) |
||||
|
else: |
||||
|
ErrorMessage='PayPlug Error\n' |
||||
|
ErrorMessage+='Code Error : '+CodeError['code']+'\n' |
||||
|
ErrorMessage+='Message : '+CodeError['message'] |
||||
|
payment.sudo().write({ |
||||
|
'state_message': ErrorMessage, |
||||
|
'state': 'error', |
||||
|
}) |
||||
|
return request.redirect('/shop') |
||||
|
|
||||
|
|
@ -0,0 +1,125 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
|
||||
|
#from urllib.parse import urlparse, urljoin |
||||
|
from odoo import http |
||||
|
from odoo.http import request |
||||
|
from odoo import fields, http, tools, _ |
||||
|
from odoo.http import request |
||||
|
import logging |
||||
|
_logger = logging.getLogger(__name__) |
||||
|
import payplug |
||||
|
payplug.set_api_version("2019-08-06") |
||||
|
import pprint |
||||
|
from odoo.addons.sale.controllers.portal import CustomerPortal |
||||
|
from odoo.exceptions import AccessError, UserError, ValidationError |
||||
|
|
||||
|
class CustomerPortal(CustomerPortal): |
||||
|
|
||||
|
# FOR PAYMENT BY LINK |
||||
|
@http.route( |
||||
|
'/payment/pay', type='http', methods=['GET'], auth='public', website=True, sitemap=False, |
||||
|
) |
||||
|
def payment_pay( |
||||
|
self, reference=None, amount=None, currency_id=None, partner_id=None, company_id=None, |
||||
|
provider_id=None, access_token=None, **kwargs): |
||||
|
res = super(CustomerPortal,self).payment_pay( |
||||
|
reference=reference, amount=amount, currency_id=currency_id, partner_id=partner_id, company_id=company_id, |
||||
|
provider_id=provider_id, access_token=access_token, **kwargs) |
||||
|
# IF PAYMENT ACQUIRER IS ONEY UPDATE VALUES |
||||
|
payment_acquirer=request.env['payment.provider'].sudo().search([('code','=','payplug')], limit=1) |
||||
|
partner = request.env['res.partner'].sudo().search([('id', '=', res.__dict__['qcontext']['partner_id'])]) |
||||
|
country = partner.country_id |
||||
|
if payment_acquirer.state != 'disabled': |
||||
|
if payment_acquirer.payment_type_oney == True: |
||||
|
amount = res.__dict__['qcontext']['amount'] |
||||
|
currency_symbol = res.__dict__['qcontext']['currency'].symbol |
||||
|
result_simulation=request.env['payment.provider'].sudo()._oney_payment_simulation(amount, 'FR') |
||||
|
res.__dict__['qcontext'].update(result_simulation) |
||||
|
# ONEY PAYMENT CONTROL BETWEEN €100 AND €3000 |
||||
|
if amount >= 100.00 and amount <= 3000.00: |
||||
|
authorized_by_oney = True |
||||
|
else: |
||||
|
authorized_by_oney = False |
||||
|
# AUTHORIZED COUNTRY FOR ONEY |
||||
|
authorized_country_oney=True |
||||
|
if country not in payment_acquirer.available_oney_country_ids: |
||||
|
authorized_country_oney=False |
||||
|
res.__dict__['qcontext'].update({ |
||||
|
'InformationMessage': payment_acquirer.oney_information_message, |
||||
|
'FooterMessage': payment_acquirer.oney_footer_message, |
||||
|
'amount_total_oney': amount, |
||||
|
'authorized_by_oney': authorized_by_oney, |
||||
|
'acquirer': payment_acquirer, |
||||
|
'currency_symbol': currency_symbol, |
||||
|
'authorized_country_oney': authorized_country_oney, |
||||
|
}) |
||||
|
# AUTHORIZED COUNTRY FOR PAYPLUG |
||||
|
if payment_acquirer.payment_type_payplug == True: |
||||
|
authorized_country_payplug=True |
||||
|
if country not in payment_acquirer.available_payplug_country_ids: |
||||
|
authorized_country_payplug=False |
||||
|
res.__dict__['qcontext'].update({'authorized_country_payplug': authorized_country_payplug}) |
||||
|
# AUTHORIZED COUNTRY FOR AMEX |
||||
|
if payment_acquirer.payment_type_amex == True: |
||||
|
authorized_country_amex=True |
||||
|
if country not in payment_acquirer.available_amex_country_ids: |
||||
|
authorized_country_amex=False |
||||
|
res.__dict__['qcontext'].update({'authorized_country_amex': authorized_country_amex}) |
||||
|
# AUTHORIZED COUNTRY FOR BANCONTACT |
||||
|
if payment_acquirer.payment_type_bancontact == True: |
||||
|
authorized_country_bancontact=True |
||||
|
if country not in payment_acquirer.available_bancontact_country_ids: |
||||
|
authorized_country_bancontact=False |
||||
|
res.__dict__['qcontext'].update({'authorized_country_bancontact': authorized_country_bancontact}) |
||||
|
return res |
||||
|
|
||||
|
@http.route(['/my/orders/<int:order_id>'], type='http', auth="public", website=True) |
||||
|
def portal_order_page(self, order_id, report_type=None, access_token=None, message=False, download=False, **kw): |
||||
|
res = super(CustomerPortal,self).portal_order_page(order_id, report_type, access_token, message, download, **kw) |
||||
|
if res.__dict__['qcontext'].get('sale_order'): |
||||
|
# IF PAYMENT ACQUIRER IS ONEY UPDATE VALUES |
||||
|
payment_provider=request.env['payment.provider'].sudo().search([('code','=','payplug')], limit=1) |
||||
|
country = res.__dict__['qcontext']['sale_order'].partner_invoice_id.country_id |
||||
|
if payment_provider.state != 'disabled': |
||||
|
if payment_provider.payment_type_oney == True: |
||||
|
amount = res.__dict__['qcontext']['sale_order'].amount_total |
||||
|
currency_symbol = res.__dict__['qcontext']['sale_order'].currency_id.symbol |
||||
|
result_simulation=request.env['payment.provider'].sudo()._oney_payment_simulation(amount, 'FR') |
||||
|
res.__dict__['qcontext'].update(result_simulation) |
||||
|
# ONEY PAYMENT CONTROL BETWEEN €100 AND €3000 |
||||
|
if amount >= 100.00 and amount <= 3000.00: |
||||
|
authorized_by_oney = True |
||||
|
else: |
||||
|
authorized_by_oney = False |
||||
|
# AUTHORIZED COUNTRY FOR ONEY |
||||
|
authorized_country_oney=True |
||||
|
if country not in payment_provider.available_oney_country_ids: |
||||
|
authorized_country_oney=False |
||||
|
res.__dict__['qcontext'].update({ |
||||
|
'InformationMessage': payment_provider.oney_information_message, |
||||
|
'FooterMessage': payment_provider.oney_footer_message, |
||||
|
'amount_total_oney': amount, |
||||
|
'authorized_by_oney': authorized_by_oney, |
||||
|
'acquirer': payment_provider, |
||||
|
'currency_symbol': currency_symbol, |
||||
|
'authorized_country_oney': authorized_country_oney, |
||||
|
}) |
||||
|
# AUTHORIZED COUNTRY FOR PAYPLUG |
||||
|
if payment_provider.payment_type_payplug == True: |
||||
|
authorized_country_payplug=True |
||||
|
if country not in payment_provider.available_payplug_country_ids: |
||||
|
authorized_country_payplug=False |
||||
|
res.__dict__['qcontext'].update({'authorized_country_payplug': authorized_country_payplug}) |
||||
|
# AUTHORIZED COUNTRY FOR AMEX |
||||
|
if payment_provider.payment_type_amex == True: |
||||
|
authorized_country_amex=True |
||||
|
if country not in payment_provider.available_amex_country_ids: |
||||
|
authorized_country_amex=False |
||||
|
res.__dict__['qcontext'].update({'authorized_country_amex': authorized_country_amex}) |
||||
|
# AUTHORIZED COUNTRY FOR BANCONTACT |
||||
|
if payment_provider.payment_type_bancontact == True: |
||||
|
authorized_country_bancontact=True |
||||
|
if country not in payment_provider.available_bancontact_country_ids: |
||||
|
authorized_country_bancontact=False |
||||
|
res.__dict__['qcontext'].update({'authorized_country_bancontact': authorized_country_bancontact}) |
||||
|
return res |
@ -0,0 +1,4 @@ |
|||||
|
-- disable payplug payment provider |
||||
|
UPDATE payment_provider |
||||
|
SET payplug_secret_test_key = NULL, |
||||
|
payplug_secret_live_key = NULL; |
@ -0,0 +1,18 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<record id="payment_icon_visa" model="payment.icon"> |
||||
|
<field name="name">VISA PayPlug</field> |
||||
|
<field name="image" type="base64" file="acquirer_payplug/static/src/img/icon/icon-visa.png"/> |
||||
|
</record> |
||||
|
|
||||
|
<record id="payment_icon_cb" model="payment.icon"> |
||||
|
<field name="name">CB PayPlug</field> |
||||
|
<field name="image" type="base64" file="acquirer_payplug/static/src/img/icon/icon-cb.png"/> |
||||
|
</record> |
||||
|
|
||||
|
<record id="payment_icon_mc" model="payment.icon"> |
||||
|
<field name="name">MASTERCARD PayPlug</field> |
||||
|
<field name="image" type="base64" file="acquirer_payplug/static/src/img/icon/icon-mastercard.png"/> |
||||
|
</record> |
||||
|
|
||||
|
</odoo> |
@ -0,0 +1,40 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo noupdate="1"> |
||||
|
|
||||
|
<!-- FORM PROVIDER PAYPLUG --> |
||||
|
<record id="payment_provider_payplug_datas" model="payment.provider"> |
||||
|
<field name="name">PayPlug Multi-Payments</field> |
||||
|
<field name="image_128" type="base64" file="acquirer_payplug/static/src/img/icon/payplug/payment_payplug_icon.png"/> |
||||
|
<field name="code">payplug</field> |
||||
|
<field name="company_id" ref="base.main_company"/> |
||||
|
<field name="display_as">Payment by credit card - PayPlug</field> |
||||
|
<field name="redirect_form_view_id" ref="payment_payplug_button"/> |
||||
|
<field name="module_id" ref="base.module_acquirer_payplug"/> |
||||
|
<field name="payplug_display_as">Payment by credit card - PayPlug</field> |
||||
|
<field name="oney_display_as">Payment by credit card - PayLater 3x or 4x</field> |
||||
|
<field name="amex_display_as">Payment by credit card - American Express</field> |
||||
|
<field name="bancontact_display_as">Payment by credit card - Bancontact</field> |
||||
|
<field name="payment_icon_ids" eval='[(6, 0, [ref("acquirer_payplug.payment_icon_visa"), |
||||
|
ref("acquirer_payplug.payment_icon_cb"), |
||||
|
ref("acquirer_payplug.payment_icon_mc")])]'/> |
||||
|
<field name="available_country_ids" eval="False"/> |
||||
|
<field name="available_payplug_country_ids" eval='[(6, 0, [ref("base.fr")])]'/> |
||||
|
<field name="available_oney_country_ids" eval='[(6, 0, [ref("base.fr")])]'/> |
||||
|
<field name="available_amex_country_ids" eval='[(6, 0, [ref("base.fr")])]'/> |
||||
|
<field name="available_bancontact_country_ids" eval='[(6, 0, [ref("base.fr")])]'/> |
||||
|
<field name="pre_msg" type="html"> |
||||
|
<p>You will be redirected to the PayPlug website after clicking on the payment button.</p> |
||||
|
</field> |
||||
|
<field name="oney_information_message">The amount of your order must be between € 100.00 and € 3,000.00 to pay with Oney.</field> |
||||
|
<field name="oney_footer_message">y placing an order, you consent to our GTC. Financing supply with compulsory down payment, reserved for individuals and valid for any procurement from € 100.00 to € 3,000.00. Subject to acceptance by Oney Bank. You have a 14-day time to renounce your credit. Oney Bank - SA with capital of € 51,286,585 - 34 Avenue de Flandre 59170 Croix - 546 380 197 RCS Lille Métropole - No. Orias 07 023 261 www.orias.fr Correspondence: CS 60 006 - 59895 Lille Cedex - www.oney.fr</field> |
||||
|
</record> |
||||
|
|
||||
|
<!-- |
||||
|
<record id="payment_method_payplug" model="account.payment.method"> |
||||
|
<field name="name">PayPlug</field> |
||||
|
<field name="code">payplug</field> |
||||
|
<field name="payment_type">inbound</field> |
||||
|
</record> |
||||
|
--> |
||||
|
|
||||
|
</odoo> |
@ -0,0 +1,614 @@ |
|||||
|
# Translation of Odoo Server. |
||||
|
# This file contains the translation of the following modules: |
||||
|
# * acquirer_payplug |
||||
|
# |
||||
|
msgid "" |
||||
|
msgstr "" |
||||
|
"Project-Id-Version: Odoo Server 16.0-20230130\n" |
||||
|
"Report-Msgid-Bugs-To: \n" |
||||
|
"POT-Creation-Date: 2023-02-08 05:55+0000\n" |
||||
|
"PO-Revision-Date: 2023-02-08 05:55+0000\n" |
||||
|
"Last-Translator: \n" |
||||
|
"Language-Team: \n" |
||||
|
"MIME-Version: 1.0\n" |
||||
|
"Content-Type: text/plain; charset=UTF-8\n" |
||||
|
"Content-Transfer-Encoding: \n" |
||||
|
"Plural-Forms: \n" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.oney_detail_simulation |
||||
|
msgid "" |
||||
|
"(Cost of financing: <strong>8,93 €</strong>TAEG : <strong>19,26 €</strong>)" |
||||
|
msgstr "" |
||||
|
"(Coût du financement : <strong>8,93 €</strong>TAEG : <strong>19,26 €</strong>)" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.icon_list_oney |
||||
|
msgid "1st monthly payment:" |
||||
|
msgstr "1ére mensualité :" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.icon_list_oney |
||||
|
msgid "2nd monthly payment:" |
||||
|
msgstr "2ème mensualité :" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.icon_list_oney |
||||
|
msgid "3nd monthly payment:" |
||||
|
msgstr "3ème mensualité :" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.icon_list_oney |
||||
|
msgid "" |
||||
|
"<i class=\"fa fa-arrow-circle-down\"/><b><i> Select 3x or 4x " |
||||
|
"payment.</i></b>" |
||||
|
msgstr "" |
||||
|
"<i class=\"fa fa-arrow-circle-down\"/><b><i> Select 3x ou 4x " |
||||
|
"payment.</i></b>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "" |
||||
|
"<i class=\"fa fa-info-circle\" title=\"AmEx\"> To use AmEx you must make an " |
||||
|
"activation request to PayPlug. This type of payment does not have a \"test\"" |
||||
|
" mode.</i>" |
||||
|
msgstr "" |
||||
|
"<i class=\"fa fa-info-circle\" title=\"AmEx\"> Pour utiliser AmEx vous devez " |
||||
|
"faire une demande d'activation auprès de PayPlug. Ce type de paiement n'a pas de mode " |
||||
|
" \"test\".</i>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "" |
||||
|
"<i class=\"fa fa-info-circle\" title=\"Bancontact\"> To use Bancontact you " |
||||
|
"must make an activation request to PayPlug. This type of payment does not " |
||||
|
"have a \"test\" mode.</i>" |
||||
|
msgstr "" |
||||
|
"<i class=\"fa fa-info-circle\" title=\"Bancontact\"> Pour utiliser Bancontact vous devez" |
||||
|
"faire une demande d'activation auprès de PayPlug. Ce type de paiement " |
||||
|
"n'a pas de mode \"test\".</i>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "" |
||||
|
"<i class=\"fa fa-info-circle\" title=\"Country\" colspan=\"2\" " |
||||
|
"attrs=\"{'invisible': [('code', '!=', 'payplug')]}\"> The configuration of " |
||||
|
"the authorized countries is to be carried out for each method of " |
||||
|
"payment!</i>" |
||||
|
msgstr "" |
||||
|
"<i class=\"fa fa-info-circle\" title=\"Country\" colspan=\"2\" " |
||||
|
"attrs=\"{'invisible': [('code', '!=', 'payplug')]}\"> La configuration " |
||||
|
"des pays autorisés est à effectuer pour chaque moyen de " |
||||
|
"paiement !</i>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "" |
||||
|
"<i class=\"fa fa-pencil\" title=\"AmEx\"> PayPlug online payments via credit" |
||||
|
" cards American express.</i>" |
||||
|
msgstr "" |
||||
|
"<i class=\"fa fa-pencil\" title=\"AmEx\"> PayPlug paiement en ligne par carte de crédit " |
||||
|
"merican express.</i>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "" |
||||
|
"<i class=\"fa fa-pencil\" title=\"Bancontact\"> PayPlug online payments via " |
||||
|
"credit cards Bancontact</i>" |
||||
|
msgstr "" |
||||
|
"<i class=\"fa fa-pencil\" title=\"Bancontact\"> PayPlug paiement en ligne par carte de crédit " |
||||
|
"Bancontact</i>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "" |
||||
|
"<i class=\"fa fa-pencil\" title=\"PayPlug actived\"> PayPlug online payments" |
||||
|
" via credit cards.</i>" |
||||
|
msgstr "" |
||||
|
"<i class=\"fa fa-pencil\" title=\"PayPlug activé\"> PayPlug paiement en ligne par carte de crédit " |
||||
|
" PayPlug.</i>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "" |
||||
|
"<i class=\"fa fa-pencil\" title=\"text\"> PayLater online payments via " |
||||
|
"credit cards 3x or 4x.</i>" |
||||
|
msgstr "" |
||||
|
"<i class=\"fa fa-pencil\" title=\"text\"> PayLater paiement en ligne par carte de crédit 3x" |
||||
|
" ou 4x.</i>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.checkout_inherit |
||||
|
msgid "<i class=\"fa fa-trash\"/> Delete" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.oney_detail_simulation |
||||
|
msgid "<span class=\"text-button\">3x payment</span>" |
||||
|
msgstr "<span class=\"text-button\">3x paiement</span>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.oney_detail_simulation |
||||
|
msgid "<span class=\"text-button\">4x payment</span>" |
||||
|
msgstr "<span class=\"text-button\">4x paiement</span>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "" |
||||
|
"<span colspan=\"2\" style=\"font-size: 12px; color: #ffb200;\" attrs=\"{'invisible': [('payment_type_amex', '=', True)]}\">\n" |
||||
|
"\t \t\t\t\t<i class=\"fa fa-check\" title=\"AmEx disabled\"/> <b><i> AmEx is disabled</i></b>\n" |
||||
|
"\t \t\t\t</span>\n" |
||||
|
"\t \t\t\t<span colspan=\"2\" style=\"font-size: 12px; color: green;\" attrs=\"{'invisible': [('payment_type_amex', '=', False)]}\">\n" |
||||
|
"\t \t\t\t\t<i class=\"fa fa-check\" title=\"AmEx actived\"/> <b> AmEx is activated</b>\n" |
||||
|
"\t \t\t\t</span>" |
||||
|
msgstr "" |
||||
|
"<span colspan=\"2\" style=\"font-size: 12px; color: #ffb200;\" attrs=\"{'invisible': [('payment_type_amex', '=', True)]}\">\n" |
||||
|
"\t \t\t\t\t<i class=\"fa fa-check\" title=\"AmEx disabled\"/> <b><i> AmEx est désactivé</i></b>\n" |
||||
|
"\t \t\t\t</span>\n" |
||||
|
"\t \t\t\t<span colspan=\"2\" style=\"font-size: 12px; color: green;\" attrs=\"{'invisible': [('payment_type_amex', '=', False)]}\">\n" |
||||
|
"\t \t\t\t\t<i class=\"fa fa-check\" title=\"AmEx actived\"/> <b> AmEx est activé</b>\n" |
||||
|
"\t \t\t\t</span>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "" |
||||
|
"<span colspan=\"2\" style=\"font-size: 12px; color: #ffb200;\" attrs=\"{'invisible': [('payment_type_bancontact', '=', True)]}\">\n" |
||||
|
"\t \t\t\t\t<i class=\"fa fa-check\" title=\"Bancontact disabled\"/> <b><i> Bancontact is disabled</i></b>\n" |
||||
|
"\t \t\t\t</span>\n" |
||||
|
"\t \t\t\t<span colspan=\"2\" style=\"font-size: 12px; color: green;\" attrs=\"{'invisible': [('payment_type_bancontact', '=', False)]}\">\n" |
||||
|
"\t \t\t\t\t<i class=\"fa fa-check\" title=\"Bancontact actived\"/> <b> Bancontact is activated</b>\n" |
||||
|
"\t \t\t\t</span>" |
||||
|
msgstr "" |
||||
|
"<span colspan=\"2\" style=\"font-size: 12px; color: #ffb200;\" attrs=\"{'invisible': [('payment_type_bancontact', '=', True)]}\">\n" |
||||
|
"\t \t\t\t\t<i class=\"fa fa-check\" title=\"Bancontact disabled\"/> <b><i> Bancontact est désactivé</i></b>\n" |
||||
|
"\t \t\t\t</span>\n" |
||||
|
"\t \t\t\t<span colspan=\"2\" style=\"font-size: 12px; color: green;\" attrs=\"{'invisible': [('payment_type_bancontact', '=', False)]}\">\n" |
||||
|
"\t \t\t\t\t<i class=\"fa fa-check\" title=\"Bancontact actived\"/> <b> Bancontact est activé</b>\n" |
||||
|
"\t \t\t\t</span>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "" |
||||
|
"<span colspan=\"2\" style=\"font-size: 12px; color: #ffb200;\" attrs=\"{'invisible': [('payment_type_oney', '=', True)]}\">\n" |
||||
|
"\t \t\t\t\t<i class=\"fa fa-check\" title=\"actived\"/> <b><i> PayLater is disabled</i></b>\n" |
||||
|
"\t \t\t\t</span>\n" |
||||
|
"\t \t\t\t<span colspan=\"2\" style=\"font-size: 12px; color: green;\" attrs=\"{'invisible': [('payment_type_oney', '=', False)]}\">\n" |
||||
|
"\t \t\t\t\t<i class=\"fa fa-check\" title=\"PayLater actived\"/> <b> PayLater is activated</b>\n" |
||||
|
"\t \t\t\t</span>" |
||||
|
msgstr "" |
||||
|
"<span colspan=\"2\" style=\"font-size: 12px; color: #ffb200;\" attrs=\"{'invisible': [('payment_type_oney', '=', True)]}\">\n" |
||||
|
"\t \t\t\t\t<i class=\"fa fa-check\" title=\"actived\"/> <b><i> PayLater est désactivé</i></b>\n" |
||||
|
"\t \t\t\t</span>\n" |
||||
|
"\t \t\t\t<span colspan=\"2\" style=\"font-size: 12px; color: green;\" attrs=\"{'invisible': [('payment_type_oney', '=', False)]}\">\n" |
||||
|
"\t \t\t\t\t<i class=\"fa fa-check\" title=\"PayLater actived\"/> <b> PayLater est activé</b>\n" |
||||
|
"\t \t\t\t</span>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "" |
||||
|
"<span colspan=\"2\" style=\"font-size: 12px; color: green;\" attrs=\"{'invisible': [('payment_type_payplug', '=', False)]}\">\n" |
||||
|
"\t \t\t\t\t<i class=\"fa fa-check\" title=\"PayPlug actived\"/> <b> PayPlug is activated</b>\n" |
||||
|
"\t \t\t\t</span>" |
||||
|
msgstr "" |
||||
|
"<span colspan=\"2\" style=\"font-size: 12px; color: green;\" attrs=\"{'invisible': [('payment_type_payplug', '=', False)]}\">\n" |
||||
|
"\t \t\t\t\t<i class=\"fa fa-check\" title=\"PayPlug actived\"/> <b> PayPlug est activé</b>\n" |
||||
|
"\t \t\t\t</span>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.product_price_oney |
||||
|
msgid "" |
||||
|
"<span id=\"text_simulations_oney\" style=\"display: none;\"><i>Simulation " |
||||
|
"Oney :</i></span>" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.oney_detail_simulation |
||||
|
msgid "<strong>For an amount of:</strong>" |
||||
|
msgstr "<strong>Pour un montant de :</strong>" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.oney_detail_simulation |
||||
|
msgid "<strong>Total :</strong>" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_transaction__provider_type_payplug |
||||
|
msgid "Acquirer Payplug" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "AmEx settings" |
||||
|
msgstr "AmEx configuration" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields.selection,name:acquirer_payplug.selection__payment_transaction__provider_type_payplug__amex |
||||
|
msgid "Americam Express" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__available_amex_country_ids |
||||
|
msgid "Amex countries" |
||||
|
msgstr "Pays" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__amex_display_as |
||||
|
msgid "Amex displayed as" |
||||
|
msgstr "Afficher comme" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "Availability" |
||||
|
msgstr "Disponibilité" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields.selection,name:acquirer_payplug.selection__payment_transaction__provider_type_payplug__bancontact |
||||
|
msgid "Bancontact" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__available_bancontact_country_ids |
||||
|
msgid "Bancontact countries" |
||||
|
msgstr "Pays" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__bancontact_display_as |
||||
|
msgid "Bancontact displayed as" |
||||
|
msgstr "Afficher comme" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "Bancontact settings" |
||||
|
msgstr "Bancontact configurations" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.pop_up_oney_summary |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.product_price_oney |
||||
|
msgid "Close" |
||||
|
msgstr "Fermer" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__code |
||||
|
msgid "Code" |
||||
|
msgstr "Fermer" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.icon_list_oney |
||||
|
msgid "Contribution of:" |
||||
|
msgstr "Apport de :" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#. odoo-python |
||||
|
#: code:addons/acquirer_payplug/models/payment_transaction.py:0 |
||||
|
#, python-format |
||||
|
msgid "Country is required!" |
||||
|
msgstr "Le pays est obligatoire !" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,help:acquirer_payplug.field_payment_provider__amex_display_as |
||||
|
#: model:ir.model.fields,help:acquirer_payplug.field_payment_provider__bancontact_display_as |
||||
|
#: model:ir.model.fields,help:acquirer_payplug.field_payment_provider__oney_display_as |
||||
|
#: model:ir.model.fields,help:acquirer_payplug.field_payment_provider__payplug_display_as |
||||
|
msgid "Description of the acquirer for customers" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,help:acquirer_payplug.field_payment_provider__payplug_secret_live_key |
||||
|
msgid "Enter the LIVE key of your PayPlug account" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,help:acquirer_payplug.field_payment_provider__payplug_secret_test_key |
||||
|
msgid "Enter the TEST key of your PayPlug account" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.checkout_inherit |
||||
|
msgid "Fees" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.oney_detail_simulation |
||||
|
msgid "First intake:" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__oney_footer_message |
||||
|
msgid "Footer pop-up message" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__oney_information_message |
||||
|
msgid "Information message" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#. odoo-python |
||||
|
#: code:addons/acquirer_payplug/models/payment_transaction.py:0 |
||||
|
#, python-format |
||||
|
msgid "Invalid Key: received %(sign)s, computed %(check)s" |
||||
|
msgstr "Clef invalide: reçu %(sign)s, calculé %(check)s" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.oney_detail_simulation |
||||
|
msgid "Monthly payments N°1:" |
||||
|
msgstr "Mensualité N°1 :" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.oney_detail_simulation |
||||
|
msgid "Monthly payments N°2:" |
||||
|
msgstr "Mensualité N°2 :" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.oney_detail_simulation |
||||
|
msgid "Monthly payments N°3:" |
||||
|
msgstr "Mensualité N°3 :" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.icon_list_oney |
||||
|
msgid "Oney simulation payment in 3x" |
||||
|
msgstr "Oney simulation paiement en 3x" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.icon_list_oney |
||||
|
msgid "Oney simulation payment in 4x" |
||||
|
msgstr "Oney simulation paiement en 4x" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__oney_display_as |
||||
|
msgid "PayLater displayed as" |
||||
|
msgstr "Afficher comme" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "PayLater settings" |
||||
|
msgstr "PayLater configurations" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields.selection,name:acquirer_payplug.selection__payment_provider__code__payplug |
||||
|
#: model:ir.model.fields.selection,name:acquirer_payplug.selection__payment_transaction__provider_type_payplug__payplug |
||||
|
msgid "PayPlug" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:payment.provider,name:acquirer_payplug.payment_provider_payplug_datas |
||||
|
msgid "PayPlug Multi-Payments" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__payplug_display_as |
||||
|
msgid "PayPlug displayed as" |
||||
|
msgstr "Afficher comme" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "PayPlug settings" |
||||
|
msgstr "PayPlug configuration" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields.selection,name:acquirer_payplug.selection__payment_transaction__provider_type_payplug__oney |
||||
|
msgid "Paylater by Oney" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__available_oney_country_ids |
||||
|
msgid "Paylater countries" |
||||
|
msgstr "Pays" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__payment_type_amex |
||||
|
msgid "Payment AmEx" |
||||
|
msgstr "Paiement AmEx" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__payment_type_bancontact |
||||
|
msgid "Payment Bancontact" |
||||
|
msgstr "Paiement Bancontact" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "Payment Form" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__payment_type_oney |
||||
|
msgid "Payment PayLater" |
||||
|
msgstr "Paiement PayLater" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__payment_type_payplug |
||||
|
msgid "Payment PayPlug" |
||||
|
msgstr "Paiement PayPlug" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model,name:acquirer_payplug.model_payment_provider |
||||
|
msgid "Payment Provider" |
||||
|
msgstr "Fournisseur de paiement" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model,name:acquirer_payplug.model_payment_transaction |
||||
|
msgid "Payment Transaction" |
||||
|
msgstr "Transaction" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:payment.provider,amex_display_as:acquirer_payplug.payment_provider_payplug_datas |
||||
|
msgid "Payment by credit card - American Express" |
||||
|
msgstr "Paiement par carte de crédit - American Express" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:payment.provider,bancontact_display_as:acquirer_payplug.payment_provider_payplug_datas |
||||
|
msgid "Payment by credit card - Bancontact" |
||||
|
msgstr "Paiement par carte de crédit - Bancontact" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:payment.provider,oney_display_as:acquirer_payplug.payment_provider_payplug_datas |
||||
|
msgid "Payment by credit card - PayLater 3x or 4x" |
||||
|
msgstr "Paiement par carte de crédit - PayLater 3x ou 4x" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:payment.provider,display_as:acquirer_payplug.payment_provider_payplug_datas |
||||
|
#: model:payment.provider,payplug_display_as:acquirer_payplug.payment_provider_payplug_datas |
||||
|
msgid "Payment by credit card - PayPlug" |
||||
|
msgstr "Paiement par carte de crédit - PayPlug" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__available_payplug_country_ids |
||||
|
msgid "Payplug countries" |
||||
|
msgstr "Pays" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.checkout_inherit |
||||
|
msgid "Save my payment details" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__payplug_secret_live_key |
||||
|
msgid "Secret Live Key" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,field_description:acquirer_payplug.field_payment_provider__payplug_secret_test_key |
||||
|
msgid "Secret Test Key" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "Select countries. Leave empty to use everywhere." |
||||
|
msgstr "Sélectionnez les pays. Laisser vide pour l'utiliser partout" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.checkout_inherit |
||||
|
msgid "Test Mode" |
||||
|
msgstr "Mode test" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:payment.provider,oney_information_message:acquirer_payplug.payment_provider_payplug_datas |
||||
|
msgid "" |
||||
|
"The amount of your order must be between € 100.00 and € 3,000.00 to pay with" |
||||
|
" Oney." |
||||
|
msgstr "" |
||||
|
"Le montant de votre commande doit être compris entre 100,00 € et 3 000,00 € pour régler avec" |
||||
|
" Oney." |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,help:acquirer_payplug.field_payment_provider__available_amex_country_ids |
||||
|
#: model:ir.model.fields,help:acquirer_payplug.field_payment_provider__available_bancontact_country_ids |
||||
|
#: model:ir.model.fields,help:acquirer_payplug.field_payment_provider__available_oney_country_ids |
||||
|
#: model:ir.model.fields,help:acquirer_payplug.field_payment_provider__available_payplug_country_ids |
||||
|
msgid "" |
||||
|
"The countries for which this payment acquirer is available.\n" |
||||
|
"If none is set, it is available for all countries." |
||||
|
msgstr "" |
||||
|
"Les pays pour lesquels cet acquéreur de paiement est disponible.\n" |
||||
|
"Si aucun n'est défini, il est disponible pour tous les pays." |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:ir.model.fields,help:acquirer_payplug.field_payment_provider__code |
||||
|
msgid "The technical code of this payment provider." |
||||
|
msgstr "Le code technique de ce fournisseur de paiement." |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:payment.provider,cancel_msg:acquirer_payplug.payment_provider_payplug_datas |
||||
|
msgid "Votre paiement a été annulé." |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:payment.provider,auth_msg:acquirer_payplug.payment_provider_payplug_datas |
||||
|
msgid "Votre paiement a été autorisé." |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:payment.provider,pending_msg:acquirer_payplug.payment_provider_payplug_datas |
||||
|
msgid "" |
||||
|
"Votre paiement a été traité avec succès mais est en attente d'approbation." |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:payment.provider,done_msg:acquirer_payplug.payment_provider_payplug_datas |
||||
|
msgid "Votre paiement a été traité avec succès. Merci !" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:payment.provider,pre_msg:acquirer_payplug.payment_provider_payplug_datas |
||||
|
msgid "" |
||||
|
"You will be redirected to the PayPlug website after clicking on the payment " |
||||
|
"button." |
||||
|
msgstr "" |
||||
|
"Vous serez redirigé vers le site PayPlug après avoir cliqué sur le bouton de " |
||||
|
"paiement." |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#. odoo-python |
||||
|
#: code:addons/acquirer_payplug/models/payment_transaction.py:0 |
||||
|
#, python-format |
||||
|
msgid "" |
||||
|
"Your payment %s has been successfully processed but is awaiting approval by " |
||||
|
"Oney." |
||||
|
msgstr "" |
||||
|
"Votre paiement %s a été traité avec succès mais est en attente d'approbation par " |
||||
|
"Oney." |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#. odoo-python |
||||
|
#: code:addons/acquirer_payplug/models/payment_transaction.py:0 |
||||
|
#, python-format |
||||
|
msgid "Your payment %s has been validated by Oney." |
||||
|
msgstr "Votre paiement %s a été validé par Oney." |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#. odoo-python |
||||
|
#: code:addons/acquirer_payplug/models/payment_transaction.py:0 |
||||
|
#, python-format |
||||
|
msgid "Your payment in %s was refused by Oney." |
||||
|
msgstr "Votre paiement de %s a été refusé par Oney." |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#. odoo-python |
||||
|
#: code:addons/acquirer_payplug/models/payment_transaction.py:0 |
||||
|
#, python-format |
||||
|
msgid "Your payment was refused." |
||||
|
msgstr "Votre paiement a été refusé" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "e.g. sk_live_1YIpJK544lnWVCKnYlLlxY" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "e.g. sk_test_1YIpJK544lnWVCKnYlLlxY" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.payment_provider_form_inherit |
||||
|
msgid "icon" |
||||
|
msgstr "" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.icon_list_oney |
||||
|
msgid "show less" |
||||
|
msgstr "Montrer moins" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model_terms:ir.ui.view,arch_db:acquirer_payplug.icon_list_oney |
||||
|
msgid "show more" |
||||
|
msgstr "montre plus" |
||||
|
|
||||
|
#. module: acquirer_payplug |
||||
|
#: model:payment.provider,oney_footer_message:acquirer_payplug.payment_provider_payplug_datas |
||||
|
msgid "" |
||||
|
"y placing an order, you consent to our GTC. Financing supply with compulsory" |
||||
|
" down payment, reserved for individuals and valid for any procurement from €" |
||||
|
" 100.00 to € 3,000.00. Subject to acceptance by Oney Bank. You have a 14-day" |
||||
|
" time to renounce your credit. Oney Bank - SA with capital of € 51,286,585 -" |
||||
|
" 34 Avenue de Flandre 59170 Croix - 546 380 197 RCS Lille Métropole - No. " |
||||
|
"Orias 07 023 261 www.orias.fr Correspondence: CS 60 006 - 59895 Lille Cedex " |
||||
|
"- www.oney.fr" |
||||
|
msgstr "" |
||||
|
"En passant une commande, vous acceptez nos CGV. Offre de financement avec " |
||||
|
"obligation acompte, réservé aux particuliers et valable pour tout achat à " |
||||
|
"partir de 100.00 € et 3000.00 €. Sous réserve d'acceptation par Oney Bank. " |
||||
|
"Vous avez 14 jours pour renoncer à votre crédit. Oney Bank - SA with capital" |
||||
|
" of € 51,286,585 - 34 Avenue de Flandre 59170 Croix - 546 380 197 RCS Lille" |
||||
|
" Métropole - No. Orias 07 023 261 www.orias.fr Correspondence: CS 60 006 - " |
||||
|
"59895 Lille Cedex - www.oney.fr" |
@ -0,0 +1,3 @@ |
|||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
||||
|
from . import payment_provider |
||||
|
from . import payment_transaction |
@ -0,0 +1,159 @@ |
|||||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details. |
||||
|
from hashlib import sha1 |
||||
|
from odoo import api, fields, tools, http, models, _ |
||||
|
from odoo.http import request |
||||
|
from odoo.exceptions import AccessError, UserError, ValidationError |
||||
|
import logging |
||||
|
_logger = logging.getLogger(__name__) |
||||
|
import pprint |
||||
|
import payplug |
||||
|
payplug.set_api_version("2019-08-06") |
||||
|
import requests |
||||
|
import json |
||||
|
|
||||
|
class PaymentAcquirerPayPlug(models.Model): |
||||
|
_inherit = 'payment.provider' |
||||
|
|
||||
|
# FOR CREATE SIMULATION ONEY BY API |
||||
|
def _oney_payment_simulation(self, amount, country): |
||||
|
acquirer = request.env['payment.provider'].sudo().search([('code','=','payplug')], limit=1) |
||||
|
if acquirer.state != 'disabled' and acquirer.payment_type_oney == True: # ONEY IS ACTIVE |
||||
|
secret_payplug_key = request.env['payment.provider']._key_acquirer_state(acquirer) |
||||
|
URL = 'https://api.payplug.com/v1/oney_payment_simulations' |
||||
|
headers = { |
||||
|
'Content-Type': 'application/json', |
||||
|
'PayPlug-Version': '2019-08-06', |
||||
|
'Authorization': 'Bearer '+secret_payplug_key, |
||||
|
} |
||||
|
values = { |
||||
|
'amount': int(amount*100), |
||||
|
'country': 'FR', |
||||
|
'operations': ['x3_with_fees', 'x4_with_fees'], |
||||
|
} |
||||
|
# REQUEST TO THE API PAYPLUY/ONEY THE PAYMENT SIMULATION |
||||
|
result = requests.post(url=URL, json=values, headers=headers).json() |
||||
|
vals={} |
||||
|
if result and amount >= 100 and amount <= 3000 and result.get('x3_with_fees'): |
||||
|
vals['payment_3x']={ |
||||
|
'contribution_of_3x': "%.2f" % (int(result['x3_with_fees']['down_payment_amount'])/100), |
||||
|
'1st_monthly_payment_3x': "%.2f" % (int(result['x3_with_fees']['installments'][0]['amount'])/100), |
||||
|
'2nd_monthly_payment_3x': "%.2f" % (int(result['x3_with_fees']['installments'][1]['amount'])/100), |
||||
|
'total_payment_3x': "%.2f" % (int(result['x3_with_fees']['down_payment_amount'])/100 \ |
||||
|
+int(result['x3_with_fees']['installments'][0]['amount'])/100 \ |
||||
|
+int(result['x3_with_fees']['installments'][1]['amount'])/100), |
||||
|
} |
||||
|
vals['payment_4x']={ |
||||
|
'contribution_of_4x': "%.2f" % (int(result['x4_with_fees']['down_payment_amount'])/100), |
||||
|
'1st_monthly_payment_4x': "%.2f" % (int(result['x4_with_fees']['installments'][0]['amount'])/100), |
||||
|
'2nd_monthly_payment_4x': "%.2f" % (int(result['x4_with_fees']['installments'][1]['amount'])/100), |
||||
|
'3nd_monthly_payment_4x': "%.2f" % (int(result['x4_with_fees']['installments'][2]['amount'])/100), |
||||
|
'total_payment_4x': "%.2f" % (int(result['x4_with_fees']['down_payment_amount'])/100 \ |
||||
|
+ int(result['x4_with_fees']['installments'][0]['amount'])/100 \ |
||||
|
+ int(result['x4_with_fees']['installments'][1]['amount'])/100 \ |
||||
|
+ int(result['x4_with_fees']['installments'][2]['amount'])/100), |
||||
|
} |
||||
|
else: |
||||
|
vals['payment_3x']={ |
||||
|
'contribution_of_3x': "0.00", |
||||
|
'1st_monthly_payment_3x': "0.00", |
||||
|
'2nd_monthly_payment_3x': "0.00", |
||||
|
'total_payment_3x': "0.00", |
||||
|
} |
||||
|
vals['payment_4x']={ |
||||
|
'contribution_of_4x': "0.00", |
||||
|
'1st_monthly_payment_4x': "0.00", |
||||
|
'2nd_monthly_payment_4x': "0.00", |
||||
|
'3nd_monthly_payment_4x': "0.00", |
||||
|
'total_payment_4x': "0.00", |
||||
|
} |
||||
|
return vals |
||||
|
|
||||
|
# RETURN TEST KEY OR LIVE KEY |
||||
|
def _key_acquirer_state(self, acquirer): |
||||
|
if acquirer.code == 'payplug' and acquirer.code != 'disabled': |
||||
|
if acquirer.state == 'test': |
||||
|
secret_payplug_key = acquirer.payplug_secret_test_key |
||||
|
else: |
||||
|
secret_payplug_key = acquirer.payplug_secret_live_key |
||||
|
return secret_payplug_key |
||||
|
|
||||
|
code = fields.Selection( |
||||
|
selection_add=[('payplug', "PayPlug")], ondelete={'payplug': 'set default'}) |
||||
|
payplug_secret_test_key = fields.Char( |
||||
|
string="Secret Test Key", |
||||
|
help="Enter the TEST key of your PayPlug account", |
||||
|
required_if_provider='payplug', |
||||
|
groups='base.group_user') |
||||
|
payplug_secret_live_key = fields.Char( |
||||
|
string="Secret Live Key", |
||||
|
help="Enter the LIVE key of your PayPlug account", |
||||
|
required_if_provider='payplug', |
||||
|
groups='base.group_user') |
||||
|
# PAYPLUG VALUES |
||||
|
payplug_display_as = fields.Char( |
||||
|
string="PayPlug displayed as", help="Description of the acquirer for customers", |
||||
|
translate=True) |
||||
|
payment_type_payplug = fields.Boolean("Payment PayPlug", default=True) |
||||
|
available_payplug_country_ids = fields.Many2many( |
||||
|
string="Payplug countries", comodel_name='res.country', relation='payplug_payment_country_rel', |
||||
|
column1='payment_id', column2='country_id', |
||||
|
help="The countries for which this payment acquirer is available.\n" |
||||
|
"If none is set, it is available for all countries.") |
||||
|
# AMEX VALUES |
||||
|
amex_display_as = fields.Char( |
||||
|
string="Amex displayed as", help="Description of the acquirer for customers", |
||||
|
translate=True) |
||||
|
payment_type_amex = fields.Boolean("Payment AmEx") |
||||
|
available_amex_country_ids = fields.Many2many( |
||||
|
string="Amex countries", comodel_name='res.country', relation='amex_payment_country_rel', |
||||
|
column1='payment_id', column2='country_id', |
||||
|
help="The countries for which this payment acquirer is available.\n" |
||||
|
"If none is set, it is available for all countries.") |
||||
|
# BANCONTACT VALUES |
||||
|
bancontact_display_as = fields.Char( |
||||
|
string="Bancontact displayed as", help="Description of the acquirer for customers", |
||||
|
translate=True) |
||||
|
payment_type_bancontact = fields.Boolean("Payment Bancontact") |
||||
|
available_bancontact_country_ids = fields.Many2many( |
||||
|
string="Bancontact countries", comodel_name='res.country', relation='bancontact_payment_country_rel', |
||||
|
column1='payment_id', column2='country_id', |
||||
|
help="The countries for which this payment acquirer is available.\n" |
||||
|
"If none is set, it is available for all countries.") |
||||
|
# ONEY VALUES |
||||
|
oney_display_as = fields.Char( |
||||
|
string="PayLater displayed as", help="Description of the acquirer for customers", |
||||
|
translate=True) |
||||
|
payment_type_oney = fields.Boolean("Payment PayLater") |
||||
|
available_oney_country_ids = fields.Many2many( |
||||
|
string="Paylater countries", comodel_name='res.country', relation='oney_payment_country_rel', |
||||
|
column1='payment_id', column2='country_id', |
||||
|
help="The countries for which this payment acquirer is available.\n" |
||||
|
"If none is set, it is available for all countries.") |
||||
|
oney_information_message = fields.Char( |
||||
|
'Information message', |
||||
|
translate=True, |
||||
|
required_if_provider='oney', |
||||
|
groups='base.group_user') |
||||
|
oney_footer_message = fields.Text( |
||||
|
'Footer pop-up message', |
||||
|
translate=True, |
||||
|
required_if_provider='oney', |
||||
|
groups='base.group_user') |
||||
|
|
||||
|
# CREATE DIGITAL KEY |
||||
|
def _playplug_generate_digital_sign(self, values): |
||||
|
keys = "reference customer_name customer_postcode".split() |
||||
|
def get_value(key): |
||||
|
if values.get(key): |
||||
|
return values[key] |
||||
|
return '' |
||||
|
values = dict(values or {}) |
||||
|
sign = ''.join('%s=%s' % (k, get_value(k)) for k in keys) |
||||
|
shasign = sha1(sign.encode('utf-8')).hexdigest() |
||||
|
return shasign |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
@ -0,0 +1,271 @@ |
|||||
|
# coding: utf-8 |
||||
|
#from hashlib import sha1 |
||||
|
from urllib.parse import urlparse, urljoin |
||||
|
from odoo import api, fields, tools, models, _ |
||||
|
from odoo.addons.acquirer_payplug.controllers.main import PayPlugController |
||||
|
from odoo.http import request |
||||
|
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT |
||||
|
from datetime import datetime, timedelta |
||||
|
from odoo.exceptions import AccessError, UserError, ValidationError |
||||
|
import logging |
||||
|
_logger = logging.getLogger(__name__) |
||||
|
import pprint |
||||
|
import payplug |
||||
|
payplug.set_api_version("2019-08-06") |
||||
|
|
||||
|
class TxPayPlug(models.Model): |
||||
|
_inherit = 'payment.transaction' |
||||
|
|
||||
|
provider_type_payplug = fields.Selection([ |
||||
|
('payplug', 'PayPlug'), |
||||
|
('oney', 'Paylater by Oney'), |
||||
|
('amex', 'Americam Express'), |
||||
|
('bancontact', 'Bancontact'), |
||||
|
], string="Acquirer Payplug") |
||||
|
|
||||
|
# TO EXTRACT THE NAME AND FIRST NAME FROM THE "NAME" FIELD |
||||
|
def _partner_values(self, partner): |
||||
|
vals=[] |
||||
|
if partner: |
||||
|
if len(partner.name.split(' ')) == 1: |
||||
|
vals.append(partner.name) |
||||
|
vals.append('None') |
||||
|
else: |
||||
|
vals=partner.name.split(' ',1) |
||||
|
return vals |
||||
|
|
||||
|
# CREATE SPECIFIC VALUES FOR ONEY |
||||
|
def _order_lines_oney(self, order): |
||||
|
shop_lines=[] |
||||
|
if order: |
||||
|
for line in order.order_line: |
||||
|
shop_lines.append({ |
||||
|
'expected_delivery_date': (datetime.now()+timedelta(days=2)).strftime(DEFAULT_SERVER_DATE_FORMAT), |
||||
|
'delivery_label': order.company_id.name, |
||||
|
'brand': order.company_id.name, |
||||
|
'delivery_type': 'carrier', |
||||
|
'merchant_item_id': 'REF-'+str(line.id), |
||||
|
'name': line.product_id.name, |
||||
|
'total_amount': int(line.price_total*100), |
||||
|
'price': int(line.price_unit+(line.price_tax/line.product_uom_qty)*100), |
||||
|
'quantity': int(line.product_uom_qty), |
||||
|
}) |
||||
|
return shop_lines |
||||
|
|
||||
|
def _get_specific_rendering_values(self, processing_values): |
||||
|
tx_values = super()._get_specific_rendering_values(processing_values) |
||||
|
# IF NOT PROVIDER PAYPLUG |
||||
|
if self.provider_code != 'payplug': |
||||
|
return tx_values |
||||
|
# DOWNLOAD SECRET KEY PAYPLUG TEST OR LIVE |
||||
|
secret_payplug_key = request.env['payment.provider']._key_acquirer_state(self.provider_id) |
||||
|
# BASE URL FOR RETURN |
||||
|
base_url = self.provider_id.get_base_url() |
||||
|
# SECRET KEY TEST OR LIVE |
||||
|
payplug.set_secret_key(secret_payplug_key) |
||||
|
|
||||
|
# PROCESSING TO EXTRACT THE ORDER NUMBER WITHOUT SO000-1, SO000-2 ADD IF SEVERAL PAYMENT ATTEMPTS |
||||
|
if self.reference: |
||||
|
order_id = self.reference.split('-',1)[0] |
||||
|
# FROM ORDERS |
||||
|
order = request.env['sale.order'].sudo().search([('name', '=', order_id)]) |
||||
|
type_of_request = 'sale.order' |
||||
|
partner_invoice = order.partner_invoice_id |
||||
|
if not order: |
||||
|
# FROM INVOICE |
||||
|
order = request.env['account.move'].sudo().search([('name', '=', self.reference)]) |
||||
|
type_of_request = 'account.move' |
||||
|
partner_invoice = order.partner_id |
||||
|
|
||||
|
# MANDATORY VALUE CONTROL |
||||
|
if not order.partner_shipping_id.country_id or not order.partner_invoice_id.country_id : |
||||
|
raise ValidationError("PayPlug: " + _("COUNTRY is required!")) |
||||
|
if not order.partner_shipping_id.city or not order.partner_invoice_id.city : |
||||
|
raise ValidationError("PayPlug: " + _("CITY is required!")) |
||||
|
if not order.partner_shipping_id.zip or not order.partner_invoice_id.zip : |
||||
|
raise ValidationError("PayPlug: " + _("ZIP is required!")) |
||||
|
if not order.partner_shipping_id.phone or not order.partner_invoice_id.phone : |
||||
|
raise ValidationError("PayPlug: " + _("PHONE is required!")) |
||||
|
if not order.partner_shipping_id.email or not order.partner_invoice_id.email : |
||||
|
raise ValidationError("PayPlug: " + _("EMAIL is required!")) |
||||
|
|
||||
|
# GENERATE DIGITAL KEY |
||||
|
payment_generate_key = { |
||||
|
'reference': order.name, |
||||
|
'customer_name': order.partner_id.name, |
||||
|
'customer_postcode': order.partner_id.zip, |
||||
|
} |
||||
|
digital_Key = self.env['payment.provider']._playplug_generate_digital_sign(payment_generate_key) |
||||
|
partner_billing=self._partner_values(order.partner_invoice_id) |
||||
|
partner_shipping=self._partner_values(order.partner_shipping_id) |
||||
|
# FORMAT INTERNATIONNAL PHONE BILLING |
||||
|
if order.partner_invoice_id.phone: |
||||
|
BillingPhoneFormat=request.env['res.partner'].sudo()._phone_format( |
||||
|
partner_invoice.phone or order.partner_id.phone, |
||||
|
partner_invoice.country_id, |
||||
|
order.company_id) |
||||
|
if BillingPhoneFormat: |
||||
|
BillingPhoneFormat=BillingPhoneFormat.replace(' ','') |
||||
|
# FORMAT INTERNATIONNAL PHONE SHIPPING |
||||
|
if order.partner_shipping_id.phone: |
||||
|
ShippingPhoneFormat=request.env['res.partner'].sudo()._phone_format( |
||||
|
order.partner_shipping_id.phone or order.partner_id.phone, |
||||
|
order.partner_shipping_id.country_id, |
||||
|
order.company_id) |
||||
|
if ShippingPhoneFormat: |
||||
|
ShippingPhoneFormat=ShippingPhoneFormat.replace(' ','') |
||||
|
# BILLING FULL ADDRESS |
||||
|
billing_full_address = order.partner_id.street |
||||
|
if partner_invoice.street2: |
||||
|
billing_full_address += ' - '+partner_invoice.street2 |
||||
|
# SHIPPING FULL ADDRESS |
||||
|
shipping_full_address = order.partner_shipping_id.street |
||||
|
if order.partner_shipping_id.street2: |
||||
|
shipping_full_address += ' - '+order.partner_shipping_id.street2 |
||||
|
payment_data = {} |
||||
|
payment_data = { |
||||
|
# AMOUNT DIFFERENT BY PAYPLUG PROVIDER |
||||
|
'currency': str(order.currency_id.name), |
||||
|
'billing': { |
||||
|
'first_name': partner_billing[0], |
||||
|
'last_name': partner_billing[1], |
||||
|
'email': partner_invoice.email, |
||||
|
'address1': billing_full_address, |
||||
|
'postcode': partner_invoice.zip, |
||||
|
'city': partner_invoice.city, |
||||
|
'country': partner_invoice.country_id.code, |
||||
|
'language': partner_invoice.country_id.code.lower(), |
||||
|
}, |
||||
|
'shipping': { |
||||
|
'first_name': partner_shipping[0], |
||||
|
'last_name': partner_shipping[0], |
||||
|
'email': order.partner_shipping_id.email or order.partner_id.email, |
||||
|
'address1': shipping_full_address, |
||||
|
'postcode': order.partner_shipping_id.zip, |
||||
|
'city': order.partner_shipping_id.city, |
||||
|
'country': order.partner_shipping_id.country_id.code, |
||||
|
'language': order.partner_shipping_id.country_id.code.lower(), |
||||
|
'delivery_type': 'BILLING' |
||||
|
}, |
||||
|
'hosted_payment': { |
||||
|
'return_url': '%s' % urljoin(base_url, PayPlugController._return_url+'?transaction='+str(self.id)), |
||||
|
'cancel_url': '%s' % urljoin(base_url, PayPlugController._webhook_url+'?transaction='+str(self.id)), |
||||
|
}, |
||||
|
'metadata': { |
||||
|
'DigitalKey': digital_Key, |
||||
|
'return_validate_url': '', |
||||
|
}, |
||||
|
} |
||||
|
# TO DEFINE THE METHOD ACCORDING TO THE PAYPLUG PROVIDER AND SPECIFIC VALUES |
||||
|
payment_method = request.session.get('provider_payplug') |
||||
|
payment_method_oney = request.session.get('type_oney') |
||||
|
amount_order = int(processing_values.get('amount')*100) |
||||
|
if payment_method == 'payplug': |
||||
|
payment_method_type = 'payplug' |
||||
|
payment_data['amount'] = amount_order |
||||
|
payment_data['metadata']['payment_method'] = 'payplug' |
||||
|
if payment_method == 'oney': |
||||
|
payment_method_type = 'oney' |
||||
|
payment_data['metadata']['payment_method'] = 'oney' |
||||
|
payment_data['authorized_amount'] = amount_order |
||||
|
payment_data['payment_method'] = payment_method_oney |
||||
|
payment_data['billing']['mobile_phone_number'] = BillingPhoneFormat |
||||
|
payment_data['shipping']['mobile_phone_number'] = ShippingPhoneFormat |
||||
|
payment_data['shipping']['company_name'] = partner_invoice.parent_id.name or partner_invoice.company_id.name |
||||
|
payment_data['payment_context'] = {} |
||||
|
payment_data['payment_context']['cart'] = self._order_lines_oney(order) |
||||
|
if payment_method == 'american_express': |
||||
|
payment_method_type = 'amex' |
||||
|
payment_data['amount'] = amount_order |
||||
|
payment_data['payment_method'] = 'american_express' |
||||
|
payment_data['shipping']['company_name'] = partner_invoice.parent_id.name or partner_invoice.company_id.name |
||||
|
payment_data['metadata']['payment_method'] = 'amex' |
||||
|
if payment_method == 'bancontact': |
||||
|
payment_method_type = 'bancontact' |
||||
|
payment_data['amount'] = amount_order |
||||
|
payment_data['payment_method'] = 'bancontact' |
||||
|
payment_data['shipping']['company_name'] = partner_invoice.parent_id.name or partner_invoice.company_id.name |
||||
|
payment_data['metadata']['payment_method'] = 'bancontact' |
||||
|
payplug_tx_values = {} |
||||
|
if processing_values.get('reference') != '/': |
||||
|
# CREATE PAYMENT |
||||
|
payment = payplug.Payment.create(**payment_data) |
||||
|
payment_id = str(payment.id) |
||||
|
# RETURN URL PAYPLUG FOR PAYMENT |
||||
|
payplug_tx_values = dict(processing_values) |
||||
|
if self.provider_code == 'payplug': |
||||
|
payplug_tx_values.update({ |
||||
|
'payplug_url': '%s' % payment.hosted_payment.payment_url, |
||||
|
}) |
||||
|
# WRITE REFERENCE SUPPLIER IN PAYMENT TRANSACTION |
||||
|
if processing_values.get('reference') != '/': |
||||
|
transaction_id = request.env['payment.transaction'].sudo().search([('reference', '=', str(processing_values.get('reference')))], limit=1) |
||||
|
transaction_id.sudo().write({ |
||||
|
'provider_reference': payment_id, |
||||
|
'provider_type_payplug': payment_method_type}) |
||||
|
return payplug_tx_values |
||||
|
|
||||
|
# RETOUR A PARTIR DU CONTROLEUR |
||||
|
@api.model |
||||
|
def _get_tx_from_notification_data(self, provider, Payment): |
||||
|
tx = key = False |
||||
|
tx = super()._get_tx_from_notification_data(provider, Payment) |
||||
|
if provider != 'payplug' or len(tx) == 1: |
||||
|
return tx |
||||
|
if isinstance(Payment,object) == True: |
||||
|
tx = self.search([('provider_reference', '=', str(Payment.id))], limit=1) |
||||
|
if tx: |
||||
|
vals = { |
||||
|
'reference': tx.reference.split('-')[0], |
||||
|
'customer_name': tx.partner_id.name, |
||||
|
'customer_postcode': tx.partner_id.zip, |
||||
|
} |
||||
|
# CREATE NEW DIGITAL KEY FOR CONTROL |
||||
|
key = Payment.metadata.get('DigitalKey') |
||||
|
control_digital_key = tx.provider_id._playplug_generate_digital_sign(vals) |
||||
|
if key.upper() != control_digital_key.upper(): |
||||
|
raise ValidationError( |
||||
|
"PayPlug: " + _( |
||||
|
"Invalid Key: received %(sign)s, computed %(check)s", |
||||
|
sign=key.upper(), check=control_digital_key.upper() |
||||
|
) |
||||
|
) |
||||
|
return tx |
||||
|
|
||||
|
def _process_notification_data(self, notification_data): |
||||
|
super()._process_notification_data(notification_data) |
||||
|
if self.provider_code != 'payplug': |
||||
|
return |
||||
|
# SPECIFIC STATE ONEY |
||||
|
if notification_data.metadata.get('payment_method') == 'oney': |
||||
|
if notification_data.authorization and notification_data.authorization.get('authorized_at'): |
||||
|
# ACCEPTED BY ONEY |
||||
|
self.sudo().write({'provider_reference': self.provider_reference}) |
||||
|
self._set_done(_("Your payment %s has been validated by Oney.", notification_data.payment_method.get('type'))) |
||||
|
return True |
||||
|
if notification_data.is_paid == False and notification_data.failure == None: |
||||
|
# WAITING FOR VALIDATION BY ONEY |
||||
|
self.sudo().write({'state_message': 'Oney: awaiting approval'}) |
||||
|
self._set_pending(_("Your payment %s has been successfully processed but is awaiting approval by Oney.", notification_data.payment_method.get('type'))) |
||||
|
return None |
||||
|
if notification_data.is_paid == False and notification_data.failure != None: |
||||
|
# REFUSE BY ONEY |
||||
|
self.sudo().write({'state_message': 'Oney: feedback error'}) |
||||
|
self._set_error(_("Your payment in %s was refused by Oney.", notification_data.payment_method.get('type'))) |
||||
|
# OTHER PROVIDER PAYPLUG |
||||
|
else: |
||||
|
if notification_data.is_paid == True and notification_data.failure == None: |
||||
|
# ACCEPTED |
||||
|
self.sudo().write({'provider_reference': self.provider_reference}) |
||||
|
self._set_done() |
||||
|
return True |
||||
|
if notification_data.is_paid == False and notification_data.failure == None: |
||||
|
# WAITING FOR VALIDATION |
||||
|
self.sudo().write({'state_message': 'PayPlug: feedback error'}) |
||||
|
self._set_pending() |
||||
|
return None |
||||
|
if notification_data.is_paid == False and notification_data.failure != None: |
||||
|
# REFUSE |
||||
|
self.sudo().write({'state_message': 'PayPlug: feedback error'}) |
||||
|
self._set_error(_("Your payment was refused.")) |
||||
|
return False |
After Width: 1780 | Height: 1094 | Size: 184 KiB |
After Width: 882 | Height: 440 | Size: 72 KiB |
After Width: 225 | Height: 225 | Size: 3.8 KiB |
@ -0,0 +1,161 @@ |
|||||
|
<section class="oe_container"> |
||||
|
<div class="oe_row oe_spaced"> |
||||
|
<div class="oe_span12"> |
||||
|
<h2 class="oe_slogan">About PayPlug</h2> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
|
||||
|
<section class="oe_container" |
||||
|
style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);"> |
||||
|
<div class="panel"> |
||||
|
<div class="panel-heading" |
||||
|
style="padding: 8px; border-top-left-radius: 15px; border-top-right-radius: 15px;"> |
||||
|
<div class="alert alert-info" |
||||
|
style="padding: 8px; font-weight: 300; font-size: 18px; font-family: Open Sans !important;"> |
||||
|
<i class="fa fa-arrow-circle-o-right"></i><b> PayPlug is a french omnichannel solution dedicated to SMEs. It enables merchants to accept card payments: </b> |
||||
|
</div> |
||||
|
<ul class="list-unstyled "> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"><i |
||||
|
class="fa fa-check text-primary"></i>from online shops;</li> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"><i |
||||
|
class="fa fa-check text-primary"></i>from physical stores;</li> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"><i |
||||
|
class="fa fa-check text-primary"></i>through conversations (WhatsApp, Messenger, SMS, e-mail) thanks to a payment requests tool available from the PayPlug portal;</li> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"><i |
||||
|
class="fa fa-check text-primary"></i>or directly from an invoice or a quote thanks to a payment links generation tool.</li> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"><i |
||||
|
class="fa fa-check text-primary"></i>Boost your conversion rate, your average shopping cart value and your turnover by offering your customers the possibility to pay their orders in 3 or 4 installments without any risk for your cash flow.</li> |
||||
|
|
||||
|
</ul> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
|
||||
|
<section class="oe_container"> |
||||
|
<div class="oe_row oe_spaced"> |
||||
|
<div class="oe_span12"> |
||||
|
<h2 class="oe_slogan">Odoo & PayPlug features</h2> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
|
||||
|
<section class="oe_container" |
||||
|
style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);"> |
||||
|
<div class="panel"> |
||||
|
<div class="panel-heading" |
||||
|
style="padding: 8px; border-top-left-radius: 15px; border-top-right-radius: 15px;"> |
||||
|
<div class="alert alert-info" |
||||
|
style="padding: 8px; font-weight: 300; font-size: 18px; font-family: Open Sans !important;"> |
||||
|
<i class="fa fa-arrow-circle-o-right"></i><b> Accept card payments from your Odoo shop: </b> |
||||
|
</div> |
||||
|
<ul class="list-unstyled "> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"> |
||||
|
<i class="fa fa-check text-primary"></i>Install our module in a few clicks</li> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"> |
||||
|
<i class="fa fa-check text-primary"></i>Safely accept Visa, MasterCard, American Express, Bancontact and debit cards; </li> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"> |
||||
|
<i class="fa fa-check text-primary"></i>Enjoy a personalized redirected payment page (logo, back screen image, page colors).</li> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"> |
||||
|
<i class="fa fa-check text-primary"></i>Enable to pay in 3 or 4 installments:</li> |
||||
|
  - A simple and secure shopping experience with no receipts and with an instant response.<br> |
||||
|
  - Future purchases made easier thanks to the 1-click payment with the Oney account.<br> |
||||
|
  - Up to 98% payment acceptance rate for your customers. |
||||
|
</ul> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="panel"> |
||||
|
<div class="panel-heading" |
||||
|
style="padding: 8px; border-top-left-radius: 15px; border-top-right-radius: 15px;"> |
||||
|
<div class="alert alert-info" |
||||
|
style="padding: 8px; font-weight: 300; font-size: 18px; font-family: Open Sans !important;"> |
||||
|
<i class="fa fa-arrow-circle-o-right"></i><b> Efficiently monitor your performance: </b> |
||||
|
</div> |
||||
|
<ul class="list-unstyled "> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"><i |
||||
|
class="fa fa-check text-primary"></i>Follow your transactions in real time;</li> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"><i |
||||
|
class="fa fa-check text-primary"></i>Discover the reasons for cancelled and failed payments;</li> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"><i |
||||
|
class="fa fa-check text-primary"></i>Download your accounting exports in a few clicks from your PayPlug portal.</li> |
||||
|
|
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"><i |
||||
|
class="fa fa-check text-primary"></i>Buy Now and Paylater with secured cash flow:</li> |
||||
|
  - Full coverage for fraud and outstanding payments by Oney.<br> |
||||
|
  - Recovery of funds within 24 hours on your bank account.<br> |
||||
|
  - Eligibility conditions and transparent pricing. |
||||
|
</ul> |
||||
|
<div class="oe_demo oe_screenshot" style="margin-top: 20px;"> |
||||
|
<img src="MOCKUP_PAIEMENT_EN.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="panel"> |
||||
|
<div class="panel-heading" |
||||
|
style="padding: 8px; border-top-left-radius: 15px; border-top-right-radius: 15px;"> |
||||
|
<div class="alert alert-info" |
||||
|
style="padding: 8px; font-weight: 300; font-size: 18px; font-family: Open Sans !important;"> |
||||
|
<i class="fa fa-arrow-circle-o-right"></i><b> Accept payments thanks to your invoices: </b> |
||||
|
</div> |
||||
|
<ul class="list-unstyled "> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"><i |
||||
|
class="fa fa-check text-primary"></i>When sending your customers their invoices or quotes, slip in a payment link, generated from your PayPlug portal;</li> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"><i |
||||
|
class="fa fa-check text-primary"></i>Your customers will pay their invoices or quotes both safely and easily by card. They will love it;</li> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"><i |
||||
|
class="fa fa-check text-primary"></i>From your side : say bye to late payments!.</li> |
||||
|
</ul> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div style="margin-left: 10px;"> |
||||
|
<p>The PayPlug team is located in Paris and will be happy to assist you in your preferred language (french, english, italian).</p><br> |
||||
|
</div> |
||||
|
</section> |
||||
|
<br/> |
||||
|
<section class="oe_container" |
||||
|
style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);"> |
||||
|
<div class="panel"> |
||||
|
<div class="panel-heading" |
||||
|
style="padding: 8px; border-top-left-radius: 15px; border-top-right-radius: 15px;"> |
||||
|
<div class="alert alert-info" |
||||
|
style="padding: 8px; font-weight: 300; font-size: 18px; font-family: Open Sans !important;"> |
||||
|
<i class="fa fa-cog"></i><b> Technical parameters: </b> |
||||
|
</div> |
||||
|
<ul class="list-unstyled "> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"> |
||||
|
<i class="fa fa-check text-primary"></i><strong>You must install the PayPlug API:</strong><i> sudo pip3 install --upgrade payplug==1.3.1</i></li> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"> |
||||
|
<i class="fa fa-check text-primary"></i><strong>In odoo.sh: Create a requirements.txt file on your default branch and add the line:</strong><i> payplug==1.3.1</i></li> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"> |
||||
|
<i class="fa fa-check text-primary"></i><strong>Documentation:</strong> <a href="https://www.payplug.com" target="_blank"><strong>www.payplug.com<strong></a></li><br><br> |
||||
|
<li style="font-size: initial; font-family: Open Sans !important;"> |
||||
|
<i class="fa fa-check text-primary"></i><strong>Contact US:</strong><br/><strong>Email:</strong><a href="mailto:support@applylog.com"><strong> support@applylog.com</strong></a><br/><strong>Website:</strong> <a href="http://www.applylog.com" target="_blank"><strong>www.applylog.com<strong></a></li> |
||||
|
|
||||
|
</ul> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
|
||||
|
<br/><br/> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
@ -0,0 +1,271 @@ |
|||||
|
.oney_none_information { |
||||
|
color: gray; |
||||
|
border: 1px solid gray; |
||||
|
width: 50px; |
||||
|
} |
||||
|
|
||||
|
.table_x_oney { |
||||
|
font-size: 12px; |
||||
|
color: gray; |
||||
|
} |
||||
|
|
||||
|
.banner-oney-product { |
||||
|
width: 135px; |
||||
|
position: relative; |
||||
|
display: inline-block; |
||||
|
} |
||||
|
|
||||
|
.banner-oney-product .img-oney { |
||||
|
width: 135px; |
||||
|
} |
||||
|
|
||||
|
.banner-oney-product .img-oney-top { |
||||
|
width: 135px; |
||||
|
display: none; |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
z-index: 200; |
||||
|
} |
||||
|
|
||||
|
.banner-oney-product:hover .img-oney-top { |
||||
|
display: inline; |
||||
|
} |
||||
|
|
||||
|
.div-oney-none { |
||||
|
width: 300px; |
||||
|
min-height: 80px; |
||||
|
display: table; |
||||
|
position: absolute; |
||||
|
background: white; |
||||
|
border: 3px solid #cdcecc; |
||||
|
} |
||||
|
|
||||
|
.arrow-left-none { |
||||
|
border: 3px solid #cdcecc; |
||||
|
border-width: 0 3px 3px 0; |
||||
|
display: inline-block; |
||||
|
background-color: white; |
||||
|
padding: 8px; |
||||
|
transform: rotate(-45deg); |
||||
|
-webkit-transform: rotate(-45deg); |
||||
|
position: relative; |
||||
|
left: 287px; |
||||
|
top: -30px; |
||||
|
} |
||||
|
|
||||
|
.div-oney-none-text { |
||||
|
position: relative; |
||||
|
display: block; |
||||
|
width: 97%; |
||||
|
height: 100%; |
||||
|
margin: 4px; |
||||
|
color: #b3b3b3; |
||||
|
font-style: italic; |
||||
|
} |
||||
|
|
||||
|
.div-oney { |
||||
|
width: 352px; |
||||
|
height: 464px; |
||||
|
position: absolute; |
||||
|
border: 2px solid #81bc00; |
||||
|
display: table; |
||||
|
background: white; |
||||
|
z-index: 1022; |
||||
|
} |
||||
|
|
||||
|
.arrow-left { |
||||
|
border: 2px solid #81bc00; |
||||
|
border-width: 0 3px 3px 0; |
||||
|
display: inline-block; |
||||
|
background-color: white; |
||||
|
padding: 8px; |
||||
|
transform: rotate(-45deg); |
||||
|
-webkit-transform: rotate(-45deg); |
||||
|
position: relative; |
||||
|
left: 341px; |
||||
|
top: 150px; |
||||
|
} |
||||
|
|
||||
|
.div2-oney { |
||||
|
top: -23px; |
||||
|
height: 97%; |
||||
|
display: block; |
||||
|
position: relative; |
||||
|
margin: 5px; |
||||
|
background: white; |
||||
|
} |
||||
|
|
||||
|
.div2-oney .div-oney-close { |
||||
|
text-align: right; |
||||
|
height: 20px; |
||||
|
} |
||||
|
|
||||
|
.div-oney-close .oney-close { |
||||
|
font-size: 20px; |
||||
|
font-family: Arial, Helvetica, sans-serif; |
||||
|
display: relative; |
||||
|
color: #81bc00; |
||||
|
font-weight: bold; |
||||
|
text-align: right; |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
|
||||
|
.div-oney .div2-oney .title_oney { |
||||
|
width: 62%; |
||||
|
margin-bottom: 3px; |
||||
|
display: block; |
||||
|
} |
||||
|
|
||||
|
.div2-oney .footer-oney { |
||||
|
font-family: Arial, Helvetica, sans-serif; |
||||
|
margin-top: 6px; |
||||
|
font-size: 10px; |
||||
|
color: gray; |
||||
|
text-align: justify; |
||||
|
} |
||||
|
|
||||
|
/* BUTTON 3x ONEY */ |
||||
|
.div2-oney .button-3x-group { |
||||
|
height: 25px; |
||||
|
border-top: 2px solid #cdcecc; |
||||
|
border-left: 2px solid #cdcecc; |
||||
|
border-right: 2px solid #cdcecc; |
||||
|
} |
||||
|
|
||||
|
.button-3x-group .text-button { |
||||
|
color: #777; |
||||
|
font-family: Arial, Helvetica, sans-serif; |
||||
|
margin-left: 8px; |
||||
|
font-size: 15px; |
||||
|
} |
||||
|
|
||||
|
.button-3x-group:hover { |
||||
|
background: #e7fad9; |
||||
|
font-family: Arial, Helvetica, sans-serif; |
||||
|
border-top: 2px solid #81bc00; |
||||
|
border-left: 2px solid #81bc00; |
||||
|
border-right: 2px solid #81bc00; |
||||
|
} |
||||
|
|
||||
|
.button-3x-group-active { |
||||
|
background: #e7fad9; |
||||
|
height: 27px; |
||||
|
font-family: Arial, Helvetica, sans-serif; |
||||
|
border: 2px solid #81bc00; |
||||
|
} |
||||
|
|
||||
|
.button-3x-group-active .text-button { |
||||
|
color: #777; |
||||
|
font-family: Arial, Helvetica, sans-serif; |
||||
|
font-size: 15px; |
||||
|
margin-left: 8px; |
||||
|
} |
||||
|
|
||||
|
/* BUTTON 4x ONEY */ |
||||
|
.div2-oney .button-4x-group { |
||||
|
height: 25px; |
||||
|
border-bottom: 2px solid #cdcecc; |
||||
|
border-left: 2px solid #cdcecc; |
||||
|
border-right: 2px solid #cdcecc; |
||||
|
} |
||||
|
|
||||
|
.button-4x-group .text-button { |
||||
|
color: #777; |
||||
|
font-family: Arial, Helvetica, sans-serif; |
||||
|
margin-left: 8px; |
||||
|
font-size: 15px; |
||||
|
} |
||||
|
|
||||
|
.button-4x-group:hover { |
||||
|
background: #e7fad9; |
||||
|
font-family: Arial, Helvetica, sans-serif; |
||||
|
border-bottom: 2px solid #81bc00; |
||||
|
border-left: 2px solid #81bc00; |
||||
|
border-right: 2px solid #81bc00; |
||||
|
} |
||||
|
|
||||
|
.button-4x-group-active { |
||||
|
background: #e7fad9; |
||||
|
height: 27px; |
||||
|
font-family: Arial, Helvetica, sans-serif; |
||||
|
border: 2px solid #81bc00; |
||||
|
} |
||||
|
|
||||
|
.button-4x-group-active .text-button { |
||||
|
color: #777; |
||||
|
font-family: Arial, Helvetica, sans-serif; |
||||
|
margin-left: 8px; |
||||
|
font-size: 15px; |
||||
|
} |
||||
|
|
||||
|
.div-oney .div2-oney .payment-detail { |
||||
|
top: 5px; |
||||
|
font-family: Arial, Helvetica, sans-serif; |
||||
|
font-size: 13px; |
||||
|
position: relative; |
||||
|
font-family: Arial, Helvetica, sans-serif; |
||||
|
min-height: 159px; |
||||
|
color: gray; |
||||
|
border-bottom: 1px solid #81bc00; |
||||
|
} |
||||
|
|
||||
|
.div-oney .div2-oney .payment-detail .small-text { |
||||
|
font-family: Arial, Helvetica, sans-serif; |
||||
|
font-size: 10px; |
||||
|
color: gray; |
||||
|
} |
||||
|
|
||||
|
.div-oney .div2-oney .payment-detail .table-detail { |
||||
|
width: 100%; |
||||
|
border-spacing: 0px; |
||||
|
} |
||||
|
|
||||
|
.div-payment { |
||||
|
border-top: 2px solid #dde1e6; |
||||
|
position: relative; |
||||
|
top: -12px; |
||||
|
} |
||||
|
|
||||
|
.arrow-payment { |
||||
|
border: 2px solid #dde1e6; |
||||
|
border-width: 0 2px 2px 0; |
||||
|
display: inline-block; |
||||
|
background-color: white; |
||||
|
padding: 4px; |
||||
|
transform: rotate(-135deg); |
||||
|
-webkit-transform: rotate(-135deg); |
||||
|
position: relative; |
||||
|
height: 5px; |
||||
|
left: 20px; |
||||
|
} |
||||
|
|
||||
|
.text-right-simulation { |
||||
|
text-size: 10px; |
||||
|
text-align: right; |
||||
|
width: 90%; |
||||
|
background: transparent; |
||||
|
border: none; |
||||
|
} |
||||
|
|
||||
|
.text-price-product-oney { |
||||
|
margin-right: -18px; |
||||
|
text-align: right; |
||||
|
width: 40%; |
||||
|
background: transparent; |
||||
|
border: none; |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
After Width: 200 | Height: 120 | Size: 7.0 KiB |
After Width: 225 | Height: 225 | Size: 3.8 KiB |
After Width: 300 | Height: 179 | Size: 7.9 KiB |
After Width: 219 | Height: 139 | Size: 20 KiB |
After Width: 219 | Height: 139 | Size: 23 KiB |
After Width: 219 | Height: 139 | Size: 6.4 KiB |
After Width: 306 | Height: 20 | Size: 1.5 KiB |
After Width: 306 | Height: 20 | Size: 1.9 KiB |
After Width: 306 | Height: 20 | Size: 1.5 KiB |
After Width: 306 | Height: 20 | Size: 1.8 KiB |
After Width: 185 | Height: 34 | Size: 4.5 KiB |
After Width: 185 | Height: 34 | Size: 4.5 KiB |
After Width: 185 | Height: 34 | Size: 3.2 KiB |
After Width: 135 | Height: 34 | Size: 2.2 KiB |
After Width: 135 | Height: 34 | Size: 4.4 KiB |
After Width: 136 | Height: 34 | Size: 2.1 KiB |
After Width: 136 | Height: 34 | Size: 4.1 KiB |
After Width: 225 | Height: 225 | Size: 3.8 KiB |
After Width: 610 | Height: 374 | Size: 145 KiB |
After Width: 287 | Height: 141 | Size: 7.9 KiB |
After Width: 200 | Height: 200 | Size: 5.4 KiB |
After Width: 274 | Height: 127 | Size: 9.1 KiB |
After Width: 113 | Height: 25 | Size: 6.6 KiB |
After Width: 225 | Height: 225 | Size: 3.8 KiB |
After Width: 253 | Height: 199 | Size: 4.1 KiB |
@ -0,0 +1,199 @@ |
|||||
|
odoo.define('acquirer_payplug.website_oney', function (require) { |
||||
|
"use strict"; |
||||
|
|
||||
|
var publicWidget = require('web.public.widget'); |
||||
|
var core = require('web.core'); |
||||
|
var _t = core._t; |
||||
|
var ajax = require('web.ajax'); |
||||
|
var timeout; |
||||
|
|
||||
|
publicWidget.registry.websiteSaleOney = publicWidget.Widget.extend({ |
||||
|
selector: '.oe_website_sale, .o_portal_wrap, form[name="o_payment_checkout"]', |
||||
|
events: { |
||||
|
'mouseover a.js_oney_banner': '_onMouseOverOney', |
||||
|
'mouseout a.js_oney_banner': '_onMouseOutOney', |
||||
|
'click a.js_oney_banner': '_onClickBannerOney', |
||||
|
'click a.js_oney_close': '_onClickClosePopupInformation', |
||||
|
'click a.js_oney_banner_cart': '_onClickBannerCartOney', |
||||
|
|
||||
|
'mouseover a.js_information_none_oney_cart': '_onMouseOverInformationNoneCart', |
||||
|
'mouseout a.js_information_none_oney_cart': '_onMouseOutInformationNoneCart', |
||||
|
|
||||
|
'click a.js_payment_img-3x-gray': '_onClickPaymentImage', |
||||
|
'click a.js_payment_img-4x-gray': '_onClickPaymentImage', |
||||
|
'mouseover a.js_oney_information': '_onMouseOverOneyInformation', |
||||
|
'mouseout a.js_oney_information': '_onMouseOutOneyInformation', |
||||
|
'mouseover a.js_oney_information_payment': '_onMouseOverOneyInformationPayment', |
||||
|
'mouseout a.js_oney_information_payment': '_onMouseOutOneyInformationPayment', |
||||
|
'click .o_provider_payplug_card' : '_onClickBannerProvider', |
||||
|
}, |
||||
|
|
||||
|
init: function () { |
||||
|
this._super.apply(this, arguments); |
||||
|
}, |
||||
|
|
||||
|
start: function () { |
||||
|
return this._super.apply(this, arguments); |
||||
|
}, |
||||
|
|
||||
|
// Close pop-up information cart
|
||||
|
_onClickClosePopupInformation: function(ev) { |
||||
|
document.getElementById('oney_popup_card').style.display = 'none'; |
||||
|
}, |
||||
|
|
||||
|
// Over information Inline in cart
|
||||
|
_onMouseOverInformationNoneCart: function (ev) { |
||||
|
document.getElementById('div_oney_none').style.display = 'inline'; |
||||
|
}, |
||||
|
|
||||
|
// Out information None in cart
|
||||
|
_onMouseOutInformationNoneCart: function (ev) { |
||||
|
document.getElementById('div_oney_none').style.display = 'none'; |
||||
|
}, |
||||
|
|
||||
|
_onClickBannerCartOney: function (ev) { |
||||
|
// CALL WITH PYTHON JSON RPC FOR GET SIMULATION
|
||||
|
ajax.jsonRpc('/shop/product/oney_simulation', 'call', { |
||||
|
'product_total_price': document.getElementById('total_price_cart').value, |
||||
|
}).then(function (data) { |
||||
|
document.getElementById('amount_total_oney_3x').value = data['amount_total_oney']; |
||||
|
document.getElementById('contribution_of_3x').value = data['payment_3x']['contribution_of_3x']; |
||||
|
document.getElementById('1st_monthly_payment_3x').value = data['payment_3x']['1st_monthly_payment_3x']; |
||||
|
document.getElementById('2nd_monthly_payment_3x').value = data['payment_3x']['2nd_monthly_payment_3x']; |
||||
|
document.getElementById('total_payment_3x').value = data['payment_3x']['total_payment_3x']; |
||||
|
document.getElementById('amount_total_oney_4x').value = data['amount_total_oney']; |
||||
|
document.getElementById('contribution_of_4x').value = data['payment_4x']['contribution_of_4x']; |
||||
|
document.getElementById('1st_monthly_payment_4x').value = data['payment_4x']['1st_monthly_payment_4x']; |
||||
|
document.getElementById('2nd_monthly_payment_4x').value = data['payment_4x']['2nd_monthly_payment_4x']; |
||||
|
document.getElementById('3nd_monthly_payment_4x').value = data['payment_4x']['3nd_monthly_payment_4x']; |
||||
|
document.getElementById('total_payment_4x').value = data['payment_4x']['total_payment_4x']; |
||||
|
}); |
||||
|
document.getElementById('oney_popup_card').style.display = 'inline'; |
||||
|
}, |
||||
|
|
||||
|
// Change img Oney Over
|
||||
|
_onMouseOverOney: function (ev) { |
||||
|
document.getElementById('img-oney').style.display = 'none'; |
||||
|
document.getElementById('img-oney-top').style.display = 'inline'; |
||||
|
}, |
||||
|
|
||||
|
// Change img Oney Out
|
||||
|
_onMouseOutOney: function (ev) { |
||||
|
document.getElementById('img-oney').style.display = 'inline'; |
||||
|
document.getElementById('img-oney-top').style.display = 'none'; |
||||
|
}, |
||||
|
|
||||
|
_onMouseOverOneyInformation: function (ev) { |
||||
|
var element = document.getElementById('img-oney-gray'); |
||||
|
var position = element.getBoundingClientRect(); |
||||
|
var element1 = document.getElementById('InformationOney'); |
||||
|
var position1 = element1.getBoundingClientRect(); |
||||
|
document.getElementById('div_oney_information_none').style.display = 'inline'; |
||||
|
document.getElementById('div_oney_information_none').style.left = '350px'; |
||||
|
document.getElementById('div_oney_information_none').style.top = '100px'; |
||||
|
}, |
||||
|
// Banner information Oney None
|
||||
|
_onMouseOutOneyInformation: function (ev) { |
||||
|
document.getElementById('div_oney_information_none').style.display = 'none'; |
||||
|
}, |
||||
|
// Banner Oney in cart payment
|
||||
|
_onClickPaymentImage: function (ev) { |
||||
|
if (ev.handleObj.selector === 'a.js_payment_img-3x-gray') { |
||||
|
document.getElementById('checked_3_x').checked = true; |
||||
|
document.getElementById('checkbox_3x').style.opacity = '1.00'; |
||||
|
document.getElementById('payment_banner_img_3x').style.display = 'inline'; |
||||
|
document.getElementById('payment_banner_img_3x_gray').style.display = 'none'; |
||||
|
document.getElementById('table_3x_oney').style.display = 'inline'; |
||||
|
document.getElementById('checked_4_x').checked = false; |
||||
|
document.getElementById('checkbox_4x').style.opacity = '0.25'; |
||||
|
document.getElementById('payment_banner_img_4x').style.display = 'none'; |
||||
|
document.getElementById('payment_banner_img_4x_gray').style.display = 'inline'; |
||||
|
document.getElementById('table_4x_oney').style.display = 'none'; |
||||
|
} |
||||
|
if (ev.handleObj.selector === 'a.js_payment_img-4x-gray') { |
||||
|
document.getElementById('checked_3_x').checked = false; |
||||
|
document.getElementById('checkbox_3x').style.opacity = '0.25'; |
||||
|
document.getElementById('payment_banner_img_3x').style.display = 'none'; |
||||
|
document.getElementById('payment_banner_img_3x_gray').style.display = 'inline'; |
||||
|
document.getElementById('table_3x_oney').style.display = 'none'; |
||||
|
document.getElementById('checked_4_x').checked = true; |
||||
|
document.getElementById('checkbox_4x').style.opacity = '1.00'; |
||||
|
document.getElementById('payment_banner_img_4x').style.display = 'inline'; |
||||
|
document.getElementById('payment_banner_img_4x_gray').style.display = 'none'; |
||||
|
document.getElementById('table_4x_oney').style.display = 'inline'; |
||||
|
} |
||||
|
}, |
||||
|
// Banner information Oney None
|
||||
|
_onMouseOverOneyInformationPayment: function (ev) { |
||||
|
document.getElementById('div_oney_information_payment_none').style.display = 'inline'; |
||||
|
document.getElementById('div_oney_information_payment_none').style.left = '-313px'; |
||||
|
document.getElementById('div_oney_information_payment_none').style.top = '-10px'; |
||||
|
}, |
||||
|
|
||||
|
_onMouseOutOneyInformationPayment: function (ev) { |
||||
|
document.getElementById('div_oney_information_payment_none').style.display = 'none'; |
||||
|
}, |
||||
|
|
||||
|
_onClickBannerOney: function (ev) { |
||||
|
// Call with Python Json RPC for get simulation Oney
|
||||
|
ajax.jsonRpc('/shop/product/oney_simulation', 'call', { |
||||
|
'product_total_price': document.getElementById('price_total_oney').value, |
||||
|
}).then(function (data) { |
||||
|
document.getElementById('amount_total_oney_3x').value = data['amount_total_oney']; |
||||
|
document.getElementById('contribution_of_3x').value = data['payment_3x']['contribution_of_3x']; |
||||
|
document.getElementById('1st_monthly_payment_3x').value = data['payment_3x']['1st_monthly_payment_3x']; |
||||
|
document.getElementById('2nd_monthly_payment_3x').value = data['payment_3x']['2nd_monthly_payment_3x']; |
||||
|
document.getElementById('total_payment_3x').value = data['payment_3x']['total_payment_3x']; |
||||
|
document.getElementById('amount_total_oney_4x').value = data['amount_total_oney']; |
||||
|
document.getElementById('contribution_of_4x').value = data['payment_4x']['contribution_of_4x']; |
||||
|
document.getElementById('1st_monthly_payment_4x').value = data['payment_4x']['1st_monthly_payment_4x']; |
||||
|
document.getElementById('2nd_monthly_payment_4x').value = data['payment_4x']['2nd_monthly_payment_4x']; |
||||
|
document.getElementById('3nd_monthly_payment_4x').value = data['payment_4x']['3nd_monthly_payment_4x']; |
||||
|
document.getElementById('total_payment_4x').value = data['payment_4x']['total_payment_4x']; |
||||
|
}); |
||||
|
document.getElementById('oney_popup').style.display = 'inline'; |
||||
|
}, |
||||
|
|
||||
|
_onClickBannerProvider: function (ev) { |
||||
|
// Call with Python Json RPC for get provider payplug
|
||||
|
if ($(ev.currentTarget).prev('input').val(1).trigger('change')) { |
||||
|
var provider = ev.currentTarget.getAttribute("data-provider-payplug"); |
||||
|
var type_oney = 'oney_x3_with_fees'; |
||||
|
if (document.getElementById('checked_3_x')) { |
||||
|
if (document.getElementById('checked_4_x').checked == true) { |
||||
|
type_oney = 'oney_x4_with_fees' |
||||
|
} else { |
||||
|
type_oney = 'oney_x3_with_fees' |
||||
|
} |
||||
|
} |
||||
|
ajax.jsonRpc("/provider_payplug", 'call', {'provider_payplug': provider, 'type_oney': type_oney}); |
||||
|
} |
||||
|
}, |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
@ -0,0 +1,338 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
|
||||
|
<!-- ONEY CALCULATE PAYMENT SIMULATION --> |
||||
|
<template id="oney_detail_simulation" name="Oney detail"> |
||||
|
<input type="hidden" id="Type-oney" name="Type oney" value="3x-oney"/> |
||||
|
<a href="#" onclick="document.getElementById('div-oney-3x').style.display = 'inline'; |
||||
|
document.getElementById('button-3x-group').className = 'button-3x-group-active'; |
||||
|
document.getElementById('div-oney-4x').style.display = 'none'; |
||||
|
document.getElementById('button-4x-group').className = 'button-4x-group';" |
||||
|
style="text-decoration: none;"> |
||||
|
<div id="button-3x-group" class="button-3x-group-active"> |
||||
|
<span class="text-button">3x payment</span> |
||||
|
</div> |
||||
|
</a> |
||||
|
<a href="#" onclick="document.getElementById('div-oney-3x').style.display = 'none'; |
||||
|
document.getElementById('button-3x-group').className = 'button-3x-group'; |
||||
|
document.getElementById('div-oney-4x').style.display = 'inline'; |
||||
|
document.getElementById('button-4x-group').className = 'button-4x-group-active';" |
||||
|
style="text-decoration: none;"> |
||||
|
<div id="button-4x-group" class="button-4x-group"> |
||||
|
<span class="text-button">4x payment</span> |
||||
|
</div> |
||||
|
</a> |
||||
|
<div class="payment-detail"> |
||||
|
<div id="div-oney-3x" style="display: inline;"> |
||||
|
<table class="table-detail" cellspacing="0"> |
||||
|
<tr> |
||||
|
<td><strong>For an amount of:</strong></td><td><strong><input id="amount_total_oney_3x" type="text" class="text-right-simulation" disabled="disabled" t-att-value="0"/> <span t-esc="currency_symbol"/></strong></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>First intake:</td><td><strong><input id="contribution_of_3x" type="text" class="text-right-simulation" disabled="disabled" t-att-value="0"/> <span t-esc="currency_symbol"/></strong></td> |
||||
|
</tr> |
||||
|
<tr class="small-text"> |
||||
|
<td colspan="2">(Cost of financing: <strong>8,93 €</strong>TAEG : <strong>19,26 €</strong>)</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>Monthly payments N°1:</td><td><strong><input id="1st_monthly_payment_3x" type="text" class="text-right-simulation" disabled="disabled" t-att-value="0"/> <span t-esc="currency_symbol"/></strong></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>Monthly payments N°2:</td><td><strong><input id="2nd_monthly_payment_3x" type="text" class="text-right-simulation" disabled="disabled" t-att-value="0"/> <span t-esc="currency_symbol"/></strong></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td></td><td></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td></td><td></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><strong>Total :</strong></td><td> |
||||
|
<strong><input id="total_payment_3x" type="text" class="text-right-simulation" disabled="disabled" t-att-value="0"/> <span t-esc="currency_symbol"/></strong></td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</div> |
||||
|
<div id="div-oney-4x" style="display: none;"> |
||||
|
<table class="table-detail" cellspacing="0"> |
||||
|
<tr> |
||||
|
<td><strong>For an amount of:</strong></td><td><strong><input id="amount_total_oney_4x" type="text" class="text-right-simulation" disabled="disabled" t-att-value="0"/> <span t-esc="currency_symbol"/></strong></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>First intake:</td><td><strong><input id="contribution_of_4x" type="text" class="text-right-simulation" disabled="disabled" t-att-value="0"/> <span t-esc="currency_symbol"/></strong></td> |
||||
|
</tr> |
||||
|
<tr class="small-text"> |
||||
|
<td colspan="2">(Cost of financing: <strong>8,93 €</strong>TAEG : <strong>19,26 €</strong>)</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>Monthly payments N°1:</td><td><strong><input id="1st_monthly_payment_4x" type="text" class="text-right-simulation" disabled="disabled" t-att-value="0"/> <span t-esc="currency_symbol"/></strong></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>Monthly payments N°2:</td><td><strong><input id="2nd_monthly_payment_4x" type="text" class="text-right-simulation" disabled="disabled" t-att-value="0"/> <span t-esc="currency_symbol"/></strong></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>Monthly payments N°3:</td><td><strong><input id="3nd_monthly_payment_4x" type="text" class="text-right-simulation" disabled="disabled" t-att-value="0"/> <span t-esc="currency_symbol"/></strong></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td></td><td></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><strong>Total :</strong></td><td class="text-right"> |
||||
|
<strong><input id="total_payment_4x" type="text" class="text-right-simulation" disabled="disabled" t-att-value="0"/> <span t-esc="currency_symbol"/></strong></td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<template id="product_quantity_oney" inherit_id="website_sale.product_quantity"> |
||||
|
<xpath expr="//input[@name='add_qty']" position="attributes"> |
||||
|
<attribute name="id">add_qty</attribute> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
<!-- ONEY FOOTER DETAIL INFORMATION --> |
||||
|
<template id="oney_footer_detail" name="Oney Footer Detail"> |
||||
|
<div class="footer-oney"><t t-esc="FooterMessage"/></div> |
||||
|
</template> |
||||
|
|
||||
|
<!-- BANNER ONEY IN PRODUCT FORM--> |
||||
|
<template id="product_price_oney" inherit_id="website_sale.product_price"> |
||||
|
<xpath expr="//div[@itemprop='offers']/h3" position="after"> |
||||
|
<div style="visibility: hidden;"> |
||||
|
<span t-if="product.image_1920"> |
||||
|
<img t-att-src="image_data_uri(product.image_1920)" style="height: 6px;"/> |
||||
|
</span> |
||||
|
<span t-else="" |
||||
|
t-field="product.image_1920" |
||||
|
t-options="{'widget': 'image', 'qweb_img_responsive': False, 'class': 'rounded o_image_64_max'}" |
||||
|
/> |
||||
|
</div> |
||||
|
<div t-if="acquirer.code == 'payplug' and acquirer.state != 'disables' and acquirer.payment_type_oney == True and authorized_by_company == True" |
||||
|
class="banner_oney_product" |
||||
|
name="banner_oney"> |
||||
|
<!-- POPUP SIMULATION ONEY BANNER --> |
||||
|
<div t-if="authorized_by_oney==True" id="OneyPopup" style="display: inline; margin-bottom: 3px;" > |
||||
|
<a href="#" class="js_oney_banner"> |
||||
|
<img id="img-oney" src="/acquirer_payplug/static/src/img/icon/oney/icon_oney_3x4x_1.png" |
||||
|
class="img-oney" |
||||
|
style="display: inline;"/> |
||||
|
<img id="img-oney-top" src="/acquirer_payplug/static/src/img/icon/oney/icon_oney_3x4x_2.png" |
||||
|
class="img-oney-top" |
||||
|
style="display: none;"/> |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<!-- TO CALCULATE THE TOTAL AMOUNT ACCORDING TO THE QUANTITY --> |
||||
|
<input type="hidden" id="priceoney" name="priceoney" t-att-value="combination_info['price']"/> |
||||
|
<!-- POPUP INFORMATION ONEY --> |
||||
|
<div t-if="acquirer.code == 'payplug' and acquirer.state != 'disabled' and acquirer.payment_type_oney == True and authorized_by_company == True"> |
||||
|
<div id="InformationOney" style="display: inline;"> |
||||
|
<div t-if="authorized_by_oney==False"> |
||||
|
<a href="#" class="js_oney_information" id="oney_information"> |
||||
|
<img id="img-oney-gray" src="/acquirer_payplug/static/src/img/icon/oney/icon_oney_3x4x_3.png" class="img-oney"/> |
||||
|
</a> |
||||
|
</div> |
||||
|
<!-- POPUP INFORMATION --> |
||||
|
<div id="div_oney_information_none" class="div-oney-none" style="display: none; top: 0px; left: 0px;"> |
||||
|
<div> |
||||
|
<p class="div-oney-none-text"><t t-esc="InformationMessage"/></p> |
||||
|
</div> |
||||
|
<div class="arrow-left-none"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<!-- PRICE BY QTY --> |
||||
|
<span id="text_simulations_oney" style="display: none;"><i>Simulation Oney :</i></span> |
||||
|
<span t-if="acquirer.code == 'payplug' and acquirer.state != 'disabled' and acquirer.payment_type_oney == True"> |
||||
|
<input type="number" disabled="disabled" t-att-value="combination_info['price']" |
||||
|
id="price_total_oney" |
||||
|
style="display: none; white-space: nowrap;" |
||||
|
class="text-price-product-oney"/> |
||||
|
</span> |
||||
|
<input type="hidden" id="authorized_by_oney" disabled="disabled" t-att-value="authorized_by_oney"/> |
||||
|
|
||||
|
<!-- POPUP SIMULATION ONEY --> |
||||
|
<div id="oney_popup" class="div-oney" style="display:none; top: -30px; left: 300px;"> |
||||
|
<div class="arrow-left"/> |
||||
|
<div class="div2-oney"> |
||||
|
<div class="div-oney-close"> |
||||
|
<a href="#" onclick="document.getElementById('oney_popup').style.display = 'none';" class="oney-close" title="Close">X</a> |
||||
|
</div> |
||||
|
<img src="/acquirer_payplug/static/src/img/icon/oney/title_popup.png" class="title_oney"/> |
||||
|
<t t-call="acquirer_payplug.oney_detail_simulation"/> |
||||
|
<t t-call="acquirer_payplug.oney_footer_detail"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
<!-- TO DISPLAY POP-UPS OF THE FORM SHOP CART --> |
||||
|
<template id="pop_up_oney_summary" inherit_id="website_sale.short_cart_summary" name="Short Cart right column"> |
||||
|
<xpath expr="//div[hasclass('js_cart_summary')]" position="after"> |
||||
|
<!-- POP-UP SIMULATION --> |
||||
|
<div id="oney_popup_card" class="div-oney" style="display:none; top: 185px; left: -172px;"> |
||||
|
<div class="arrow-left"/> |
||||
|
<div id="div2-oney" class="div2-oney"> |
||||
|
<div class="div-oney-close"> |
||||
|
<a href="#" class="js_oney_close" title="Close">X</a> |
||||
|
</div> |
||||
|
<img src="/acquirer_payplug/static/src/img/icon/oney/title_popup.png" class="title_oney"/> |
||||
|
<t t-call="acquirer_payplug.oney_detail_simulation"/> |
||||
|
<t t-call="acquirer_payplug.oney_footer_detail"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- POPUP INFORMATION --> |
||||
|
<div id="div_oney_none" class="div-oney-none" style="display: none; top: 200px; left: 500px;"> |
||||
|
<div> |
||||
|
<p class="div-oney-none-text"><t t-esc="InformationMessage"/></p> |
||||
|
</div> |
||||
|
<div class="arrow-left-none"/> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
<!-- FORM SHOP CART --> |
||||
|
<template id="short_cart_summary" inherit_id="website_sale.short_cart_summary" name="Short Cart right column"> |
||||
|
<xpath expr="//div[hasclass('card-body')]" position="after"> |
||||
|
<t t-if="acquirer"> |
||||
|
<div t-if="acquirer.code == 'payplug' and acquirer.state != 'disabled' and acquirer.payment_type_oney == True and authorized_by_company == True and acquirer.is_published == True" |
||||
|
style="width: 95%; margin-top: 8px;" |
||||
|
class="js_popup_oney_cart"> |
||||
|
<input type="hidden" id="total_price_cart" name="priceoney" t-att-value="website_sale_order.amount_total"/> |
||||
|
<div class="banner-oney-product float-end" name="banner_oney"> |
||||
|
<t t-if="website_sale_order.amount_total > 100 and website_sale_order.amount_total < 3000"> |
||||
|
<a href="#" class="js_oney_banner_cart"> |
||||
|
<img src="/acquirer_payplug/static/src/img/icon/oney/icon_oney_3x4x_1.png" class="img-oney"/> |
||||
|
<img src="/acquirer_payplug/static/src/img/icon/oney/icon_oney_3x4x_2.png" class="img-oney-top"/> |
||||
|
</a> |
||||
|
</t> |
||||
|
<t t-if="website_sale_order.amount_total < 100 or website_sale_order.amount_total > 3000"> |
||||
|
<a href="#" class="js_information_none_oney_cart"> |
||||
|
<img src="/acquirer_payplug/static/src/img/icon/oney/icon_oney_3x4x_3.png" class="img-oney"/> |
||||
|
</a> |
||||
|
</t> |
||||
|
</div> |
||||
|
</div> |
||||
|
</t> |
||||
|
<br/> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
<template id="icon_list_oney" name="Payment Icon List Oney"> |
||||
|
<xpath expr="//ul/t[2]" position="after"> |
||||
|
<ul class="payment_icon_list float-end list-inline" data-max-icons="3"> |
||||
|
<t t-set="icon_index" t-value="0"/> |
||||
|
<t t-set="MAX_ICONS" t-value="3"/> |
||||
|
<!-- === Icons === --> |
||||
|
<!-- Only shown if in the first 3 icons --> |
||||
|
<t t-foreach="provider.payment_icon_ids.filtered(lambda r: r.image_payment_form)" t-as="icon"> |
||||
|
<li t-attf-class="list-inline-item{{'' if (icon_index < MAX_ICONS) else ' d-none'}}"> |
||||
|
<span t-esc="icon.image_payment_form" |
||||
|
t-options="{'widget': 'image', 'alt-field': 'name'}" |
||||
|
data-toggle="tooltip" |
||||
|
t-att-title="icon.name"/> |
||||
|
</li> |
||||
|
<t t-set="icon_index" t-value="icon_index + 1"/> |
||||
|
</t> |
||||
|
<t t-if="icon_index >= MAX_ICONS"> |
||||
|
<!-- === "show more" button === --> |
||||
|
<!-- Only displayed if too many payment icons --> |
||||
|
<li style="display:block;" class="list-inline-item"> |
||||
|
<span class="float-end more_option text-info"> |
||||
|
<a name="o_payment_icon_more" |
||||
|
data-toggle="tooltip" |
||||
|
t-att-title="', '.join([icon.name for icon in provider.payment_icon_ids[MAX_ICONS:]])"> |
||||
|
show more |
||||
|
</a> |
||||
|
</span> |
||||
|
</li> |
||||
|
<!-- === "show less" button === --> |
||||
|
<!-- Only displayed when "show more" is clicked --> |
||||
|
<li style="display:block;" class="list-inline-item d-none"> |
||||
|
<span class="float-end more_option text-info"> |
||||
|
<a name="o_payment_icon_less">show less</a> |
||||
|
</span> |
||||
|
</li> |
||||
|
<br/> |
||||
|
<!-- BANNER INFORMATION --> |
||||
|
<div t-if="authorized_by_oney == False"> |
||||
|
<a href="#" class="js_oney_information_payment" style="cursor: help;"> |
||||
|
<img src="/acquirer_payplug/static/src/img/icon/oney/icon_oney_3x4x_3.png" style="width: 170px; margin-bottom: 5px; margin-top: 33px;"/> |
||||
|
</a> |
||||
|
<!-- POPUP INFORMATION --> |
||||
|
<div id="div_oney_information_payment_none" class="div-oney-none" style="z-index: 3000; display: none; top: -10px; left: -313px;"> |
||||
|
<div> |
||||
|
<p class="div-oney-none-text"><t t-esc="InformationMessage"/></p> |
||||
|
</div> |
||||
|
<div class="arrow-left-none"/> |
||||
|
</div> |
||||
|
<br/> |
||||
|
</div> |
||||
|
<span t-if="authorized_by_oney == True"> |
||||
|
<p style="font-size: 12px;"><i class="fa fa-arrow-circle-down"/><b><i> Select 3x or 4x payment.</i></b></p> |
||||
|
<table style="width: 100%; margin-top: 3px;"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<i class="fa fa-check-square-o fa-lg" style="color: green; opacity: 1.00" id="checkbox_3x" role="img"/> |
||||
|
<input type="checkbox" style="display: none;" id="checked_3_x" checked="true" onclick="return false;"/> |
||||
|
<img id="payment_banner_img_3x" class="payment_banner_img_3x" |
||||
|
src="/acquirer_payplug/static/src/img/icon/oney/logo-oney-3xpayant.png" |
||||
|
style="width: 120px; display: inline;" |
||||
|
title="Oney simulation payment in 3x"/> |
||||
|
<a href="#" class="js_payment_img-3x-gray"> |
||||
|
<img id="payment_banner_img_3x_gray" src="/acquirer_payplug/static/src/img/icon/oney/logo-oney-3xpayant.png" |
||||
|
style="width: 120px; display: none; opacity: 0.35" |
||||
|
title="Oney simulation payment in 3x"/> |
||||
|
</a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td colspan="2" style="width: 100%;"> |
||||
|
<div id="table_3x_oney" style="display:inline;" class="table_x_oney"> |
||||
|
<table style="width: 100%; border-top: 2px solid #55ce03; margin-bottom: 5px;"> |
||||
|
<tr><td>Contribution of:</td><td class="text-right"><span t-esc="payment_3x['contribution_of_3x']"/> <span t-esc="currency_symbol"/></td></tr> |
||||
|
<tr><td>1st monthly payment:</td><td class="text-right"><span t-esc="payment_3x['1st_monthly_payment_3x']"/> <span t-esc="currency_symbol"/></td></tr> |
||||
|
<tr><td>2nd monthly payment:</td><td class="text-right"><span t-esc="payment_3x['2nd_monthly_payment_3x']"/> <span t-esc="currency_symbol"/></td></tr> |
||||
|
</table> |
||||
|
</div> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr style="height: 8px;"/> |
||||
|
<tr> |
||||
|
<td style="margin-top: 8px;"> |
||||
|
<i class="fa fa-check-square-o fa-lg" style="color: green; opacity: 0.25" id="checkbox_4x" role="img"/> |
||||
|
<input type="checkbox" style="display: none;" id="checked_4_x" onclick="return false;"/> |
||||
|
<img id="payment_banner_img_4x" class="payment_banner_img_4x" |
||||
|
src="/acquirer_payplug/static/src/img/icon/oney/logo-oney-4xpayant.png" |
||||
|
style="width: 120px; display: none;" |
||||
|
title="Oney simulation payment in 4x"/> |
||||
|
<a href="#" class="js_payment_img-4x-gray" style="v-align: top;"> |
||||
|
<img id="payment_banner_img_4x_gray" src="/acquirer_payplug/static/src/img/icon/oney/logo-oney-4xpayant.png" |
||||
|
style="width: 120px; display: inline; opacity: 0.35" |
||||
|
title="Oney simulation payment in 4x"/> |
||||
|
</a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td colspan="2" style="width: 100%;"> |
||||
|
<div id="table_4x_oney" style="display:none;" class="table_x_oney"> |
||||
|
<table style="width: 100%; border-top: 2px solid #55ce03; margin-bottom: 5px;"> |
||||
|
<tr><td>Contribution of:</td><td class="text-right"><span t-esc="payment_4x['contribution_of_4x']"/> <span t-esc="currency_symbol"/></td></tr> |
||||
|
<tr><td>1st monthly payment:</td><td class="text-right"><span t-esc="payment_4x['1st_monthly_payment_4x']"/> <span t-esc="currency_symbol"/></td></tr> |
||||
|
<tr><td>2nd monthly payment:</td><td class="text-right"><span t-esc="payment_4x['2nd_monthly_payment_4x']"/> <span t-esc="currency_symbol"/></td></tr> |
||||
|
<tr><td>3nd monthly payment:</td><td class="text-right"><span t-esc="payment_4x['3nd_monthly_payment_4x']"/> <span t-esc="currency_symbol"/></td></tr> |
||||
|
</table> |
||||
|
</div> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</span> |
||||
|
</t> |
||||
|
</ul> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
</odoo> |
@ -0,0 +1,336 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
|
||||
|
<template id="payment_payplug_button"> |
||||
|
<form t-att-action="payplug_url" method="post"> |
||||
|
|
||||
|
</form> |
||||
|
</template> |
||||
|
|
||||
|
<!-- BANNER PAYPLUG IN CART PAYMENT FORM --> |
||||
|
<template id="checkout_inherit" inherit_id="payment.checkout" name="Payment Icon List"> |
||||
|
<xpath expr="//div[hasclass('card')]/t[@t-foreach='providers']" position="replace"> |
||||
|
<t t-foreach="providers" t-as="provider"> |
||||
|
<t t-if="provider.code=='payplug'"> |
||||
|
<!-- === Acquirer PayPLug === --> |
||||
|
<t t-if="provider.payment_type_payplug == True and authorized_country_payplug == True and provider.is_published == True"> |
||||
|
<div name="o_payment_option_card" data-provider-payplug="payplug" class="card-body o_payment_option_card o_provider_payplug_card"> |
||||
|
<label> |
||||
|
<input name="o_payment_radio" |
||||
|
type="radio" |
||||
|
t-att-class="''" |
||||
|
t-att-data-payment-option-id="provider.id" |
||||
|
t-att-data-provider="provider.code" |
||||
|
data-payment-option-type="provider"/> |
||||
|
<!-- === Acquirer name === --> |
||||
|
<span class="payment_option_name"> |
||||
|
<b><t t-esc="provider.payplug_display_as or provider.name"/></b> |
||||
|
</span> |
||||
|
<!-- === "Test Mode" badge === --> |
||||
|
<span t-if="provider.state == 'test'" |
||||
|
class="badge-pill badge-warning ml-1"> |
||||
|
Test Mode |
||||
|
</span> |
||||
|
<!-- === Extra fees badge === --> |
||||
|
<t t-if="fees_by_provider.get(provider)"> |
||||
|
<span class="badge-pill badge-secondary ml-1"> |
||||
|
+ <t t-esc="fees_by_provider.get(provider)" |
||||
|
t-options="{'widget': 'monetary', 'display_currency': currency}"/> |
||||
|
Fees |
||||
|
</span> |
||||
|
</t> |
||||
|
</label> |
||||
|
<!-- === Payment icon list === --> |
||||
|
<t t-call="payment.icon_list"/> |
||||
|
<!-- === Help message === --> |
||||
|
<div t-if="provider.pre_msg" |
||||
|
t-out="provider.pre_msg" |
||||
|
class="text-muted ml-3"/> |
||||
|
</div> |
||||
|
<!-- === Provider inline form === --> |
||||
|
<div t-attf-id="o_payment_provider_inline_form_{{provider.id}}" |
||||
|
name="o_payment_inline_form" |
||||
|
class="card-footer d-none"> |
||||
|
<!-- === Inline form content (filled by acquirer) === --> |
||||
|
<t t-if="provider.sudo()._should_build_inline_form(is_validation=False)"> |
||||
|
<t t-set="inline_form_xml_id" |
||||
|
t-value="provider.sudo().inline_form_view_id.xml_id"/> |
||||
|
<div t-if="inline_form_xml_id" class="clearfix"> |
||||
|
<t t-call="{{inline_form_xml_id}}"> |
||||
|
<t t-set="provider_id" t-value="provider.id"/> |
||||
|
</t> |
||||
|
</div> |
||||
|
</t> |
||||
|
<!-- === "Save my payment details" checkbox === --> |
||||
|
<label t-if="show_tokenize_input[provider.id]"> |
||||
|
<input name="o_payment_save_as_token" type="checkbox"/> |
||||
|
Save my payment details |
||||
|
</label> |
||||
|
</div> |
||||
|
</t> |
||||
|
<!-- === Acquirer Oney === --> |
||||
|
<t t-if="provider.payment_type_oney == True and authorized_country_oney == True and provider.is_published == True"> |
||||
|
<div name="o_payment_option_card" data-provider-payplug="oney" class="card-body o_payment_option_card o_provider_payplug_card"> |
||||
|
<label> |
||||
|
<!-- === Radio button === --> |
||||
|
<!-- Only shown if linked to the only payment option --> |
||||
|
<t t-if="authorized_by_oney==False"> |
||||
|
<input name="o_payment_radio" |
||||
|
type="hidden" |
||||
|
t-att-class="'d-none'" |
||||
|
t-att-data-payment-option-id="provider.id" |
||||
|
t-att-data-provider="provider.code" |
||||
|
data-payment-option-type="provider"/> |
||||
|
</t> |
||||
|
<t t-else=""> |
||||
|
<input name="o_payment_radio" |
||||
|
type="radio" |
||||
|
t-att-class="'' if provider_count + token_count > 1 else 'd-none'" |
||||
|
t-att-data-payment-option-id="provider.id" |
||||
|
t-att-data-provider="provider.code" |
||||
|
data-payment-option-type="provider"/> |
||||
|
</t> |
||||
|
<!-- === Acquirer name === --> |
||||
|
<span class="payment_option_name"> |
||||
|
<b><t t-esc="provider.oney_display_as or provider.name"/></b> |
||||
|
</span> |
||||
|
<!-- === "Test Mode" badge === --> |
||||
|
<span t-if="provider.state == 'test'" |
||||
|
class="badge-pill badge-warning" |
||||
|
style="margin-left:5px"> |
||||
|
Test Mode |
||||
|
</span> |
||||
|
</label> |
||||
|
<!-- === Payment icon list specific Oney === --> |
||||
|
<t t-call="acquirer_payplug.icon_list_oney"/> |
||||
|
<!-- <t t-call="payment.icon_list"/> --> |
||||
|
<!-- === Help message === --> |
||||
|
<div t-if="provider.pre_msg" |
||||
|
t-out="provider.pre_msg" |
||||
|
class="text-muted ml-3"/> |
||||
|
</div> |
||||
|
<!-- === Acquirer inline form === --> |
||||
|
<t t-if="provider.sudo()._should_build_inline_form(is_validation=True)"> |
||||
|
<div t-attf-id="o_payment_acquirer_inline_form_{{provider.id}}" |
||||
|
name="o_payment_inline_form" |
||||
|
class="card-footer d-none"> |
||||
|
<!-- === Inline form content (filled by acquirer) === --> |
||||
|
<t t-set="inline_form_xml_id" |
||||
|
t-value="provider.sudo().inline_form_view_id.xml_id"/> |
||||
|
<div t-if="inline_form_xml_id" class="clearfix"> |
||||
|
<t t-call="{{inline_form_xml_id}}"> |
||||
|
<t t-set="provider_id" t-value="provider.id"/> |
||||
|
</t> |
||||
|
</div> |
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
<!-- === Acquirer AmEx === --> |
||||
|
<t t-if="provider.payment_type_amex == True and authorized_country_amex == True and provider.is_published == True"> |
||||
|
<div name="o_payment_option_card" data-provider-payplug="american_express" class="card-body o_payment_option_card o_provider_payplug_card"> |
||||
|
<label> |
||||
|
<input name="o_payment_radio" |
||||
|
type="radio" |
||||
|
t-att-class="'' if provider_count + token_count > 1 else 'd-none'" |
||||
|
t-att-data-payment-option-id="provider.id" |
||||
|
t-att-data-provider="provider.code" |
||||
|
data-payment-option-type="provider"/> |
||||
|
<!-- === Acquirer name === --> |
||||
|
<span class="payment_option_name"> |
||||
|
<b><t t-esc="provider.amex_display_as or provider.name"/></b> |
||||
|
</span> |
||||
|
<!-- === "Test Mode" badge === --> |
||||
|
<span t-if="provider.state == 'test'" |
||||
|
class="badge-pill badge-warning ml-1"> |
||||
|
Test Mode |
||||
|
</span> |
||||
|
<!-- === Extra fees badge === --> |
||||
|
<t t-if="fees_by_provider.get(provider)"> |
||||
|
<span class="badge-pill badge-secondary ml-1"> |
||||
|
+ <t t-esc="fees_by_provider.get(provider)" |
||||
|
t-options="{'widget': 'monetary', 'display_currency': currency}"/> |
||||
|
Fees |
||||
|
</span> |
||||
|
</t> |
||||
|
</label> |
||||
|
<!-- === Payment specific icon === --> |
||||
|
<ul class="payment_icon_list float-end list-inline" data-max-icons="1"> |
||||
|
<img src='/acquirer_payplug/static/src/img/icon/american_express.png' style="max-height: 32px; margin-right: 6px;"/> |
||||
|
</ul> |
||||
|
<!-- === Help message === --> |
||||
|
<div t-if="not is_html_empty(provider.pre_msg)" |
||||
|
t-out="provider.pre_msg" |
||||
|
class="text-muted ms-3"/> |
||||
|
</div> |
||||
|
<!-- === Acquirer inline form === --> |
||||
|
<div t-attf-id="o_payment_provider_inline_form_{{provider.id}}" |
||||
|
name="o_payment_inline_form" |
||||
|
class="card-footer d-none"> |
||||
|
<!-- === Inline form content (filled by acquirer) === --> |
||||
|
<t t-if="provider.sudo()._should_build_inline_form(is_validation=False)"> |
||||
|
<t t-set="inline_form_xml_id" |
||||
|
t-value="provider.sudo().inline_form_view_id.xml_id"/> |
||||
|
<div t-if="inline_form_xml_id" class="clearfix"> |
||||
|
<t t-call="{{inline_form_xml_id}}"> |
||||
|
<t t-set="provider_id" t-value="provider.id"/> |
||||
|
</t> |
||||
|
</div> |
||||
|
</t> |
||||
|
<!-- === "Save my payment details" checkbox === --> |
||||
|
<!-- Only included if partner is known and if the choice is given --> |
||||
|
<t t-set="tokenization_required" |
||||
|
t-value="provider._is_tokenization_required(provider=provider.code)"/> |
||||
|
<label t-if="show_tokenize_input and provider.allow_tokenization and not tokenization_required"> |
||||
|
<input name="o_payment_save_as_token" type="checkbox"/> |
||||
|
Save my payment details |
||||
|
</label> |
||||
|
</div> |
||||
|
</t> |
||||
|
<!-- === Acquirer Bancontact === --> |
||||
|
<t t-if="provider.payment_type_bancontact == True and authorized_country_bancontact == True and provider.is_published == True"> |
||||
|
<div name="o_payment_option_card" data-provider-payplug="bancontact" class="card-body o_payment_option_card o_provider_payplug_card"> |
||||
|
<label> |
||||
|
<input name="o_payment_radio" |
||||
|
type="radio" |
||||
|
t-att-class="'' if provider_count + token_count > 1 else 'd-none'" |
||||
|
t-att-data-payment-option-id="provider.id" |
||||
|
t-att-data-provider="provider.code" |
||||
|
data-payment-option-type="provider"/> |
||||
|
<!-- === Acquirer name === --> |
||||
|
<span class="payment_option_name"> |
||||
|
<b><t t-esc="provider.bancontact_display_as or provider.name"/></b> |
||||
|
</span> |
||||
|
<!-- === "Test Mode" badge === --> |
||||
|
<span t-if="provider.state == 'test'" |
||||
|
class="badge-pill badge-warning ml-1"> |
||||
|
Test Mode |
||||
|
</span> |
||||
|
<!-- === Extra fees badge === --> |
||||
|
<t t-if="fees_by_provider.get(provider)"> |
||||
|
<span class="badge-pill badge-secondary ml-1"> |
||||
|
+ <t t-esc="fees_by_provider.get(provider)" |
||||
|
t-options="{'widget': 'monetary', 'display_currency': currency}"/> |
||||
|
Fees |
||||
|
</span> |
||||
|
</t> |
||||
|
</label> |
||||
|
<!-- === Payment specific icon === --> |
||||
|
<ul class="payment_icon_list float-end list-inline" data-max-icons="1"> |
||||
|
<img src='/acquirer_payplug/static/src/img/icon/bancontact.png' style="max-height: 32px; margin-right: 6px;"/> |
||||
|
</ul> |
||||
|
<!-- === Help message === --> |
||||
|
<div t-if="provider.pre_msg" |
||||
|
t-out="provider.pre_msg" |
||||
|
class="text-muted ml-3"/> |
||||
|
</div> |
||||
|
<!-- === Acquirer inline form === --> |
||||
|
<div t-attf-id="o_payment_acquirer_inline_form_{{provider.id}}" |
||||
|
name="o_payment_inline_form" |
||||
|
class="card-footer d-none"> |
||||
|
<!-- === Inline form content (filled by acquirer) === --> |
||||
|
<t t-if="provider.sudo()._should_build_inline_form(is_validation=False)"> |
||||
|
<t t-set="inline_form_xml_id" |
||||
|
t-value="provider.sudo().inline_form_view_id.xml_id"/> |
||||
|
<div t-if="inline_form_xml_id" class="clearfix"> |
||||
|
<t t-call="{{inline_form_xml_id}}"> |
||||
|
<t t-set="provider_id" t-value="provider.id"/> |
||||
|
</t> |
||||
|
</div> |
||||
|
</t> |
||||
|
<!-- === "Save my payment details" checkbox === --> |
||||
|
<!-- Only included if partner is known and if the choice is given --> |
||||
|
<t t-set="tokenization_required" |
||||
|
t-value="provider._is_tokenization_required(provider=provider.code)"/> |
||||
|
<label t-if="show_tokenize_input and provider.allow_tokenization and not tokenization_required"> |
||||
|
<input name="o_payment_save_as_token" type="checkbox"/> |
||||
|
Save my payment details |
||||
|
</label> |
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
<!-- === Others Acquirer === --> |
||||
|
<t t-else=""> |
||||
|
<div name="o_payment_option_card" class="card-body o_payment_option_card"> |
||||
|
<label> |
||||
|
<!-- === Radio button === --> |
||||
|
<!-- Only shown if linked to the only payment option --> |
||||
|
<input name="o_payment_radio" |
||||
|
type="radio" |
||||
|
t-att-checked="provider.id == default_payment_option_id" |
||||
|
t-att-class="'' if provider_count + token_count > 1 else 'd-none'" |
||||
|
t-att-data-payment-option-id="provider.id" |
||||
|
t-att-data-provider="provider.code" |
||||
|
data-payment-option-type="provider"/> |
||||
|
<!-- === Acquirer name === --> |
||||
|
<span class="payment_option_name"> |
||||
|
<b><t t-esc="provider.display_as or provider.name"/></b> |
||||
|
</span> |
||||
|
<!-- === "Test Mode" badge === --> |
||||
|
<span t-if="provider.state == 'test'" |
||||
|
class="badge-pill badge-warning" |
||||
|
style="margin-left:5px"> |
||||
|
Test Mode |
||||
|
</span> |
||||
|
</label> |
||||
|
<!-- === Payment icon list === --> |
||||
|
<t t-call="payment.icon_list"/> |
||||
|
<!-- === Help message === --> |
||||
|
<div t-if="provider.pre_msg" |
||||
|
t-out="provider.pre_msg" |
||||
|
class="text-muted ml-3"/> |
||||
|
</div> |
||||
|
|
||||
|
<!-- === Acquirer inline form === --> |
||||
|
<t t-if="provider.sudo()._should_build_inline_form(is_validation=True)"> |
||||
|
<div t-attf-id="o_payment_acquirer_inline_form_{{provider.id}}" |
||||
|
name="o_payment_inline_form" |
||||
|
class="card-footer d-none"> |
||||
|
<!-- === Inline form content (filled by acquirer) === --> |
||||
|
<t t-set="inline_form_xml_id" |
||||
|
t-value="provider.sudo().inline_form_view_id.xml_id"/> |
||||
|
<div t-if="inline_form_xml_id" class="clearfix"> |
||||
|
<t t-call="{{inline_form_xml_id}}"> |
||||
|
<t t-set="provider_id" t-value="provider.id"/> |
||||
|
</t> |
||||
|
</div> |
||||
|
</div> |
||||
|
</t> |
||||
|
<!-- === Tokens === --> |
||||
|
<t t-foreach="tokens" t-as="token"> |
||||
|
<div name="o_payment_option_card" class="card-body o_payment_option_card"> |
||||
|
<label> |
||||
|
<!-- === Radio button === --> |
||||
|
<!-- Only shown if 'assign_token_route' is set --> |
||||
|
<input name="o_payment_radio" |
||||
|
type="radio" |
||||
|
t-att-checked="token.id == default_payment_option_id" |
||||
|
t-att-class="'' if bool(assign_token_route) else 'd-none'" |
||||
|
t-att-data-payment-option-id="token.id" |
||||
|
t-att-data-provider="token.provider" |
||||
|
data-payment-option-type="token"/> |
||||
|
<!-- === Token name === --> |
||||
|
<span class="payment_option_name" t-esc="token.name"/> |
||||
|
<!-- === "V" check mark === --> |
||||
|
<t t-call="payment.verified_token_checkmark"/> |
||||
|
</label> |
||||
|
<!-- === "Delete" token button === --> |
||||
|
<button name="o_payment_delete_token" |
||||
|
class="btn btn-primary btn-sm float-right"> |
||||
|
<i class="fa fa-trash"/> Delete |
||||
|
</button> |
||||
|
</div> |
||||
|
<!-- === Token inline form === --> |
||||
|
<div t-attf-id="o_payment_token_inline_form_{{token.id}}" |
||||
|
name="o_payment_inline_form" |
||||
|
class="card-footer d-none"/> |
||||
|
</t> |
||||
|
</t> |
||||
|
</t> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
</odoo> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
@ -0,0 +1,168 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<data> |
||||
|
|
||||
|
<!-- FORM VIEW ACQUIRER PAYPLUG --> |
||||
|
<record id="payment_provider_form_inherit" model="ir.ui.view"> |
||||
|
<field name="name">payment.provider.form</field> |
||||
|
<field name="model">payment.provider</field> |
||||
|
<field name="inherit_id" ref="payment.payment_provider_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//field[@name='name']" position="attributes"> |
||||
|
<attribute name="attrs">{'readonly': [('code','=','payplug')]}</attribute> |
||||
|
</xpath> |
||||
|
<xpath expr="//group[@name='payment_state']" position="after"> |
||||
|
<group attrs="{'invisible': [('code', '!=', 'payplug')]}"> |
||||
|
<!-- PAYMENT PAYPLUG --> |
||||
|
<label for="payment_type_payplug"/> |
||||
|
<div style="margin-bottom: 5px;"> |
||||
|
<field name="payment_type_payplug" readonly="1"/> |
||||
|
<span colspan="2" style="font-size: 12px; color: green;" attrs="{'invisible': [('payment_type_payplug', '=', False)]}"> |
||||
|
<i class="fa fa-check" title="PayPlug actived"/> <b> PayPlug is activated</b> |
||||
|
</span> |
||||
|
<div colspan="2" style="margin-bottom: 2px;" attrs="{'invisible': [('payment_type_payplug', '=', False)]}"> |
||||
|
<img src='/acquirer_payplug/static/src/img/icon/icon-visa.png' style="max-height: 32px; margin-right: 4px;" alt="icon"/> |
||||
|
<img src='/acquirer_payplug/static/src/img/icon/icon-mastercard.png' style="max-height: 32px; margin-right: 4px;" alt="icon"/> |
||||
|
<img src='/acquirer_payplug/static/src/img/icon/icon-cb.png' style="max-height: 32px;" alt="icon"/> |
||||
|
</div> |
||||
|
<p colspan="2" style="font-size: 12px; color: gray;" attrs="{'invisible': [('payment_type_payplug', '=', True)]}"> |
||||
|
<i class="fa fa-pencil" title="PayPlug actived"> PayPlug online payments via credit cards.</i> |
||||
|
</p> |
||||
|
<hr style="size: 2px, color: grey;"/> |
||||
|
</div> |
||||
|
<label for="payment_type_oney"/> |
||||
|
<div style="margin-bottom: 5px;"> |
||||
|
<field name="payment_type_oney"/> |
||||
|
<span colspan="2" style="font-size: 12px; color: #ffb200;" attrs="{'invisible': [('payment_type_oney', '=', True)]}"> |
||||
|
<i class="fa fa-check" title="actived"/> <b><i> PayLater is disabled</i></b> |
||||
|
</span> |
||||
|
<span colspan="2" style="font-size: 12px; color: green;" attrs="{'invisible': [('payment_type_oney', '=', False)]}"> |
||||
|
<i class="fa fa-check" title="PayLater actived"/> <b> PayLater is activated</b> |
||||
|
</span> |
||||
|
<div colspan="2" style="margin-bottom: 2px;" attrs="{'invisible': [('payment_type_oney', '=', False)]}"> |
||||
|
<img src='/acquirer_payplug/static/src/img/icon/icon-visa.png' style="max-height: 32px; margin-right: 4px;" alt="icon"/> |
||||
|
<img src='/acquirer_payplug/static/src/img/icon/icon-mastercard.png' style="max-height: 32px; margin-right: 4px;" alt="icon"/> |
||||
|
<img src='/acquirer_payplug/static/src/img/icon/icon-cb.png' style="max-height: 32px;" alt="icon"/> |
||||
|
</div> |
||||
|
<p colspan="2" style="font-size: 12px; color: gray;" attrs="{'invisible': [('payment_type_oney', '=', True)]}"> |
||||
|
<i class="fa fa-pencil" title="text"> PayLater online payments via credit cards 3x or 4x.</i> |
||||
|
</p> |
||||
|
<hr style="size: 2px, color: grey;"/> |
||||
|
</div> |
||||
|
<!-- PAYMENT AMEX --> |
||||
|
<label for="payment_type_amex"/> |
||||
|
<div style="margin-bottom: 5px;"> |
||||
|
<field name="payment_type_amex"/> |
||||
|
<span colspan="2" style="font-size: 12px; color: #ffb200;" attrs="{'invisible': [('payment_type_amex', '=', True)]}"> |
||||
|
<i class="fa fa-check" title="AmEx disabled"/> <b><i> AmEx is disabled</i></b> |
||||
|
</span> |
||||
|
<span colspan="2" style="font-size: 12px; color: green;" attrs="{'invisible': [('payment_type_amex', '=', False)]}"> |
||||
|
<i class="fa fa-check" title="AmEx actived"/> <b> AmEx is activated</b> |
||||
|
</span> |
||||
|
<div colspan="2" style="margin-bottom: 2px;" attrs="{'invisible': [('payment_type_amex', '=', False)]}"> |
||||
|
<img src='/acquirer_payplug/static/src/img/icon/american_express.png' style="max-height: 32px;" alt="icon"/> |
||||
|
</div> |
||||
|
<p colspan="2" style="font-size: 12px; color: gray;" attrs="{'invisible': [('payment_type_amex', '=', True)]}"> |
||||
|
<i class="fa fa-pencil" title="AmEx"> PayPlug online payments via credit cards American express.</i> |
||||
|
</p> |
||||
|
<p colspan="2" style="font-size: 12px; color: red;" attrs="{'invisible': [('payment_type_amex', '=', True)]}"> |
||||
|
<i class="fa fa-info-circle" title="AmEx"> To use AmEx you must make an activation request to PayPlug. This type of payment does not have a "test" mode.</i> |
||||
|
</p> |
||||
|
<hr style="size: 2px, color: grey;"/> |
||||
|
</div> |
||||
|
<label for="payment_type_bancontact"/> |
||||
|
<div style="margin-bottom: 5px;"> |
||||
|
<field name="payment_type_bancontact"/> |
||||
|
<span colspan="2" style="font-size: 12px; color: #ffb200;" attrs="{'invisible': [('payment_type_bancontact', '=', True)]}"> |
||||
|
<i class="fa fa-check" title="Bancontact disabled"/> <b><i> Bancontact is disabled</i></b> |
||||
|
</span> |
||||
|
<span colspan="2" style="font-size: 12px; color: green;" attrs="{'invisible': [('payment_type_bancontact', '=', False)]}"> |
||||
|
<i class="fa fa-check" title="Bancontact actived"/> <b> Bancontact is activated</b> |
||||
|
</span> |
||||
|
<div colspan="2" style="margin-bottom: 2px;" attrs="{'invisible': [('payment_type_bancontact', '=', False)]}"> |
||||
|
<img src='/acquirer_payplug/static/src/img/icon/bancontact.png' style="max-height: 32px;" alt="icon"/> |
||||
|
</div> |
||||
|
<p colspan="2" style="font-size: 12px; color: gray;" attrs="{'invisible': [('payment_type_bancontact', '=', True)]}"> |
||||
|
<i class="fa fa-pencil" title="Bancontact"> PayPlug online payments via credit cards Bancontact</i> |
||||
|
</p> |
||||
|
<p colspan="2" style="font-size: 12px; color: red;" attrs="{'invisible': [('payment_type_bancontact', '=', True)]}"> |
||||
|
<i class="fa fa-info-circle" title="Bancontact"> To use Bancontact you must make an activation request to PayPlug. This type of payment does not have a "test" mode.</i> |
||||
|
</p> |
||||
|
<hr style="size: 2px, color: grey;"/> |
||||
|
</div> |
||||
|
</group> |
||||
|
</xpath> |
||||
|
|
||||
|
<xpath expr="//field[@name='available_country_ids']" position="attributes"> |
||||
|
<attribute name="attrs">{'readonly': [('code','=','payplug')]}</attribute> |
||||
|
</xpath> |
||||
|
<xpath expr="//field[@name='available_country_ids']" position="before"> |
||||
|
<i class="fa fa-info-circle" title="Country" colspan="2" attrs="{'invisible': [('code', '!=', 'payplug')]}"> The configuration of the authorized countries is to be carried out for each method of payment!</i> |
||||
|
</xpath> |
||||
|
<xpath expr="//field[@name='display_as']" position="attributes"> |
||||
|
<attribute name="attrs">{'invisible': [('code','=','payplug')]}</attribute> |
||||
|
</xpath> |
||||
|
|
||||
|
<xpath expr="//group[@name='provider_credentials']" position="inside"> |
||||
|
<group attrs="{'invisible': [('code', '!=', 'payplug')]}"> |
||||
|
<field name="payplug_secret_test_key" attrs="{'required': [('code','=','payplug')]}" placeholder="e.g. sk_test_1YIpJK544lnWVCKnYlLlxY"/> |
||||
|
<field name="payplug_secret_live_key" attrs="{'required': [('code','=','payplug')]}" placeholder="e.g. sk_live_1YIpJK544lnWVCKnYlLlxY" password="True"/> |
||||
|
</group> |
||||
|
</xpath> |
||||
|
<xpath expr="//notebook/page[@name='credentials']" position="after"> |
||||
|
<page string="PayPlug settings" attrs="{'invisible': ['|',('code', '!=', 'payplug'), ('payment_type_payplug', '=', False)]}"> |
||||
|
<group> |
||||
|
<group string="Payment Form"> |
||||
|
<field name="payplug_display_as" attrs="{'required': [('code', '=', 'payplug'),('payment_type_payplug', '=', True)]}"/> |
||||
|
</group> |
||||
|
<group string="Availability"> |
||||
|
<field name="available_payplug_country_ids" widget="many2many_tags" |
||||
|
placeholder="Select countries. Leave empty to use everywhere." |
||||
|
options="{'no_open': True, 'no_create': True}"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</page> |
||||
|
<page string="PayLater settings" attrs="{'invisible': ['|',('code', '!=', 'payplug'), ('payment_type_oney', '=', False)]}"> |
||||
|
<group> |
||||
|
<group string="Payment Form"> |
||||
|
<field name="oney_display_as" attrs="{'required': [('code', '=', 'payplug'),('payment_type_oney', '=', True)]}"/> |
||||
|
<field name="oney_information_message" attrs="{'required': [('code', '=', 'payplug'),('payment_type_oney', '=', True)]}"/> |
||||
|
<field name="oney_footer_message" colspan="3" attrs="{'required': [('code', '=', 'payplug'),('payment_type_oney', '=', True)]}"/> |
||||
|
</group> |
||||
|
<group string="Availability"> |
||||
|
<field name="available_oney_country_ids" widget="many2many_tags" |
||||
|
placeholder="Select countries. Leave empty to use everywhere." |
||||
|
options="{'no_open': True, 'no_create': True}"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</page> |
||||
|
<page string="AmEx settings" attrs="{'invisible': ['|',('code', '!=', 'payplug'), ('payment_type_amex', '=', False)]}"> |
||||
|
<group> |
||||
|
<group string="Payment Form"> |
||||
|
<field name="amex_display_as" attrs="{'required': [('code', '=', 'payplug'),('payment_type_amex', '=', True)]}"/> |
||||
|
</group> |
||||
|
<group string="Availability"> |
||||
|
<field name="available_amex_country_ids" widget="many2many_tags" |
||||
|
placeholder="Select countries. Leave empty to use everywhere." |
||||
|
options="{'no_open': True, 'no_create': True}"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</page> |
||||
|
<page string="Bancontact settings" attrs="{'invisible': ['|',('code', '!=', 'payplug'), ('payment_type_bancontact', '=', False)]}"> |
||||
|
<group> |
||||
|
<group string="Payment Form"> |
||||
|
<field name="bancontact_display_as" attrs="{'required': [('code', '=', 'payplug'),('payment_type_bancontact', '=', True)]}"/> |
||||
|
</group> |
||||
|
<group string="Availability"> |
||||
|
<field name="available_bancontact_country_ids" widget="many2many_tags" |
||||
|
placeholder="Select countries. Leave empty to use everywhere." |
||||
|
options="{'no_open': True, 'no_create': True}"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</page> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,31 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<data> |
||||
|
|
||||
|
<!-- VIEW PAYMENT TRANSACTION TREE --> |
||||
|
<record id="payment_transaction_list_inherit" model="ir.ui.view"> |
||||
|
<field name="name">payment.transaction.tree</field> |
||||
|
<field name="model">payment.transaction</field> |
||||
|
<field name="inherit_id" ref="payment.payment_transaction_list"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//field[@name='provider_id']" position="after"> |
||||
|
<field name="provider_type_payplug"/> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<!-- VIEW PAYMENT TRANSACTION FOM --> |
||||
|
<record id="payment_transaction_form_inherit" model="ir.ui.view"> |
||||
|
<field name="name">payment.transaction.form</field> |
||||
|
<field name="model">payment.transaction</field> |
||||
|
<field name="inherit_id" ref="payment.payment_transaction_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//field[@name='provider_id']" position="after"> |
||||
|
<field name="provider_type_payplug"/> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
|
||||
|
</data> |
||||
|
</odoo> |