[26/09/2024] MAJ du module PayBox en 1.2.5, pour contrainte 3DSv2
This commit is contained in:
@@ -62,7 +62,8 @@
|
|||||||
"ramsey/array_column": "~1.1",
|
"ramsey/array_column": "~1.1",
|
||||||
"propel/propel": "dev-thelia-2.3",
|
"propel/propel": "dev-thelia-2.3",
|
||||||
"commerceguys/addressing": "0.8.*",
|
"commerceguys/addressing": "0.8.*",
|
||||||
"thelia/paypal-module": "~3.0.0"
|
"thelia/paypal-module": "~3.0.0",
|
||||||
|
"giggsey/libphonenumber-for-php": "^8.1.3"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"fzaninotto/faker": "1.5.*",
|
"fzaninotto/faker": "1.5.*",
|
||||||
|
|||||||
136
composer.lock
generated
136
composer.lock
generated
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"_readme": [
|
"_readme": [
|
||||||
"This file locks the dependencies of your project to a known state",
|
"This file locks the dependencies of your project to a known state",
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "8fbc68f5bab568a5ff0999a67a6fef4f",
|
"content-hash": "9adcc003d8cd7a382d5fedd229b5e860",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "commerceguys/addressing",
|
"name": "commerceguys/addressing",
|
||||||
@@ -349,17 +349,134 @@
|
|||||||
"abandoned": "tecnickcom/tcpdf",
|
"abandoned": "tecnickcom/tcpdf",
|
||||||
"time": "2013-09-12T17:00:40+00:00"
|
"time": "2013-09-12T17:00:40+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "giggsey/libphonenumber-for-php",
|
||||||
|
"version": "8.12.4",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/giggsey/libphonenumber-for-php.git",
|
||||||
|
"reference": "cb79970730aacaedb74c8288214a5576572fa7b0"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/cb79970730aacaedb74c8288214a5576572fa7b0",
|
||||||
|
"reference": "cb79970730aacaedb74c8288214a5576572fa7b0",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-mbstring": "*",
|
||||||
|
"giggsey/locale": "^1.7",
|
||||||
|
"php": ">=5.3.2"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"pear/pear-core-minimal": "^1.9",
|
||||||
|
"pear/pear_exception": "^1.0",
|
||||||
|
"pear/versioncontrol_git": "^0.5",
|
||||||
|
"phing/phing": "^2.7",
|
||||||
|
"php-coveralls/php-coveralls": "^1.0|^2.0",
|
||||||
|
"phpunit/phpunit": "^4.8.36|^5.0",
|
||||||
|
"symfony/console": "^2.8|^3.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "8.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"libphonenumber\\": "src/"
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/src/data/",
|
||||||
|
"/src/carrier/data/",
|
||||||
|
"/src/geocoding/data/",
|
||||||
|
"/src/timezone/data/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"Apache-2.0"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Joshua Gigg",
|
||||||
|
"email": "giggsey@gmail.com",
|
||||||
|
"homepage": "https://giggsey.com/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PHP Port of Google's libphonenumber",
|
||||||
|
"homepage": "https://github.com/giggsey/libphonenumber-for-php",
|
||||||
|
"keywords": [
|
||||||
|
"geocoding",
|
||||||
|
"geolocation",
|
||||||
|
"libphonenumber",
|
||||||
|
"mobile",
|
||||||
|
"phonenumber",
|
||||||
|
"validation"
|
||||||
|
],
|
||||||
|
"time": "2020-05-19T11:20:54+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "giggsey/locale",
|
||||||
|
"version": "1.9",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/giggsey/Locale.git",
|
||||||
|
"reference": "b07f1eace8072ccc61445ad8fbd493ff9d783043"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/giggsey/Locale/zipball/b07f1eace8072ccc61445ad8fbd493ff9d783043",
|
||||||
|
"reference": "b07f1eace8072ccc61445ad8fbd493ff9d783043",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.2"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"pear/pear-core-minimal": "^1.9",
|
||||||
|
"pear/pear_exception": "^1.0",
|
||||||
|
"pear/versioncontrol_git": "^0.5",
|
||||||
|
"phing/phing": "~2.7",
|
||||||
|
"php-coveralls/php-coveralls": "^1.0|^2.0",
|
||||||
|
"phpunit/phpunit": "^4.8|^5.0",
|
||||||
|
"symfony/console": "^2.8|^3.0|^4.0",
|
||||||
|
"symfony/filesystem": "^2.8|^3.0|^4.0",
|
||||||
|
"symfony/finder": "^2.8|^3.0|^4.0",
|
||||||
|
"symfony/process": "^2.8|^3.0|^4.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Giggsey\\Locale\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Joshua Gigg",
|
||||||
|
"email": "giggsey@gmail.com",
|
||||||
|
"homepage": "http://giggsey.com/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Locale functions required by libphonenumber-for-php",
|
||||||
|
"time": "2020-07-07T11:16:24+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "imagine/imagine",
|
"name": "imagine/imagine",
|
||||||
"version": "v0.6.3",
|
"version": "v0.6.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/avalanche123/Imagine.git",
|
"url": "https://github.com/php-imagine/Imagine.git",
|
||||||
"reference": "149041d2a1b517107bfe270ca2b1a17aa341715d"
|
"reference": "149041d2a1b517107bfe270ca2b1a17aa341715d"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/avalanche123/Imagine/zipball/149041d2a1b517107bfe270ca2b1a17aa341715d",
|
"url": "https://api.github.com/repos/php-imagine/Imagine/zipball/149041d2a1b517107bfe270ca2b1a17aa341715d",
|
||||||
"reference": "149041d2a1b517107bfe270ca2b1a17aa341715d",
|
"reference": "149041d2a1b517107bfe270ca2b1a17aa341715d",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
@@ -714,6 +831,7 @@
|
|||||||
"php",
|
"php",
|
||||||
"stylesheet"
|
"stylesheet"
|
||||||
],
|
],
|
||||||
|
"abandoned": true,
|
||||||
"time": "2015-12-30T05:47:36+00:00"
|
"time": "2015-12-30T05:47:36+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -811,6 +929,7 @@
|
|||||||
"rest",
|
"rest",
|
||||||
"sdk"
|
"sdk"
|
||||||
],
|
],
|
||||||
|
"abandoned": true,
|
||||||
"time": "2016-04-22T03:29:29+00:00"
|
"time": "2016-04-22T03:29:29+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1001,6 +1120,7 @@
|
|||||||
"array_column",
|
"array_column",
|
||||||
"column"
|
"column"
|
||||||
],
|
],
|
||||||
|
"abandoned": "it-for-free/array_column",
|
||||||
"time": "2015-03-20T22:07:39+00:00"
|
"time": "2015-03-20T22:07:39+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1159,6 +1279,7 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"stack"
|
"stack"
|
||||||
],
|
],
|
||||||
|
"abandoned": true,
|
||||||
"time": "2014-11-23T20:37:11+00:00"
|
"time": "2014-11-23T20:37:11+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1212,6 +1333,7 @@
|
|||||||
"mail",
|
"mail",
|
||||||
"mailer"
|
"mailer"
|
||||||
],
|
],
|
||||||
|
"abandoned": "symfony/mailer",
|
||||||
"time": "2015-06-06T14:19:39+00:00"
|
"time": "2015-06-06T14:19:39+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1378,6 +1500,7 @@
|
|||||||
],
|
],
|
||||||
"description": "Symfony ClassLoader Component",
|
"description": "Symfony ClassLoader Component",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
|
"abandoned": true,
|
||||||
"time": "2016-01-03T15:33:41+00:00"
|
"time": "2016-01-03T15:33:41+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1545,6 +1668,7 @@
|
|||||||
],
|
],
|
||||||
"description": "Symfony Debug Component",
|
"description": "Symfony Debug Component",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
|
"abandoned": "symfony/error-handler",
|
||||||
"time": "2016-01-13T10:28:07+00:00"
|
"time": "2016-01-13T10:28:07+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -2916,6 +3040,7 @@
|
|||||||
],
|
],
|
||||||
"description": "Symfony Security Component",
|
"description": "Symfony Security Component",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
|
"abandoned": true,
|
||||||
"time": "2016-01-14T09:10:32+00:00"
|
"time": "2016-01-14T09:10:32+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -4450,5 +4575,6 @@
|
|||||||
"platform": {
|
"platform": {
|
||||||
"php": ">=5.4"
|
"php": ">=5.4"
|
||||||
},
|
},
|
||||||
"platform-dev": []
|
"platform-dev": [],
|
||||||
|
"plugin-api-version": "1.1.0"
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
composer.phar
Normal file
BIN
composer.phar
Normal file
Binary file not shown.
7
local/modules/Paybox/.github/workflows/release.yml
vendored
Normal file
7
local/modules/Paybox/.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
name: "Auto Release"
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master, main ]
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
uses: thelia-modules/ReusableWorkflow/.github/workflows/auto_release.yml@main
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<dwsync>
|
|
||||||
<file name="module_configuration.html" server="51.254.220.106//web/" local="131353051200000000" remote="131390168400000000" />
|
|
||||||
</dwsync>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<dwsync>
|
|
||||||
<file name="clef-publique-paybox.pem" server="51.254.220.106//web/" local="131353051200000000" remote="131390168400000000" />
|
|
||||||
<file name="config.xml" server="51.254.220.106//web/" local="131353051200000000" remote="131390168400000000" />
|
|
||||||
<file name="iso4217.xml" server="51.254.220.106//web/" local="131353051200000000" remote="131390168400000000" />
|
|
||||||
<file name="module.xml" server="51.254.220.106//web/" local="131353051200000000" remote="131390168400000000" />
|
|
||||||
<file name="routing.xml" server="51.254.220.106//web/" local="131353051200000000" remote="131390168400000000" />
|
|
||||||
</dwsync>
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,18 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module>
|
<module>
|
||||||
<fullnamespace>Paybox\Paybox</fullnamespace>
|
<fullnamespace>Paybox\Paybox</fullnamespace>
|
||||||
<descriptive locale="en_US">
|
<descriptive locale="en_US">
|
||||||
<title>Pay with credit card using Paybox</title>
|
<title>Pay with credit card using Paybox</title>
|
||||||
</descriptive>
|
</descriptive>
|
||||||
<descriptive locale="fr_FR">
|
<descriptive locale="fr_FR">
|
||||||
<title>Paiement en carte bancaire avec Paybox</title>
|
<title>Paiement en carte bancaire avec Paybox</title>
|
||||||
</descriptive>
|
</descriptive>
|
||||||
<version>1.0.0</version>
|
<version>1.2.5</version>
|
||||||
<author>
|
<author>
|
||||||
<name>Franck Allimant</name>
|
<name>Franck Allimant</name>
|
||||||
<email>franck@cqfdev.fr</email>
|
<email>franck@cqfdev.fr</email>
|
||||||
</author>
|
</author>
|
||||||
<type>payment</type>
|
<type>payment</type>
|
||||||
<thelia>2.1.0</thelia>
|
<thelia>2.1.0</thelia>
|
||||||
<stability>prod</stability>
|
<stability>prod</stability>
|
||||||
</module>
|
</module>
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<dwsync>
|
|
||||||
<file name="ConfigurationController.php" server="51.254.220.106//web/" local="131353051200000000" remote="131390168400000000" />
|
|
||||||
<file name="PaymentController.php" server="51.254.220.106//web/" local="131353051200000000" remote="131390168400000000" />
|
|
||||||
</dwsync>
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<dwsync>
|
|
||||||
<file name="SendConfirmationEmail.php" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
</dwsync>
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<dwsync>
|
|
||||||
<file name="ConfigurationForm.php" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
</dwsync>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<dwsync>
|
|
||||||
<file name="en_US.php" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
<file name="fr_FR.php" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
</dwsync>
|
|
||||||
@@ -1,35 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'<ol>
|
||||||
return array(
|
|
||||||
|
<li>
|
||||||
'<ol>
|
|
||||||
|
L\'interface de génération de la clé secrète d\'authentification se trouve dans l\'onglet "Informations" du Back Office Commerçant de Paybox, en bas de la page.
|
||||||
|
|
||||||
<li>
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
L\'interface de génération de la clé secrète d\'authentification se trouve dans l\'onglet "Informations" du Back Office Commerçant de Paybox, en bas de la page.
|
|
||||||
|
Le champ "Phrase de passe" peut être renseigné avec une phrase, un mot de passe, ou tout autre texte.
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
<li>
|
|
||||||
|
L\'affichage par défaut du champ "Phrase de passe" est caché, les caractères apparaissent comme un champ "mot de passe". Il est possible de choisir d\'afficher cette phrase de passe en décochant la case "Cacher".
|
||||||
|
|
||||||
Le champ "Phrase de passe" peut être renseigné avec une phrase, un mot de passe, ou tout autre texte.
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
</li>
|
|
||||||
|
Les champs "Complexité" et "Force" sont mis à jour automatiquement lorsque la phrase de passe est saisie. Ces champs permettent de définir des règles d\'acceptation minimales de la phrase de passe. Les règles fixées actuellement demandent une phrase de passe d\'au moins 15 caractères de long et d\'une force de 90%. Le bouton "VALIDER" restera grisé tant que ces limitations ne sont pas respectées.
|
||||||
|
|
||||||
<li>
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
L\'affichage par défaut du champ "Phrase de passe" est caché, les caractères apparaissent comme un champ "mot de passe". Il est possible de choisir d\'afficher cette phrase de passe en décochant la case "Cacher".
|
|
||||||
|
Le bouton "Générer une clé" permet de calculer la clé d\'authentification à partir de la phrase de passe saisie. Ce calcul est une méthode standard assurant le caractère aléatoire de la clé et renforçant sa robustesse. Cette méthode de calcul étant fixe, il est possible à tout moment de retrouver sa clé en retapant la même phrase de passe et en relançant le calcul.<br />
|
||||||
|
|
||||||
</li>
|
Attention, il est possible que le calcul de la clé prenne quelques secondes, selon le navigateur Internet utilisé et la puissance de l\'ordinateur. Au cours du calcul, il se peut que votre navigateur demande s\'il faut "arrêter l\'exécution de ce script". Il faut répondre "Non" à cette alerte, et patienter jusqu\'à la fin du calcul.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<dwsync>
|
|
||||||
<file name="en_US.php" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
<file name="fr_FR.php" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
</dwsync>
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<dwsync>
|
|
||||||
<file name="fr_FR.php" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
</dwsync>
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'Unsupported field type \'%type\' in form-field-template.html' => 'Le type de champ \'%type\' n\'est pas pris en charge par form-field-template.html',
|
||||||
return array(
|
'Use Ctrl+click to select (or deselect) more that one item' => 'Utilisez Ctrl+clic pour sélectionner ou désélectionner un élément',
|
||||||
|
);
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<dwsync>
|
|
||||||
<file name="en.html" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
<file name="en.txt" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
<file name="fr.html" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
<file name="fr.txt" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
<file name="notification-en.html" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
<file name="notification-en.txt" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
<file name="notification-fr.html" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
<file name="notification-fr.txt" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
</dwsync>
|
|
||||||
@@ -12,6 +12,7 @@ return array(
|
|||||||
'Failed to open %file, please check Paybox configuration' => 'Failed to open %file, please check Paybox configuration',
|
'Failed to open %file, please check Paybox configuration' => 'Failed to open %file, please check Paybox configuration',
|
||||||
'Identifiant interne' => 'Internal identifier',
|
'Identifiant interne' => 'Internal identifier',
|
||||||
'Identifiant interne, tel que fourni par Paybox' => 'Internal identifier, provided by Paybox',
|
'Identifiant interne, tel que fourni par Paybox' => 'Internal identifier, provided by Paybox',
|
||||||
|
'Invalid phone number %num for country %country' => 'Invalid phone number %num for country %country',
|
||||||
'Le fichier de log est vide.' => 'The log file is empty.',
|
'Le fichier de log est vide.' => 'The log file is empty.',
|
||||||
'Le fichier de log n\'a pas été trouvé.' => 'The log file could not be found.',
|
'Le fichier de log n\'a pas été trouvé.' => 'The log file could not be found.',
|
||||||
'Maximum order total' => 'Maximum order total',
|
'Maximum order total' => 'Maximum order total',
|
||||||
@@ -32,6 +33,7 @@ return array(
|
|||||||
'Paybox configuration' => 'Paybox configuration',
|
'Paybox configuration' => 'Paybox configuration',
|
||||||
'Paybox platform request processing terminated.' => 'Paybox platform request processing terminated.',
|
'Paybox platform request processing terminated.' => 'Paybox platform request processing terminated.',
|
||||||
'Paybox platform request received.' => 'Paybox platform request received.',
|
'Paybox platform request received.' => 'Paybox platform request received.',
|
||||||
|
'Please enter a valid phone number in your invoice address (error is : %err)' => 'Please enter a valid phone number in your invoice address (error is : %err)',
|
||||||
'Production' => 'Production',
|
'Production' => 'Production',
|
||||||
'Request parameters signature verification failed.' => 'Request parameters signature verification failed.',
|
'Request parameters signature verification failed.' => 'Request parameters signature verification failed.',
|
||||||
'Test' => 'Test',
|
'Test' => 'Test',
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ return array(
|
|||||||
'Failed to open %file, please check Paybox configuration' => 'Le fichier %file est inaccessible, merci de vérifier la configuration Paybox',
|
'Failed to open %file, please check Paybox configuration' => 'Le fichier %file est inaccessible, merci de vérifier la configuration Paybox',
|
||||||
'Identifiant interne' => 'Identifiant interne',
|
'Identifiant interne' => 'Identifiant interne',
|
||||||
'Identifiant interne, tel que fourni par Paybox' => 'Identifiant interne, tel que fourni par Paybox',
|
'Identifiant interne, tel que fourni par Paybox' => 'Identifiant interne, tel que fourni par Paybox',
|
||||||
|
'Invalid phone number %num for country %country' => 'Le numéro de téléphone %num est invalide pour le pays %country',
|
||||||
'Le fichier de log est vide.' => 'Le fichier de log est vide.',
|
'Le fichier de log est vide.' => 'Le fichier de log est vide.',
|
||||||
'Le fichier de log n\'a pas été trouvé.' => 'Le fichier de log n\'a pas été trouvé.',
|
'Le fichier de log n\'a pas été trouvé.' => 'Le fichier de log n\'a pas été trouvé.',
|
||||||
'Maximum order total' => 'Montant de commande maximum',
|
'Maximum order total' => 'Montant de commande maximum',
|
||||||
@@ -32,6 +33,7 @@ return array(
|
|||||||
'Paybox configuration' => 'Configuration Paybox',
|
'Paybox configuration' => 'Configuration Paybox',
|
||||||
'Paybox platform request processing terminated.' => 'Traitement de la requête Paybox terminé.',
|
'Paybox platform request processing terminated.' => 'Traitement de la requête Paybox terminé.',
|
||||||
'Paybox platform request received.' => 'Réception d\'une requête de la plate-form Paybox',
|
'Paybox platform request received.' => 'Réception d\'une requête de la plate-form Paybox',
|
||||||
|
'Please enter a valid phone number in your invoice address (error is : %err)' => 'Merci d\'entrer un numero de téléphone mobile valide dans votre adresse de facturation (détail de l\'erreur : %err)',
|
||||||
'Production' => 'Production',
|
'Production' => 'Production',
|
||||||
'Request parameters signature verification failed.' => 'La vérification de la signature de la requête a échoué.',
|
'Request parameters signature verification failed.' => 'La vérification de la signature de la requête a échoué.',
|
||||||
'Test' => 'Test',
|
'Test' => 'Test',
|
||||||
|
|||||||
@@ -1,340 +1,420 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*************************************************************************************/
|
/*
|
||||||
|
* This file is part of the Thelia package.
|
||||||
/* */
|
* http://www.thelia.net
|
||||||
|
*
|
||||||
/* Thelia 2 Paybox payment module */
|
* (c) OpenStudio <info@thelia.net>
|
||||||
|
*
|
||||||
/* */
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
/* Copyright (c) CQFDev */
|
*/
|
||||||
|
|
||||||
/* email : thelia@cqfdev.fr */
|
/* Copyright (c) CQFDev */
|
||||||
|
/* email : thelia@cqfdev.fr */
|
||||||
/* web : http://www.cqfdev.fr */
|
/* web : http://www.cqfdev.fr */
|
||||||
|
|
||||||
/* */
|
namespace Paybox;
|
||||||
|
|
||||||
/*************************************************************************************/
|
use libphonenumber\NumberParseException;
|
||||||
|
use libphonenumber\PhoneNumberUtil;
|
||||||
|
use Propel\Runtime\Connection\ConnectionInterface;
|
||||||
|
use Propel\Runtime\Exception\PropelException;
|
||||||
namespace Paybox;
|
use Thelia\Core\HttpFoundation\Response;
|
||||||
|
use Thelia\Core\Translation\Translator;
|
||||||
|
use Thelia\Log\Tlog;
|
||||||
|
use Thelia\Model\Message;
|
||||||
use Propel\Runtime\Connection\ConnectionInterface;
|
use Thelia\Model\MessageQuery;
|
||||||
|
use Thelia\Model\ModuleImageQuery;
|
||||||
use Thelia\Core\HttpFoundation\Response;
|
use Thelia\Model\Order;
|
||||||
|
use Thelia\Module\AbstractPaymentModule;
|
||||||
use Thelia\Core\Translation\Translator;
|
|
||||||
|
/**
|
||||||
use Thelia\Log\Tlog;
|
* Paybox payment module.
|
||||||
|
*
|
||||||
use Thelia\Model\Message;
|
* @author Franck Allimant <franck@cqfdev.fr>
|
||||||
|
*/
|
||||||
use Thelia\Model\MessageQuery;
|
class Paybox extends AbstractPaymentModule
|
||||||
|
{
|
||||||
use Thelia\Model\ModuleImageQuery;
|
/** The module domain for internationalisation */
|
||||||
|
const MODULE_DOMAIN = 'paybox';
|
||||||
use Thelia\Model\Order;
|
|
||||||
|
/** The module domain for internationalisation */
|
||||||
use Thelia\Module\AbstractPaymentModule;
|
const MODULE_CODE = 'Paybox';
|
||||||
|
|
||||||
|
/** The confirmation message identifier */
|
||||||
|
const CONFIRMATION_MESSAGE_NAME = 'paybox_payment_confirmation';
|
||||||
/**
|
|
||||||
|
// Liste des variables retournées par paybox
|
||||||
* Paybox payment module
|
const PARAMETRES_RETOUR = 'montant:M;ref:R;auto:A;trans:T;erreur:E;sign:K';
|
||||||
|
|
||||||
*
|
/** The notification of payment confirmation */
|
||||||
|
const NOTIFICATION_MESSAGE_NAME = 'paybox_payment_status_notification';
|
||||||
* @author Franck Allimant <franck@cqfdev.fr>
|
|
||||||
|
public function postActivation(ConnectionInterface $con = null): void
|
||||||
*/
|
{
|
||||||
|
// Create payment confirmation message from templates, if not already defined
|
||||||
class Paybox extends AbstractPaymentModule
|
$email_templates_dir = __DIR__.DS.'I18n'.DS.'email-templates'.DS;
|
||||||
|
|
||||||
{
|
if (null === MessageQuery::create()->findOneByName(self::CONFIRMATION_MESSAGE_NAME)) {
|
||||||
|
$message = new Message();
|
||||||
/** The module domain for internationalisation */
|
|
||||||
|
$message
|
||||||
const MODULE_DOMAIN = "paybox";
|
->setName(self::CONFIRMATION_MESSAGE_NAME)
|
||||||
|
|
||||||
|
->setLocale('en_US')
|
||||||
|
->setTitle('Paybox payment confirmation')
|
||||||
/** The module domain for internationalisation */
|
->setSubject('Payment of order {$order_ref}')
|
||||||
|
->setHtmlMessage(file_get_contents($email_templates_dir.'en.html'))
|
||||||
const MODULE_CODE = "Paybox";
|
->setTextMessage(file_get_contents($email_templates_dir.'en.txt'))
|
||||||
|
|
||||||
|
->setLocale('fr_FR')
|
||||||
|
->setTitle('Confirmation de paiement par PayBox')
|
||||||
/** The confirmation message identifier */
|
->setSubject('Confirmation du paiement de votre commande {$order_ref}')
|
||||||
|
->setHtmlMessage(file_get_contents($email_templates_dir.'fr.html'))
|
||||||
const CONFIRMATION_MESSAGE_NAME = 'paybox_payment_confirmation';
|
->setTextMessage(file_get_contents($email_templates_dir.'fr.txt'))
|
||||||
|
->save();
|
||||||
|
}
|
||||||
|
|
||||||
// Liste des variables retournées par paybox
|
if (null === MessageQuery::create()->findOneByName(self::NOTIFICATION_MESSAGE_NAME)) {
|
||||||
|
$message = new Message();
|
||||||
const PARAMETRES_RETOUR = 'montant:M;ref:R;auto:A;trans:T;erreur:E;sign:K';
|
|
||||||
|
$message
|
||||||
|
->setName(self::NOTIFICATION_MESSAGE_NAME)
|
||||||
|
|
||||||
/** The notification of payment confirmation */
|
->setLocale('en_US')
|
||||||
|
->setTitle('Paybox payment status notification')
|
||||||
const NOTIFICATION_MESSAGE_NAME = 'paybox_payment_status_notification';
|
->setSubject('Paybox payment status for order {$order_ref}: {$paybox_payment_status}')
|
||||||
|
->setHtmlMessage(file_get_contents($email_templates_dir.'notification-en.html'))
|
||||||
|
->setTextMessage(file_get_contents($email_templates_dir.'notification-en.txt'))
|
||||||
|
|
||||||
/**
|
->setLocale('fr_FR')
|
||||||
|
->setTitle('Notification du résultat d\'un paiement par Paybox')
|
||||||
* @inheritdoc
|
->setSubject('Résultats du paiement Paybox de la commande {$order_ref} : {$paybox_payment_status}')
|
||||||
|
->setHtmlMessage(file_get_contents($email_templates_dir.'notification-fr.html'))
|
||||||
*/
|
->setTextMessage(file_get_contents($email_templates_dir.'notification-fr.txt'))
|
||||||
|
->save();
|
||||||
public function postActivation(ConnectionInterface $con = null)
|
}
|
||||||
|
|
||||||
{
|
/* Deploy the module's image */
|
||||||
|
$module = $this->getModuleModel();
|
||||||
// Create payment confirmation message from templates, if not already defined
|
|
||||||
|
if (ModuleImageQuery::create()->filterByModule($module)->count() == 0) {
|
||||||
$email_templates_dir = __DIR__ . DS . 'I18n' . DS . 'email-templates' . DS;
|
$this->deployImageFolder($module, sprintf('%s'.DS.'images', __DIR__), $con);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (null === MessageQuery::create()->findOneByName(self::CONFIRMATION_MESSAGE_NAME)) {
|
public function destroy(ConnectionInterface $con = null, $deleteModuleData = false): void
|
||||||
|
{
|
||||||
$message = new Message();
|
// Delete config table and messages if required
|
||||||
|
if ($deleteModuleData) {
|
||||||
|
MessageQuery::create()->findOneByName(self::CONFIRMATION_MESSAGE_NAME)->delete($con);
|
||||||
|
MessageQuery::create()->findOneByName(self::NOTIFICATION_MESSAGE_NAME)->delete($con);
|
||||||
$message
|
}
|
||||||
|
}
|
||||||
->setName(self::CONFIRMATION_MESSAGE_NAME)
|
|
||||||
|
/**
|
||||||
|
* Method used by payment gateway.
|
||||||
|
*
|
||||||
->setLocale('en_US')
|
* If this method return a \Thelia\Core\HttpFoundation\Response instance, this response is sent to the
|
||||||
|
* browser.
|
||||||
->setTitle('Paybox payment confirmation')
|
*
|
||||||
|
* In many cases, it's necessary to send a form to the payment gateway.
|
||||||
->setSubject('Payment of order {$order_ref}')
|
* On your response you can return this form already completed, ready to be sent
|
||||||
|
*
|
||||||
->setHtmlMessage(file_get_contents($email_templates_dir . 'en.html'))
|
* @param Order $order processed order
|
||||||
|
*
|
||||||
->setTextMessage(file_get_contents($email_templates_dir . 'en.txt'))
|
* @return Response the HTTP response
|
||||||
|
*/
|
||||||
|
public function pay(Order $order): Response
|
||||||
|
{
|
||||||
->setLocale('fr_FR')
|
return $this->doPay($order);
|
||||||
|
}
|
||||||
->setTitle('Confirmation de paiement par PayBox')
|
|
||||||
|
/**
|
||||||
->setSubject('Confirmation du paiement de votre commande {$order_ref}')
|
* Payment gateway invocation.
|
||||||
|
*
|
||||||
->setHtmlMessage(file_get_contents($email_templates_dir . 'fr.html'))
|
* @param Order $order processed order
|
||||||
|
*
|
||||||
->setTextMessage(file_get_contents($email_templates_dir . 'fr.txt'))
|
* @return Response the HTTP response
|
||||||
|
*/
|
||||||
->save();
|
protected function doPay(Order $order): Response
|
||||||
|
{
|
||||||
}
|
if ('TEST' === self::getConfigValue('mode', false)) {
|
||||||
|
$platformUrl = self::getConfigValue('url_serveur_test', false);
|
||||||
|
} else {
|
||||||
|
$platformUrl = self::getConfigValue('url_serveur', false);
|
||||||
if (null === MessageQuery::create()->findOneByName(self::NOTIFICATION_MESSAGE_NAME)) {
|
}
|
||||||
|
|
||||||
$message = new Message();
|
// Be sure to have a valid platform URL, otherwise give up
|
||||||
|
if (false === $platformUrl) {
|
||||||
|
throw new \InvalidArgumentException(
|
||||||
|
Translator::getInstance()->trans(
|
||||||
$message
|
'The platform URL is not defined, please check Paybox module configuration.',
|
||||||
|
[],
|
||||||
->setName(self::NOTIFICATION_MESSAGE_NAME)
|
self::MODULE_DOMAIN
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
->setLocale('en_US')
|
|
||||||
|
$hashAlgo = $this->getHashAlgorithm();
|
||||||
->setTitle('Paybox payment status notification')
|
$clefPrivee = self::getConfigValue('clef_privee');
|
||||||
|
|
||||||
->setSubject('Paybox payment status for order {$order_ref}: {$paybox_payment_status}')
|
$paybox_params = $this->doPayPayboxParameters($order)
|
||||||
|
+ [
|
||||||
->setHtmlMessage(file_get_contents($email_templates_dir . 'notification-en.html'))
|
'PBX_HASH' => $hashAlgo,
|
||||||
|
'PBX_SECRET' => $clefPrivee,
|
||||||
->setTextMessage(file_get_contents($email_templates_dir . 'notification-en.txt'))
|
];
|
||||||
|
|
||||||
|
// Generate signature
|
||||||
|
$param = '';
|
||||||
->setLocale('fr_FR')
|
|
||||||
|
foreach ($paybox_params as $key => $value) {
|
||||||
->setTitle('Notification du résultat d\'un paiement par Paybox')
|
$param .= '&'.$key.'='.$value;
|
||||||
|
}
|
||||||
->setSubject('Résultats du paiement Paybox de la commande {$order_ref} : {$paybox_payment_status}')
|
|
||||||
|
$param = ltrim($param, '&');
|
||||||
->setHtmlMessage(file_get_contents($email_templates_dir . 'notification-fr.html'))
|
|
||||||
|
$binkey = pack('H*', $clefPrivee);
|
||||||
->setTextMessage(file_get_contents($email_templates_dir . 'notification-fr.txt'))
|
|
||||||
|
$paybox_params['PBX_HMAC'] = strtoupper(hash_hmac($hashAlgo, $param, $binkey));
|
||||||
->save();
|
|
||||||
|
return $this->generateGatewayFormResponse($order, $platformUrl, $paybox_params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function doPayPayboxParameters(Order $order): array
|
||||||
|
{
|
||||||
/* Deploy the module's image */
|
// Generate a transaction ID
|
||||||
$module = $this->getModuleModel();
|
$transactionId = sprintf('%010d', $order->getId());
|
||||||
|
|
||||||
if (ModuleImageQuery::create()->filterByModule($module)->count() == 0) {
|
$order->setTransactionRef($transactionId)->save();
|
||||||
$this->deployImageFolder($module, sprintf('%s/images', __DIR__), $con);
|
|
||||||
}
|
$paybox_params = [
|
||||||
|
'PBX_SITE' => self::getConfigValue('numero_site'),
|
||||||
}
|
'PBX_RANG' => self::getConfigValue('rang_site'),
|
||||||
|
'PBX_IDENTIFIANT' => self::getConfigValue('identifiant_interne'),
|
||||||
|
'PBX_RETOUR' => self::PARAMETRES_RETOUR,
|
||||||
|
'PBX_ANNULE' => self::getConfigValue('url_retour_abandon'),
|
||||||
/**
|
'PBX_EFFECTUE' => self::getConfigValue('url_retour_succes'),
|
||||||
|
'PBX_REFUSE' => self::getConfigValue('url_retour_refus'),
|
||||||
* @inheritdoc
|
'PBX_REPONDRE_A' => self::getConfigValue('url_ipn'),
|
||||||
|
'PBX_TOTAL' => round(100 * $order->getTotalAmount()),
|
||||||
*/
|
'PBX_DEVISE' => $this->getCurrencyIso4217NumericCode($order->getCurrency()->getCode()),
|
||||||
|
'PBX_CMD' => $transactionId,
|
||||||
public function destroy(ConnectionInterface $con = null, $deleteModuleData = false)
|
'PBX_PORTEUR' => $order->getCustomer()->getEmail(),
|
||||||
|
'PBX_TIME' => date('c'),
|
||||||
{
|
'PBX_RUF1' => 'POST',
|
||||||
|
'PBX_SHOPPINGCART' => $this->getShoppingCart($order),
|
||||||
// Delete config table and messages if required
|
'PBX_BILLING' => $this->getBilling($order),
|
||||||
|
];
|
||||||
if ($deleteModuleData) {
|
|
||||||
|
return $paybox_params;
|
||||||
MessageQuery::create()->findOneByName(self::CONFIRMATION_MESSAGE_NAME)->delete($con);
|
}
|
||||||
|
|
||||||
MessageQuery::create()->findOneByName(self::NOTIFICATION_MESSAGE_NAME)->delete($con);
|
/**
|
||||||
|
* @throws PropelException
|
||||||
}
|
*
|
||||||
|
* @return array|bool|string|string[]
|
||||||
}
|
*/
|
||||||
|
protected function getBilling(Order $order)
|
||||||
|
{
|
||||||
|
$address = $order->getOrderAddressRelatedByInvoiceOrderAddressId();
|
||||||
/**
|
|
||||||
|
// Decode phone number
|
||||||
* Method used by payment gateway.
|
$phoneNumber = empty($address->getCellphone()) ? $address->getPhone() : $address->getCellphone();
|
||||||
|
|
||||||
*
|
$phoneUtil = PhoneNumberUtil::getInstance();
|
||||||
|
|
||||||
* If this method return a \Thelia\Core\HttpFoundation\Response instance, this response is sent to the
|
// Default values
|
||||||
|
$phoneCountryCode = '00';
|
||||||
* browser.
|
$phoneNationalNumber = '00000000';
|
||||||
|
|
||||||
*
|
try {
|
||||||
|
$phoneNumberProto = $phoneUtil->parse($phoneNumber, $address->getCountry()->getIsoalpha2());
|
||||||
* In many cases, it's necessary to send a form to the payment gateway.
|
|
||||||
|
$phoneNationalNumber = $phoneNumberProto->getNationalNumber();
|
||||||
* On your response you can return this form already completed, ready to be sent
|
$phoneCountryCode = $phoneNumberProto->getCountryCode();
|
||||||
|
} catch (NumberParseException $e) {
|
||||||
*
|
Tlog::getInstance()->error('Failed to parse phone number "'.$phoneNumber.'", error is : '.$e->getMessage());
|
||||||
|
}
|
||||||
* @param Order $order processed order
|
|
||||||
|
$billingXml = new \SimpleXMLElement('<Billing/>');
|
||||||
* @return Response the HTTP response
|
$addressXml = $billingXml->addChild('Address');
|
||||||
|
|
||||||
*/
|
$addressXml->addChild('FirstName', $address->getFirstname());
|
||||||
|
$addressXml->addChild('LastName', $address->getLastname());
|
||||||
public function pay(Order $order)
|
$addressXml->addChild('Address1', $address->getAddress1());
|
||||||
|
$addressXml->addChild('ZipCode', $address->getZipcode());
|
||||||
{
|
$addressXml->addChild('City', $address->getCity());
|
||||||
|
$addressXml->addChild('CountryCode', $address->getCountry()->getIsocode());
|
||||||
return $this->doPay($order, 'SINGLE');
|
$addressXml->addChild('CountryCodeMobilePhone', '+'.$phoneCountryCode);
|
||||||
|
$addressXml->addChild('MobilePhone', $phoneNationalNumber);
|
||||||
}
|
|
||||||
|
return str_replace(["\n", "\r"], '', $billingXml->asXML());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @return array|bool|string|string[]
|
||||||
* Payment gateway invocation
|
*/
|
||||||
|
protected function getShoppingCart(Order $order)
|
||||||
*
|
{
|
||||||
|
$quantity = 0;
|
||||||
* @param Order $order processed order
|
$shoppingCartXml = new \SimpleXMLElement('<shoppingcart/>');
|
||||||
|
|
||||||
* @return Response the HTTP response
|
foreach ($order->getOrderProducts() as $product) {
|
||||||
|
$quantity += $product->getQuantity();
|
||||||
*/
|
}
|
||||||
|
|
||||||
protected function doPay(Order $order)
|
$total = $shoppingCartXml->addChild('total');
|
||||||
|
$total->addChild('totalQuantity', $quantity);
|
||||||
{
|
|
||||||
|
return str_replace(["\n", "\r"], '', $shoppingCartXml->asXML());
|
||||||
if ('TEST' == Paybox::getConfigValue('mode', false)) {
|
}
|
||||||
|
|
||||||
$platformUrl = Paybox::getConfigValue('url_serveur_test', false);
|
/**
|
||||||
|
* @return bool true to allow usage of this payment module, false otherwise
|
||||||
} else {
|
*/
|
||||||
|
public function isValidPayment(): bool
|
||||||
$platformUrl = Paybox::getConfigValue('url_serveur', false);
|
{
|
||||||
|
$valid = false;
|
||||||
}
|
|
||||||
|
$mode = self::getConfigValue('mode', false);
|
||||||
|
|
||||||
|
// If we're in test mode, do not display Paybox on the front office, except for allowed IP addresses.
|
||||||
// Be sure to have a valid platform URL, otherwise give up
|
if ('TEST' === $mode) {
|
||||||
|
$raw_ips = explode("\n", self::getConfigValue('allowed_ip_list', ''));
|
||||||
if (false === $platformUrl) {
|
|
||||||
|
$allowed_client_ips = [];
|
||||||
throw new \InvalidArgumentException(
|
|
||||||
|
foreach ($raw_ips as $ip) {
|
||||||
Translator::getInstance()->trans(
|
$allowed_client_ips[] = trim($ip);
|
||||||
|
}
|
||||||
"The platform URL is not defined, please check Paybox module configuration.",
|
|
||||||
|
$client_ip = $this->getRequest()->getClientIp();
|
||||||
[],
|
|
||||||
|
$valid = \in_array($client_ip, $allowed_client_ips);
|
||||||
Paybox::MODULE_DOMAIN
|
} elseif ('PRODUCTION' === $mode) {
|
||||||
|
$valid = true;
|
||||||
)
|
}
|
||||||
|
|
||||||
);
|
if ($valid) {
|
||||||
|
// Check if total order amount is in the module's limits
|
||||||
}
|
$valid = $this->checkMinMaxAmount();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $valid;
|
||||||
$hashAlgo = $this->getHashAlgorithm();
|
}
|
||||||
|
|
||||||
$clefPrivee = Paybox::getConfigValue('clef_privee');
|
/**
|
||||||
|
* Check if total order amount is in the module's limits.
|
||||||
|
*
|
||||||
|
* @return bool true if the current order total is within the min and max limits
|
||||||
// Generate a transaction ID
|
*/
|
||||||
|
protected function checkMinMaxAmount(): bool
|
||||||
$transactionId = sprintf("%010d", $order->getId());
|
{
|
||||||
|
// Check if total order amount is in the module's limits
|
||||||
|
$order_total = $this->getCurrentOrderTotalAmount();
|
||||||
|
|
||||||
$order->setTransactionRef($transactionId)->save();
|
$min_amount = self::getConfigValue('minimum_amount', 0);
|
||||||
|
$max_amount = self::getConfigValue('maximum_amount', 0);
|
||||||
|
|
||||||
|
return $order_total > 0
|
||||||
$paybox_params = [
|
&& ($min_amount <= 0 || $order_total >= $min_amount)
|
||||||
|
&& ($max_amount <= 0 || $order_total <= $max_amount);
|
||||||
'PBX_SITE' => Paybox::getConfigValue('numero_site'),
|
}
|
||||||
|
|
||||||
'PBX_RANG' => Paybox::getConfigValue('rang_site'),
|
/**
|
||||||
|
* Get the numeric ISO 4217 code of a currency.
|
||||||
'PBX_IDENTIFIANT' => Paybox::getConfigValue('identifiant_interne'),
|
*
|
||||||
|
* @param string $textCurrencyCode currency textual code, like EUR or USD
|
||||||
'PBX_RETOUR' => self::PARAMETRES_RETOUR,
|
*
|
||||||
|
* @return string the algorithm
|
||||||
'PBX_HASH' => $hashAlgo,
|
*
|
||||||
|
* @throw \RuntimeException if no algorithm was found.
|
||||||
'PBX_SECRET' => $clefPrivee,
|
*/
|
||||||
|
protected function getCurrencyIso4217NumericCode($textCurrencyCode)
|
||||||
'PBX_ANNULE' => Paybox::getConfigValue('url_retour_abandon'),
|
{
|
||||||
|
$currencies = null;
|
||||||
'PBX_EFFECTUE' => Paybox::getConfigValue('url_retour_succes'),
|
|
||||||
|
$localIso417data = __DIR__.DS.'Config'.DS.'iso4217.xml';
|
||||||
'PBX_REFUSE' => Paybox::getConfigValue('url_retour_refus'),
|
|
||||||
|
$currencyXmlDataUrl = 'http://www.currency-iso.org/dam/downloads/lists/list_one.xml';
|
||||||
|
|
||||||
|
$xmlData = @file_get_contents($currencyXmlDataUrl);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$currencies = new \SimpleXMLElement($xmlData);
|
||||||
|
|
||||||
|
// Update the local currencies copy.
|
||||||
|
@file_put_contents($localIso417data, $xmlData);
|
||||||
|
} catch (\Exception $ex) {
|
||||||
|
Tlog::getInstance()->warning("Failed to get currency XML data from $currencyXmlDataUrl: ".$ex->getMessage());
|
||||||
|
try {
|
||||||
|
$currencies = new \SimpleXMLElement(@file_get_contents($localIso417data));
|
||||||
|
} catch (\Exception $ex) {
|
||||||
|
Tlog::getInstance()->warning("Failed to get currency XML data from local copy $localIso417data: ".$ex->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null !== $currencies) {
|
||||||
|
foreach ($currencies->CcyTbl->CcyNtry as $country) {
|
||||||
|
if ($country->Ccy == $textCurrencyCode) {
|
||||||
|
return (string) $country->CcyNbr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Last chance
|
||||||
|
switch ($textCurrencyCode) {
|
||||||
|
case 'USD':
|
||||||
|
return 840;
|
||||||
|
case 'GBP':
|
||||||
|
return 826;
|
||||||
|
break;
|
||||||
|
case 'EUR':
|
||||||
|
return 978;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \RuntimeException(
|
||||||
|
Translator::getInstance()->trans(
|
||||||
|
'Failed to get ISO 4217 data for currency %curr, payment is not possible.',
|
||||||
|
['%curr' => $textCurrencyCode]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find a suitable hashing algorithm.
|
||||||
|
*
|
||||||
|
* @return string the algorithm
|
||||||
|
*
|
||||||
|
* @throw \RuntimeException if no algorithm was found.
|
||||||
|
*/
|
||||||
|
protected function getHashAlgorithm(): string
|
||||||
|
{
|
||||||
|
// Possible hashes
|
||||||
|
$hashes = [
|
||||||
|
'sha512',
|
||||||
|
'sha256',
|
||||||
|
'sha384',
|
||||||
|
'ripemd160',
|
||||||
|
'sha224',
|
||||||
|
'mdc2',
|
||||||
|
];
|
||||||
|
|
||||||
|
$hashEnabled = hash_algos();
|
||||||
|
|
||||||
|
foreach ($hashes as $hash) {
|
||||||
|
if (\in_array($hash, $hashEnabled)) {
|
||||||
|
return strtoupper($hash);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \RuntimeException(
|
||||||
|
Translator::getInstance()->trans(
|
||||||
|
'Failed to find a suitable hash algorithm. Please check your PHP configuration.'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
Ce module vous permet de proposer à vos clients le système de paiement Paybox.
|
Ce module vous permet de proposer à vos clients le système de paiement Paybox.
|
||||||
|
|
||||||
|
> Compatible 3Dsv2
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
> Ce module requiert Thelia 2.1 beta1 au minimum
|
> Ce module requiert Thelia 2.1 beta1 au minimum
|
||||||
@@ -29,6 +31,8 @@ This module offers to your customers the Paybox payment system.
|
|||||||
|
|
||||||
> This module requires Thelia 2.1 beta1 or newer
|
> This module requires Thelia 2.1 beta1 or newer
|
||||||
|
|
||||||
|
> Compatible 3Dsv2
|
||||||
|
|
||||||
To install the Paybox module, uncompress the archive in the `<thelia root>/local/modules` directory. Be sure that the name of the module's directory is `Paybox` (and not `Paybox-master`, for exemple).
|
To install the Paybox module, uncompress the archive in the `<thelia root>/local/modules` directory. Be sure that the name of the module's directory is `Paybox` (and not `Paybox-master`, for exemple).
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<dwsync>
|
|
||||||
<file name="LICENSE.txt" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
<file name="Paybox.php" server="51.254.220.106//web/" local="131390920547656250" remote="131390920800000000" />
|
|
||||||
<file name="README.md" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
<file name="composer.json" server="51.254.220.106//web/" local="131353051200000000" remote="131390168400000000" />
|
|
||||||
</dwsync>
|
|
||||||
@@ -4,9 +4,18 @@
|
|||||||
"license": "LGPL-3.0+",
|
"license": "LGPL-3.0+",
|
||||||
"type": "thelia-module",
|
"type": "thelia-module",
|
||||||
"require": {
|
"require": {
|
||||||
"thelia/installer": "~1.0"
|
"thelia/installer": "~1.0",
|
||||||
|
"giggsey/libphonenumber-for-php": "^8.13"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"thelia/paybox3x-module": "This module offers to your customers the Paybox 3x payment system"
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"installer-name": "Paybox"
|
"installer-name": "Paybox"
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"allow-plugins": {
|
||||||
|
"thelia/installer": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
280
local/modules/Paybox/composer.lock
generated
Normal file
280
local/modules/Paybox/composer.lock
generated
Normal file
@@ -0,0 +1,280 @@
|
|||||||
|
{
|
||||||
|
"_readme": [
|
||||||
|
"This file locks the dependencies of your project to a known state",
|
||||||
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
|
"This file is @generated automatically"
|
||||||
|
],
|
||||||
|
"content-hash": "817096e4d966c233d7648d2c037f288d",
|
||||||
|
"packages": [
|
||||||
|
{
|
||||||
|
"name": "giggsey/libphonenumber-for-php",
|
||||||
|
"version": "8.13.45",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/giggsey/libphonenumber-for-php.git",
|
||||||
|
"reference": "142ccdd603e4eeef7de9a7ddbd9ae18c2651dbd6"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/142ccdd603e4eeef7de9a7ddbd9ae18c2651dbd6",
|
||||||
|
"reference": "142ccdd603e4eeef7de9a7ddbd9ae18c2651dbd6",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"giggsey/locale": "^1.7|^2.0",
|
||||||
|
"php": ">=5.3.2",
|
||||||
|
"symfony/polyfill-mbstring": "^1.17"
|
||||||
|
},
|
||||||
|
"replace": {
|
||||||
|
"giggsey/libphonenumber-for-php-lite": "self.version"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"pear/pear-core-minimal": "^1.9",
|
||||||
|
"pear/pear_exception": "^1.0",
|
||||||
|
"pear/versioncontrol_git": "^0.5",
|
||||||
|
"phing/phing": "^2.7",
|
||||||
|
"php-coveralls/php-coveralls": "^1.0|^2.0",
|
||||||
|
"symfony/console": "^2.8|^3.0|^v4.4|^v5.2",
|
||||||
|
"symfony/phpunit-bridge": "^4.2 || ^5"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "8.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"libphonenumber\\": "src/"
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/src/data/",
|
||||||
|
"/src/carrier/data/",
|
||||||
|
"/src/geocoding/data/",
|
||||||
|
"/src/timezone/data/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"Apache-2.0"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Joshua Gigg",
|
||||||
|
"email": "giggsey@gmail.com",
|
||||||
|
"homepage": "https://giggsey.com/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PHP Port of Google's libphonenumber",
|
||||||
|
"homepage": "https://github.com/giggsey/libphonenumber-for-php",
|
||||||
|
"keywords": [
|
||||||
|
"geocoding",
|
||||||
|
"geolocation",
|
||||||
|
"libphonenumber",
|
||||||
|
"mobile",
|
||||||
|
"phonenumber",
|
||||||
|
"validation"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/giggsey/libphonenumber-for-php/issues",
|
||||||
|
"source": "https://github.com/giggsey/libphonenumber-for-php"
|
||||||
|
},
|
||||||
|
"time": "2024-09-06T11:22:54+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "giggsey/locale",
|
||||||
|
"version": "2.6",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/giggsey/Locale.git",
|
||||||
|
"reference": "37874fa473131247c348059fb7b8985efc18b5ea"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/giggsey/Locale/zipball/37874fa473131247c348059fb7b8985efc18b5ea",
|
||||||
|
"reference": "37874fa473131247c348059fb7b8985efc18b5ea",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.2"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"ext-json": "*",
|
||||||
|
"pear/pear-core-minimal": "^1.9",
|
||||||
|
"pear/pear_exception": "^1.0",
|
||||||
|
"pear/versioncontrol_git": "^0.5",
|
||||||
|
"phing/phing": "^2.7",
|
||||||
|
"php-coveralls/php-coveralls": "^2.0",
|
||||||
|
"phpunit/phpunit": "^8.5|^9.5",
|
||||||
|
"symfony/console": "^5.0|^6.0",
|
||||||
|
"symfony/filesystem": "^5.0|^6.0",
|
||||||
|
"symfony/finder": "^5.0|^6.0",
|
||||||
|
"symfony/process": "^5.0|^6.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Giggsey\\Locale\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Joshua Gigg",
|
||||||
|
"email": "giggsey@gmail.com",
|
||||||
|
"homepage": "https://giggsey.com/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Locale functions required by libphonenumber-for-php",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/giggsey/Locale/issues",
|
||||||
|
"source": "https://github.com/giggsey/Locale/tree/2.6"
|
||||||
|
},
|
||||||
|
"time": "2024-04-18T19:31:19+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/polyfill-mbstring",
|
||||||
|
"version": "v1.31.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||||
|
"reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341",
|
||||||
|
"reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.2"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"ext-mbstring": "*"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-mbstring": "For best performance"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"thanks": {
|
||||||
|
"name": "symfony/polyfill",
|
||||||
|
"url": "https://github.com/symfony/polyfill"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"bootstrap.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Polyfill\\Mbstring\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicolas Grekas",
|
||||||
|
"email": "p@tchwork.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Symfony polyfill for the Mbstring extension",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"keywords": [
|
||||||
|
"compatibility",
|
||||||
|
"mbstring",
|
||||||
|
"polyfill",
|
||||||
|
"portable",
|
||||||
|
"shim"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://symfony.com/sponsor",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/fabpot",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2024-09-09T11:45:10+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "thelia/installer",
|
||||||
|
"version": "1.5",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/thelia/installer.git",
|
||||||
|
"reference": "30b7a084e64bd3a4ffb290fa6d9bf096b64b2b56"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/thelia/installer/zipball/30b7a084e64bd3a4ffb290fa6d9bf096b64b2b56",
|
||||||
|
"reference": "30b7a084e64bd3a4ffb290fa6d9bf096b64b2b56",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"composer-plugin-api": "^1.0||^2.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"composer/composer": "1.0.*@dev||2.0.*@dev"
|
||||||
|
},
|
||||||
|
"type": "composer-plugin",
|
||||||
|
"extra": {
|
||||||
|
"class": "Thelia\\Composer\\TheliaInstallerPlugin"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-0": {
|
||||||
|
"Thelia\\Composer": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"LGPL-3.0-or-later"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Manuel Raynaud",
|
||||||
|
"email": "raynaud.manu@gmail.com",
|
||||||
|
"homepage": "https://github.com/lunika"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "custom installer for Thelia.",
|
||||||
|
"keywords": [
|
||||||
|
"Thelia",
|
||||||
|
"Thelia-module",
|
||||||
|
"Thelia-template"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/thelia/installer/issues",
|
||||||
|
"source": "https://github.com/thelia/installer/tree/1.5"
|
||||||
|
},
|
||||||
|
"time": "2024-08-12T13:48:42+00:00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"packages-dev": [],
|
||||||
|
"aliases": [],
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"stability-flags": [],
|
||||||
|
"prefer-stable": false,
|
||||||
|
"prefer-lowest": false,
|
||||||
|
"platform": [],
|
||||||
|
"platform-dev": [],
|
||||||
|
"plugin-api-version": "2.6.0"
|
||||||
|
}
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<dwsync>
|
|
||||||
<file name="ManuelIntegrationPayboxSystem_V6.2_EN.pdf" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
<file name="PayboxTestParameters_V6.2_EN.pdf" server="51.254.220.106//web/" local="131353051200000000" remote="131390169000000000" />
|
|
||||||
</dwsync>
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<dwsync>
|
|
||||||
<file name="paybox-logo.png" server="51.254.220.106//web/" local="131390905800000000" remote="131390905800000000" />
|
|
||||||
</dwsync>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.5 KiB |
Reference in New Issue
Block a user