Browse Source

[ADD] payplug acquirer

14.0
RemiFr82 6 months ago
parent
commit
45fd473f68
  1. BIN
      acquirer_payplug/.DS_Store
  2. 11
      acquirer_payplug/__init__.py
  3. 48
      acquirer_payplug/__manifest__.py
  4. 3
      acquirer_payplug/controllers/__init__.py
  5. 227
      acquirer_payplug/controllers/main.py
  6. 125
      acquirer_payplug/controllers/portal.py
  7. 4
      acquirer_payplug/datas/neutralize.sql
  8. 18
      acquirer_payplug/datas/payment_icon_data.xml
  9. 40
      acquirer_payplug/datas/payment_provider_data.xml
  10. 614
      acquirer_payplug/i18n/fr.po
  11. 3
      acquirer_payplug/models/__init__.py
  12. 159
      acquirer_payplug/models/payment_provider.py
  13. 271
      acquirer_payplug/models/payment_transaction.py
  14. BIN
      acquirer_payplug/static/.DS_Store
  15. BIN
      acquirer_payplug/static/description/MOCKUP_PAIEMENT_EN.png
  16. BIN
      acquirer_payplug/static/description/banner.png
  17. BIN
      acquirer_payplug/static/description/icon.png
  18. 161
      acquirer_payplug/static/description/index.html
  19. 271
      acquirer_payplug/static/src/css/website_oney.css
  20. BIN
      acquirer_payplug/static/src/img/icon/american_express.png
  21. BIN
      acquirer_payplug/static/src/img/icon/amex/payment_amex_icon.png
  22. BIN
      acquirer_payplug/static/src/img/icon/bancontact.png
  23. BIN
      acquirer_payplug/static/src/img/icon/icon-cb.png
  24. BIN
      acquirer_payplug/static/src/img/icon/icon-mastercard.png
  25. BIN
      acquirer_payplug/static/src/img/icon/icon-visa.png
  26. BIN
      acquirer_payplug/static/src/img/icon/oney/3x-gray.png
  27. BIN
      acquirer_payplug/static/src/img/icon/oney/3x-green.png
  28. BIN
      acquirer_payplug/static/src/img/icon/oney/4x-gray.png
  29. BIN
      acquirer_payplug/static/src/img/icon/oney/4x-green.png
  30. BIN
      acquirer_payplug/static/src/img/icon/oney/icon_oney_3x4x_1.png
  31. BIN
      acquirer_payplug/static/src/img/icon/oney/icon_oney_3x4x_2.png
  32. BIN
      acquirer_payplug/static/src/img/icon/oney/icon_oney_3x4x_3.png
  33. BIN
      acquirer_payplug/static/src/img/icon/oney/logo-oney-3xpayant-gray.png
  34. BIN
      acquirer_payplug/static/src/img/icon/oney/logo-oney-3xpayant.png
  35. BIN
      acquirer_payplug/static/src/img/icon/oney/logo-oney-4xpayant-gray.png
  36. BIN
      acquirer_payplug/static/src/img/icon/oney/logo-oney-4xpayant.png
  37. BIN
      acquirer_payplug/static/src/img/icon/oney/payment_oney_icon.png
  38. BIN
      acquirer_payplug/static/src/img/icon/oney/popin-pedagogique.png
  39. BIN
      acquirer_payplug/static/src/img/icon/oney/spinner1.gif
  40. BIN
      acquirer_payplug/static/src/img/icon/oney/spinner2.gif
  41. BIN
      acquirer_payplug/static/src/img/icon/oney/title_popup.png
  42. BIN
      acquirer_payplug/static/src/img/icon/payplug/button_logo.png
  43. BIN
      acquirer_payplug/static/src/img/icon/payplug/payment_payplug_icon.png
  44. BIN
      acquirer_payplug/static/src/img/icon/payplug/payplug_icon.png
  45. 199
      acquirer_payplug/static/src/js/website_oney.js
  46. 338
      acquirer_payplug/views/payment_provider_oney_template.xml
  47. 336
      acquirer_payplug/views/payment_provider_template.xml
  48. 168
      acquirer_payplug/views/payment_provider_view.xml
  49. 31
      acquirer_payplug/views/payment_transaction_view.xml

BIN
acquirer_payplug/.DS_Store

11
acquirer_payplug/__init__.py

@ -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')

48
acquirer_payplug/__manifest__.py

@ -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',
}

3
acquirer_payplug/controllers/__init__.py

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import main
from . import portal

227
acquirer_payplug/controllers/main.py

@ -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')

125
acquirer_payplug/controllers/portal.py

@ -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

4
acquirer_payplug/datas/neutralize.sql

@ -0,0 +1,4 @@
-- disable payplug payment provider
UPDATE payment_provider
SET payplug_secret_test_key = NULL,
payplug_secret_live_key = NULL;

18
acquirer_payplug/datas/payment_icon_data.xml

@ -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>

40
acquirer_payplug/datas/payment_provider_data.xml

@ -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>

614
acquirer_payplug/i18n/fr.po

@ -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"

3
acquirer_payplug/models/__init__.py

@ -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

159
acquirer_payplug/models/payment_provider.py

@ -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

271
acquirer_payplug/models/payment_transaction.py

@ -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(