From ef302ef0d222a644e2a1168f2151bab5e7ff87b7 Mon Sep 17 00:00:00 2001 From: Snowy Cat Software Date: Thu, 15 Feb 2018 20:31:03 +0100 Subject: [PATCH] Update to version 2.0.0 --- .editorconfig | 11 - .gitignore | 8 +- .gitmodules | 3 - .travis.yml | 14 - mollie/LICENSE => LICENSE | 0 README.md | 170 +- build.sh | 52 + changelog.md | 73 - controllers/front/index.php | 11 + controllers/front/payment.php | 550 +++ controllers/front/return.php | 161 + controllers/front/webhook.php | 272 ++ controllers/index.php | 11 + index.php | 11 + lib/composer.json | 5 + lib/composer.lock | 97 + lib/index.php | 11 + lib/paymentoptions.php | 110 + lib/vendor/autoload.php | 7 + lib/vendor/composer/ClassLoader.php | 413 ++ lib/vendor/composer/LICENSE | 21 + lib/vendor/composer/autoload_classmap.php | 43 + lib/vendor/composer/autoload_namespaces.php | 10 + lib/vendor/composer/autoload_psr4.php | 9 + lib/vendor/composer/autoload_real.php | 52 + lib/vendor/composer/autoload_static.php | 64 + lib/vendor/composer/index.php | 11 + lib/vendor/composer/installed.json | 82 + lib/vendor/index.php | 11 + lib/vendor/mollie/index.php | 11 + lib/vendor/mollie/mollie-api-php/LICENSE | 8 + lib/vendor/mollie/mollie-api-php/README.md | 157 + .../mollie/mollie-api-php/composer.json | 35 + lib/vendor/mollie/mollie-api-php/index.php | 11 + .../src/Mollie/API/Autoloader.php | 68 + .../mollie-api-php/src/Mollie/API/Client.php | 457 ++ .../src/Mollie/API/CompatibilityChecker.php | 158 + .../src/Mollie/API/Exception.php | 54 + .../API/Exception/IncompatiblePlatform.php | 38 + .../src/Mollie/API/Exception/index.php | 11 + .../src/Mollie/API/Object/Customer.php | 82 + .../Mollie/API/Object/Customer/Mandate.php | 80 + .../API/Object/Customer/Subscription.php | 132 + .../src/Mollie/API/Object/Customer/index.php | 11 + .../src/Mollie/API/Object/Issuer.php | 55 + .../src/Mollie/API/Object/List.php | 54 + .../src/Mollie/API/Object/Method.php | 168 + .../src/Mollie/API/Object/Organization.php | 95 + .../src/Mollie/API/Object/Payment.php | 447 ++ .../src/Mollie/API/Object/Payment/Refund.php | 135 + .../src/Mollie/API/Object/Payment/index.php | 11 + .../src/Mollie/API/Object/Permission.php | 61 + .../src/Mollie/API/Object/Profile.php | 109 + .../src/Mollie/API/Object/Profile/APIKey.php | 73 + .../src/Mollie/API/Object/Profile/index.php | 11 + .../src/Mollie/API/Object/Settlement.php | 74 + .../src/Mollie/API/Object/index.php | 11 + .../src/Mollie/API/Resource/Base.php | 416 ++ .../src/Mollie/API/Resource/Customers.php | 65 + .../API/Resource/Customers/Mandates.php | 51 + .../API/Resource/Customers/Payments.php | 41 + .../API/Resource/Customers/Subscriptions.php | 64 + .../Mollie/API/Resource/Customers/index.php | 11 + .../src/Mollie/API/Resource/Issuers.php | 44 + .../src/Mollie/API/Resource/Methods.php | 44 + .../src/Mollie/API/Resource/Organizations.php | 57 + .../src/Mollie/API/Resource/Payments.php | 116 + .../Mollie/API/Resource/Payments/Refunds.php | 64 + .../Mollie/API/Resource/Payments/index.php | 11 + .../src/Mollie/API/Resource/Permissions.php | 62 + .../src/Mollie/API/Resource/Profiles.php | 68 + .../Mollie/API/Resource/Profiles/APIKeys.php | 63 + .../Mollie/API/Resource/Profiles/index.php | 11 + .../src/Mollie/API/Resource/Refunds.php | 49 + .../src/Mollie/API/Resource/Settlements.php | 44 + .../src/Mollie/API/Resource/Undefined.php | 44 + .../src/Mollie/API/Resource/index.php | 11 + .../mollie-api-php/src/Mollie/API/cacert.pem | 4066 +++++++++++++++++ .../mollie-api-php/src/Mollie/API/index.php | 11 + .../mollie-api-php/src/Mollie/index.php | 11 + .../mollie/mollie-api-php/src/index.php | 11 + logo.gif | Bin 0 -> 643 bytes logo.png | Bin 0 -> 1454 bytes mollie.php | 1128 +++++ mollie/controllers/front/payment.php | 415 -- mollie/controllers/front/return.php | 137 - mollie/controllers/front/webhook.php | 299 -- mollie/lib | 1 - mollie/logo.png | Bin 2028 -> 0 bytes mollie/logo_small.png | Bin 754 -> 0 bytes mollie/mollie.php | 981 ---- mollie/upgrade/Upgrade-1.0.3.php | 15 - mollie/views/css/mollie.css | 101 - mollie/views/css/mollie_bootstrap.css | 129 - mollie/views/templates/hook/mollie_config.tpl | 234 - .../views/templates/hook/mollie_methods.tpl | 75 - mollie/views/templates/hook/mollie_refund.tpl | 21 - release.sh | 3 - sql/index.php | 35 + sql/install.php | 44 + sql/uninstall.php | 41 + {mollie/translations => translations}/de.php | 76 +- {mollie/translations => translations}/en.php | 78 +- {mollie/translations => translations}/fr.php | 78 +- translations/index.php | 11 + {mollie/translations => translations}/nl.php | 82 +- upgrade/Upgrade-1.0.3.php | 47 + upgrade/Upgrade-2.0.0.php | 51 + upgrade/index.php | 11 + views/css/index.php | 11 + views/css/mollie.css | 481 ++ views/css/mollie_bootstrap.css | 545 +++ views/img/index.php | 11 + views/img/logo_small.png | Bin 0 -> 3042 bytes views/img/mollie_logo.png | Bin 0 -> 10159 bytes views/img/mollie_panel_icon.png | Bin 0 -> 705 bytes views/index.php | 11 + views/js/app/.eslintrc | 26 + views/js/app/css/banks.css | 91 + views/js/app/index.php | 36 + views/js/app/package.json | 30 + views/js/app/src/banks.js | 51 + views/js/app/src/confirmrefund.js | 24 + views/js/app/src/qrcode.js | 0 views/js/app/webpack.config.js | 136 + views/js/index.php | 36 + views/templates/admin/index.php | 11 + views/templates/admin/mollie_config.tpl | 359 ++ views/templates/admin/new_release.tpl | 41 + views/templates/front/error.tpl | 59 + views/templates/front/index.php | 11 + views/templates/front/mollie_issuers.tpl | 63 + views/templates/front/mollie_issuers17.tpl | 108 + .../templates/front/mollie_return.tpl | 85 +- views/templates/hook/cancel.tpl | 35 + views/templates/hook/error_message.tpl | 35 + .../templates/hook/ideal_dropdown.tpl | 120 +- views/templates/hook/index.php | 11 + views/templates/hook/ok.tpl | 33 + views/templates/hook/payment.tpl | 96 + views/templates/hook/refund.tpl | 116 + views/templates/index.php | 11 + 142 files changed, 14266 insertions(+), 2855 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .gitmodules delete mode 100644 .travis.yml rename mollie/LICENSE => LICENSE (100%) create mode 100755 build.sh delete mode 100644 changelog.md create mode 100644 controllers/front/index.php create mode 100644 controllers/front/payment.php create mode 100644 controllers/front/return.php create mode 100644 controllers/front/webhook.php create mode 100644 controllers/index.php create mode 100644 index.php create mode 100644 lib/composer.json create mode 100644 lib/composer.lock create mode 100644 lib/index.php create mode 100644 lib/paymentoptions.php create mode 100644 lib/vendor/autoload.php create mode 100644 lib/vendor/composer/ClassLoader.php create mode 100644 lib/vendor/composer/LICENSE create mode 100644 lib/vendor/composer/autoload_classmap.php create mode 100644 lib/vendor/composer/autoload_namespaces.php create mode 100644 lib/vendor/composer/autoload_psr4.php create mode 100644 lib/vendor/composer/autoload_real.php create mode 100644 lib/vendor/composer/autoload_static.php create mode 100644 lib/vendor/composer/index.php create mode 100644 lib/vendor/composer/installed.json create mode 100644 lib/vendor/index.php create mode 100644 lib/vendor/mollie/index.php create mode 100644 lib/vendor/mollie/mollie-api-php/LICENSE create mode 100644 lib/vendor/mollie/mollie-api-php/README.md create mode 100644 lib/vendor/mollie/mollie-api-php/composer.json create mode 100644 lib/vendor/mollie/mollie-api-php/index.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Autoloader.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Client.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/CompatibilityChecker.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Exception.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Exception/IncompatiblePlatform.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Exception/index.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Customer.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Customer/Mandate.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Customer/Subscription.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Customer/index.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Issuer.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/List.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Method.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Organization.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Payment.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Payment/Refund.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Payment/index.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Permission.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Profile.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Profile/APIKey.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Profile/index.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Settlement.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/index.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Base.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Mandates.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Payments.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Subscriptions.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/index.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Issuers.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Methods.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Organizations.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Payments.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Payments/Refunds.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Payments/index.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Permissions.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles/APIKeys.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles/index.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Refunds.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Settlements.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Undefined.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/index.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/cacert.pem create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/API/index.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/Mollie/index.php create mode 100644 lib/vendor/mollie/mollie-api-php/src/index.php create mode 100644 logo.gif create mode 100644 logo.png create mode 100644 mollie.php delete mode 100755 mollie/controllers/front/payment.php delete mode 100755 mollie/controllers/front/return.php delete mode 100755 mollie/controllers/front/webhook.php delete mode 160000 mollie/lib delete mode 100755 mollie/logo.png delete mode 100755 mollie/logo_small.png delete mode 100755 mollie/mollie.php delete mode 100755 mollie/upgrade/Upgrade-1.0.3.php delete mode 100755 mollie/views/css/mollie.css delete mode 100755 mollie/views/css/mollie_bootstrap.css delete mode 100755 mollie/views/templates/hook/mollie_config.tpl delete mode 100755 mollie/views/templates/hook/mollie_methods.tpl delete mode 100755 mollie/views/templates/hook/mollie_refund.tpl delete mode 100755 release.sh create mode 100644 sql/index.php create mode 100644 sql/install.php create mode 100644 sql/uninstall.php rename {mollie/translations => translations}/de.php (53%) mode change 100755 => 100644 rename {mollie/translations => translations}/en.php (53%) mode change 100755 => 100644 rename {mollie/translations => translations}/fr.php (53%) mode change 100755 => 100644 create mode 100644 translations/index.php rename {mollie/translations => translations}/nl.php (52%) mode change 100755 => 100644 create mode 100644 upgrade/Upgrade-1.0.3.php create mode 100644 upgrade/Upgrade-2.0.0.php create mode 100644 upgrade/index.php create mode 100644 views/css/index.php create mode 100644 views/css/mollie.css create mode 100644 views/css/mollie_bootstrap.css create mode 100644 views/img/index.php create mode 100644 views/img/logo_small.png create mode 100644 views/img/mollie_logo.png create mode 100644 views/img/mollie_panel_icon.png create mode 100644 views/index.php create mode 100644 views/js/app/.eslintrc create mode 100644 views/js/app/css/banks.css create mode 100644 views/js/app/index.php create mode 100644 views/js/app/package.json create mode 100644 views/js/app/src/banks.js create mode 100644 views/js/app/src/confirmrefund.js create mode 100644 views/js/app/src/qrcode.js create mode 100644 views/js/app/webpack.config.js create mode 100644 views/js/index.php create mode 100644 views/templates/admin/index.php create mode 100644 views/templates/admin/mollie_config.tpl create mode 100644 views/templates/admin/new_release.tpl create mode 100644 views/templates/front/error.tpl create mode 100644 views/templates/front/index.php create mode 100644 views/templates/front/mollie_issuers.tpl create mode 100644 views/templates/front/mollie_issuers17.tpl rename {mollie/views => views}/templates/front/mollie_return.tpl (64%) mode change 100755 => 100644 create mode 100644 views/templates/hook/cancel.tpl create mode 100644 views/templates/hook/error_message.tpl rename mollie/views/templates/front/mollie_issuers.tpl => views/templates/hook/ideal_dropdown.tpl (51%) mode change 100755 => 100644 create mode 100644 views/templates/hook/index.php create mode 100644 views/templates/hook/ok.tpl create mode 100644 views/templates/hook/payment.tpl create mode 100644 views/templates/hook/refund.tpl create mode 100644 views/templates/index.php diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 37622f870..000000000 --- a/.editorconfig +++ /dev/null @@ -1,11 +0,0 @@ -# EditorConfig: http://EditorConfig.org - -root = true - -[*] -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = tab -indent_size = 4 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 41f0a3284..309baa94d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ -.DS_Store -.idea -/*.zip +*mollie*.zip +views/js/app/dist/** +views/js/app/node_modules/** +yarn.lock +package-lock.json diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 7f2361b22..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "mollie/lib"] - path = mollie/lib - url = https://github.com/mollie/mollie-api-php.git diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 380c58cd1..000000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: php - -php: -- 5.3 -- 5.4 -- 5.5 -- 5.6 -- 7.0 -- 7.1 - -sudo: false - -script: -- find mollie tests -name *.php | xargs -n 1 -P4 php -l diff --git a/mollie/LICENSE b/LICENSE similarity index 100% rename from mollie/LICENSE rename to LICENSE diff --git a/README.md b/README.md index adcfc7c1c..62b61d07d 100644 --- a/README.md +++ b/README.md @@ -1,113 +1,57 @@ -![Mollie](https://www.mollie.com/files/Mollie-Logo-Style-Small.png) - -# Prestashop plugin voor [betalingen via Mollie](https://www.mollie.com/). # - -## Installatie [![Build Status](https://travis-ci.org/mollie/Prestashop.png)](https://travis-ci.org/mollie/Prestashop) ## - -## Prestashop 1.7+ - verzorgd door [Trendweb](https://www.trendweb.nl/). ## - -**Let op:** voor de installatie van deze module is eventueel FTP-toegang tot je webserver benodigd. Heb je hier geen ervaring mee? Laat de installatie van deze module dan over aan je websitebouwer of serverbeheerder. - -* Download de laatste versie van de module via de [website van onze partner Trendweb](https://trendweb.nl/modules/mollie-betaalmodule-voor-prestashop-1-7/) welke geschikt is voor Prestashop 1.7. -* Ga naar het administratiepaneel van uw Prestashop webwinkel -* In uw administratiepaneel selecteert u de tab 'Modules' en kiest vervolgens 'upload een module' rechts bovenin uw scherm -* Kies 'selecteer bestand' en upload vervolgens het bestand met de naam 'mollie.zip' dat u eerder heeft gedownload -* Nadat de module zich heeft geïnstalleerd kiest u 'configureer' -* Vul uw _API-key_ in en sla de gegevens vervolgens op. - -## Prestashop 1.5 en 1.6 ## - -**Let op:** voor de installatie van deze module is FTP-toegang tot je webserver benodigd. Heb je hier geen ervaring mee? Laat de installatie van deze module dan over aan je websitebouwer of serverbeheerder. - -* Download de laatste versie van de module via de [Releases-pagina](https://github.com/mollie/Prestashop/releases) welke geschikt is voor Prestashop 1.5 en 1.6. -* Pak het archief uit -* Kopieer de map `mollie` naar de map `modules` in uw Prestashop installatie -* Ga in uw administratiepaneel naar de tab 'Modules' en kies in het lijstje 'Categories' voor 'Payments and Gateways' -* Klik op de 'install' knop rechts van de Mollie Payment Module -* Vul uw _API-key_ in en sla de gegevens vervolgens op. - -# Ondersteunde betaalmethodes - -### iDEAL -Met [iDEAL via Mollie](https://www.mollie.com/nl/payments/ideal) kunt u vertrouwd, veilig en gemakkelijk uw online aankopen afrekenen. iDEAL is het systeem dat u direct koppelt aan uw internetbankierprogramma bij een online aankoop. -Via [Mollie](https://www.mollie.com/) is iDEAL gemakkelijk aan te sluiten zonder de gebruikelijke technische en administratieve rompslomp. Mollie geeft u op ieder moment toegang tot uw transactieoverzichten en andere statistieken. Tevens is het mogelijk per e-mail of SMS een notificatie te ontvangen bij elke gelukte betaling. [Mollie](https://www.mollie.com/) is hierdoor dus een perfecte partner op het gebied van iDEAL en is het dan ook niet verbazingwekkend dat [Mollie](https://www.mollie.com/) ondertussen op meer dan 30.000 websites iDEAL-betalingen mag verzorgen. - -### Creditcard -[Creditcard](https://www.mollie.com/nl/payments/credit-card) is vrijwel de bekendste methode voor het ontvangen van betalingen met wereldwijde dekking. Doordat we onder andere de bekende merken Mastercard, VISA en American Express ondersteunen, zorgt dit direct voor veel potentiële kopers. - -### Bancontact -[Bancontact](https://www.mollie.com/nl/payments/bancontact) maakt gebruik van een fysieke kaart die gekoppeld is aan tegoed op een Belgische bankrekening. Betalingen via Bancontact/Mister Cash zijn gegarandeerd en lijkt daarmee sterk op iDEAL in Nederland. Daarom is het uitermate geschikt voor uw webwinkel. - -### SOFORT Banking -[SOFORT Banking](https://www.mollie.com/nl/payments/sofort) is één van de populairste betaalmethodes in Duitsland en actief in 11 landen. Betalingen zijn direct en niet storneerbaar, waarmee het sterk op het Nederlandse iDEAL lijkt. Daarom is het uitermate geschikt voor uw webwinkel. - -### Overboekingen -[Overboekingen](https://www.mollie.com/nl/payments/bank-transfer) binnen de SEPA zone ontvangen via Mollie. Hiermee kun je betalingen ontvangen van zowel particulieren als zakelijke klanten in meer dan 35 Europese landen. - -### PayPal -[PayPal](https://www.mollie.com/nl/payments/paypal) is wereldwijd een zeer populaire betaalmethode. In enkele klikken kunt u betalingen ontvangen via een bankoverschrijving, creditcard of het PayPal-saldo. - -### Bitcoin -[Bitcoin](https://www.mollie.com/nl/payments/bitcoin) is een vorm van elektronisch geld. De bitcoin-euro wisselkoers wordt vastgesteld op het moment van de transactie waardoor het bedrag en de uitbetaling zijn gegarandeerd. - -### paysafecard -[paysafecard](https://www.mollie.com/nl/payments/paysafecard) is de populairste prepaidcard voor online betalingen die veel door ouders voor hun kinderen wordt gekocht. - -### KBC/CBC-Betaalknop -De [KBC/CBC-Betaalknop](https://www.mollie.com/nl/payments/kbc-cbc) is een online betaalmethode voor de klanten van de KBC en CBC, samen de grootste bank van België. KBC richt zich op Vlaanderen en CBC op Wallonië. - -### Belfius Pay Button -[Belfius](https://www.mollie.com/nl/payments/belfius) is een van de grootste banken van België. Met de Belfius Pay Button voorziet de bank haar klanten van een eigen betaaloplossing. - -### CartaSi -[CartaSi](https://www.mollie.com/nl/payments/cartasi) is een van de meest gebruikte betaalmethoden in Italië. Er zijn ruim 13 miljoen CartaSi-creditcards in circulatie en het is een van de meest gebruikte betaalmethoden in Italië. - -### Cartes Bancaires -[Cartes Bancaires](https://www.mollie.com/nl/payments/cartes-bancaires) zijn de meest gebruikte creditcards in Frankrijk, met meer dan 64 miljoen kaarten in circulatie. De kaarten zijn co-branded met Visa. - -# Veel gestelde vragen # - -**De module kan niet geïnstalleerd worden in Prestashop 1.7.** - -* Ga via de FTP naar de hoofdmap van uw website en open vervolgens de map 'modules'. -* Verwijder de map met de naam 'mollie'. -* Doorloop wederom het installatieproces voor Prestashop 1.7. - -**Ik heb alles ingesteld, maar de module verschijnt niet bij het afrekenen.** - -* Controleer of de module staat ingeschakeld en of er een juiste API key staat ingesteld. Zie de installatie-instructies. -* Controleer of euro's als valuta staat ingesteld in uw winkel. Mollie ondersteunt alleen euro's. -* Controleer via "Geavanceerde parameters" -> "Prestatie" of "HTML minimaliseren" staat uigeschakeld. - -**Moet ik ook een return- en / of webhook-URL instellen?** - -Het is niet nodig een redirect URL of webhook in te stellen. Dat doet de module zelf automatisch bij elke order. - -**Na een succesvolle betaling krijgen mijn klanten de order history te zien in plaats van de order confirmation. Hoe los ik dat op?** - -Dit is in feite een bug in Prestashop die is gefixt vanaf versie 1.6.0.7. Om dit op te lossen zou u Prestashop moeten updaten. Als u dat niet wilt of kunt zou u ook middels aanpassing van één regel code de bug zelf kunnen fixen. In het relevante [github issue](https://github.com/mollie/Prestashop/issues/3) staat precies hoe u dit moet doen. - -**De status van mijn bestelling wordt niet bijgewerkt** - -Mollie stuurt een bericht aan je website wanneer de status van de betaling veranderd. Het kan zijn dat Mollie je website niet kon bereiken of dat je website de status niet heeft kunnen verwerken. - -* Controleer in je [Mollie beheer](https://www.mollie.com/beheer/) of er gefaalde rapportages zijn. [Meer informatie](https://www.mollie.com/nl/support/post/ik-krijg-een-e-mail-over-gefaalde-http-rapportages-wat-nu/) -* Controleer of je website in 'maintenance mode' draait. Mollie kan je website niet bereiken als je website in maintenance mode draait. -* Soms gaat er iets fout bij het aanmaken van de factuur. Controleer of de optie "Afbeelding voor het product inschakelen" uit staat in "Bestellingen" -> "Facturen" -> "Factuur opties" (vanaf PrestaShop 1.6.1.0) of in "Voorkeuren" -> "Bestellingen" -> "PDF instellingen" (in PrestaShop 1.6.0.12 tot 1.6.0.14). - -# Wil je meewerken aan deze module? # - -Wil je helpen om onze plugin voor PrestaShop nog beter te maken? Wij staan open voor [pull requests](https://github.com/mollie/Prestashop/pulls?utf8=%E2%9C%93&q=is%3Apr) voor onze module. - -Maar wat denk je er over om bij een [technology driven organisatie](https://www.mollie.com/nl/blog/post/werken-bij-mollie-sfeer-kansen-en-mogelijkheden/) aan de slag te gaan? Mollie is altijd op zoek naar developers en system engineers. [Check onze vacatures](https://www.mollie.com/nl/jobs) of [neem contact met ons op](mailto:personeel@mollie.com). - -# Licentie # -[BSD (Berkeley Software Distribution) License](http://www.opensource.org/licenses/bsd-license.php). -Copyright (c) 2013, Mollie B.V. - -# Ondersteuning # - -Heeft u problemen met de installatie of bevat de module volgens u een bug? Stuurt u dan een email -naar info@mollie.com met een zo precies mogelijke omschrijving van het probleem. - -![Powered By Mollie](https://www.mollie.com/images/badge-betaling-medium.png) +# Mollie +This is a Mollie module for PrestaShop and thirty bees. +You will need to have a [Mollie](https://www.mollie.com) account before you can use this plugin. + +## Installation +### Module installation +- Upload the module via your Back Office +- Install the module +- Check if there are any errors and correct them if necessary +- Profit! + +## Compatibility +This module has been tested with these versions: +- `1.5.0.17` - `1.5.6.3` +- `1.6.0.5` - `1.6.1.18` +- `1.7.0.5` - `1.7.3.0` + +## Requirements +- PHP > 5.2.0 +- PHP cURL extension +- PHP JSON extension + +## How to build a package +### Webpack +The plugin contains a webpack package at `views/js/app`. +Before the module can be zipped, this webpack item needs to be built for +dev (`webpack`) or production (`NODE_ENV=production webpack`). + +Begin with CD'ing into on the directory, e.g. `views/js/app/`, then install the necessary node modules: +```shell +$ npm i +``` +(shorthand for `npm install`, you can also use [yarn](https://yarnpkg.com/lang/en/), + but be sure to replace `npm i` with `yarn install` and `npm i -g` with `yarn add global`) + +Install webpack globally: +```shell +$ npm i -g webpack +``` +You can now build the package +```shell +$ cd /views/js/app +$ webpack +``` +To build a production package you will have to set the environment: +```shell +$ cd /views/js/app +$ NODE_ENV=production webpack +``` +This will both run webpack minifier plugins as well as use the production version of React. + +### Module zip +To build the whole package, go to the root directory of the module and run: +```shell +$ ./build.sh +``` +This will result in a production package named `mollie-vX.X.X.zip`. diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..76d75f8ca --- /dev/null +++ b/build.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +CWD_BASENAME=${PWD##*/} +CWD_BASEDIR=${PWD} + +if [ ! -d "${CWD_BASEDIR}/lib/vendor/" ]; then + cd lib + composer install --no-dev --prefer-dist + composer -o dump-autoload + find vendor/ -type d -exec cp index.php {} \; + rm rm ${CWD_BASEDIR}/lib/vendor/mollie/mollie-api-php/examples -rf + cd .. +fi + +cd ${CWD_BASEDIR}/views/js/app/ +if [ ! -d "${CWD_BASEDIR}/views/js/app/node_modules/" ]; then + npm i +fi +rm -rf ${CWD_BASEDIR}/views/js/app/dist/ +NODE_ENV=production webpack +cp ${CWD_BASEDIR}/views/js/app/index.php ${CWD_BASEDIR}/views/js/app/dist/index.php +cd ${CWD_BASEDIR} + +FILES=("logo.gif") +FILES+=("logo.png") +FILES+=("LICENSE") +FILES+=("${CWD_BASENAME}.php") +FILES+=("index.php") +FILES+=("controllers/**") +FILES+=("lib/**") +FILES+=("sql/**") +FILES+=("translations/**") +FILES+=("upgrade/**") +FILES+=("views/index.php") +FILES+=("views/css/**") +FILES+=("views/img/**") +FILES+=("views/js/index.php") +FILES+=("views/js/mollie.js") +FILES+=("views/js/app/index.php") +FILES+=("views/js/app/dist/*.min.js") +FILES+=("views/js/app/dist/index.php") +FILES+=("views/templates/**") + +MODULE_VERSION="$(sed -ne "s/\\\$this->version *= *['\"]\([^'\"]*\)['\"] *;.*/\1/p" ${CWD_BASENAME}.php)" +MODULE_VERSION=${MODULE_VERSION//[[:space:]]} +ZIP_FILE="${CWD_BASENAME}/${CWD_BASENAME}-v${MODULE_VERSION}.zip" + +echo "Going to zip ${CWD_BASENAME} version ${MODULE_VERSION}" + +cd .. +for E in "${FILES[@]}"; do + find ${CWD_BASENAME}/${E} -type f -exec zip -9 ${ZIP_FILE} {} \; +done diff --git a/changelog.md b/changelog.md deleted file mode 100644 index 3d17700eb..000000000 --- a/changelog.md +++ /dev/null @@ -1,73 +0,0 @@ -![Mollie](https://www.mollie.nl/files/Mollie-Logo-Style-Small.png) - -# Changelog # - -## Changes in release 1.3.0 ## -+ Automatically pass along the customer's email address for banktransfer payment instructions, when available. - -## Changes in release 1.2.6 ## -+ Fixed incorrect install/de-install hooks. -+ Update submodule [mollie-api-php](https://github.com/mollie/mollie-api-php) to `v1.5.1` - -## Changes in release 1.2.5 ## -+ Added some new translations. -+ EU Compliance module has been added. -+ Update submodule mollie-api-php to version 1.4.0. - -## Changes in release 1.2.4 ## -+ Added payment description filters ({cart.id} {customer.firstname} {customer.lastname} {customer.company}) -+ Update submodule mollie-api-php to version 1.3.3 - -## Changes in release 1.2.3 ## -+ Set default language for admin when no language set -+ Update submodule mollie-api-php to version 1.3.1 - -## Changes in release 1.2.2 ## -+ Fixed issue where banktransfer status didn't get updated correctly -+ Update submodule mollie-api-php to version 1.2.8 - -## Changes in release 1.2.1 ## -+ Fixed an issue where the country context is not set when Mollie calls the PrestaShop webhook. -+ Fixed an issue where the iDEAL issuers are not displayed correctly when using module OnePageCheckout. -+ Update submodule mollie-api-php to version 1.2.7 - -## Changes in release 1.2.0 ## -+ Add option to send webshop locale to Mollie to use in payment screens. This will use the -current language and country locale (In admin: Localization -> Advanced) - -## Changes in release 1.1.0 ## -+ Add English and German translations -+ Save Mollie payment id (tr_xxxx) in order payment -+ Update Mollie API client to version 1.2.5, contains system compatibility checker - -## Changes in release 1.0.8 ## -+ Create the order before the payment is finished when payment method is banktransfer. - -## Changes in release 1.0.7 ## -+ Stop Google Analytics from listing payment provider as referrer. - -## Changes in release 1.0.6 ## -+ Fixed redirect issue for cancelled payments. - -## Changes in release 1.0.5 ## -+ Fixed currency issue on return page. - -## Changes in release 1.0.4 ## -+ Added cart ID to payment descriptions. -+ Fixed missing keys warning. - -## Changes in release 1.0.3 ## -+ Fixed error in payment method selection. -+ Prevent customers from returning to an empty cart after cancelling a payment. -+ Fixed issues with Google Analytics by using Prestashop's default return page. - -## Changes in release 1.0.2 ## -+ Added 'open' order status. -+ Fixed bug where order updated twice. -+ Fixed iDEAL bank list not showing. - -## Changes in release 1.0.1 ## -+ Fixed issue with custom statuses for open payments. - -## Changes in release 1.0.0 ## -+ Initial release. diff --git a/controllers/front/index.php b/controllers/front/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/controllers/front/index.php @@ -0,0 +1,11 @@ + + * @copyright Mollie B.V. + * @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php + * @category Mollie + * @package Mollie + * @link https://www.mollie.nl + */ + +if (!defined('_PS_VERSION_')) { + return; +} + +/** + * Class MolliePaymentModuleFrontController + * + * @property Context|null $context + * @property Mollie $module + */ +class MolliePaymentModuleFrontController extends ModuleFrontController +{ + // @codingStandardsIgnoreStart + /** @var bool $ssl */ + public $ssl = true; + /** @var bool $display_column_left */ + public $display_column_left = false; + /** @var bool $display_column_right */ + public $display_column_right = false; + // @codingStandardsIgnoreEnd + + /** + * @throws Mollie_API_Exception + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ + public function initContent() + { + parent::initContent(); + /** @var Cart $cart */ + $cart = $this->context->cart; + $customer = new Customer($cart->id_customer); + + if (!$this->validate( + $cart, + $customer + )) { + $this->errors[] = $this->module->lang['This payment method is not available.']; + $this->setTemplate('error.tpl'); + + return; + } + + $method = Tools::getValue('method'); + $issuer = Tools::getValue('issuer') ? Tools::getValue('issuer') : null; + + // If no issuer was set yet and the issuer list has its own page, show issuer list here + if (!$issuer && Configuration::get(Mollie::MOLLIE_ISSUERS) == Mollie::ISSUERS_OWN_PAGE && $method === 'ideal') { + $tplData = array(); + $issuers = $this->module->getIssuerList(); + $tplData['issuers'] = isset($issuers['ideal']) ? $issuers['ideal'] : array(); + if (!empty($tplData['issuers'])) { + $tplData['msg_bankselect'] = $this->module->lang['Select your bank:']; + $tplData['msg_ok'] = $this->module->lang['OK']; + $tplData['msg_return'] = $this->module->lang['Different payment method']; + $this->context->smarty->assign($tplData); + if (version_compare(_PS_VERSION_, '1.7.0.0', '<')) { + $this->setTemplate('mollie_issuers.tpl'); + } else { + $this->setTemplate('module:mollie/views/templates/front/mollie_issuers17.tpl'); + } + + return; + } + } + + // Currency conversion (thou shalt pay in euros) + $originalAmount = $cart->getOrderTotal( + true, + Cart::BOTH + ); + $amount = $this->convertCurrencyToEuro($originalAmount); + + // Prepare payment + $paymentData = $this->getPaymentData( + $amount, + $method, + $issuer, + (int) $cart->id, + $customer->secure_key + ); + $payment = $this->createPayment($paymentData); + + + // Store payment linked to cart + if ($payment->method != 'banktransfer') { + Db::getInstance()->insert( + 'mollie_payments', + array( + 'cart_id' => (int) $cart->id, + 'method' => $payment->method, + 'transaction_id' => $payment->id, + 'bank_status' => Mollie_API_Object_Payment::STATUS_OPEN, + 'created_at' => date("Y-m-d H:i:s"), + ) + ); + } + + if ($payment->method == 'banktransfer') { + $this->module->validateOrder( + (int) $cart->id, + $this->module->statuses[$payment->status], + $originalAmount, + isset(Mollie::$methods[$payment->method]) ? Mollie::$methods[$payment->method] : 'Mollie', + null, + array(), + null, + false, + $customer->secure_key + ); + + $orderId = Order::getOrderByCartId((int) $cart->id); + + Db::getInstance()->insert( + 'mollie_payments', + array( + 'cart_id' => (int) $cart->id, + 'order_id' => $orderId, + 'method' => $payment->method, + 'transaction_id' => $payment->id, + 'bank_status' => Mollie_API_Object_Payment::STATUS_OPEN, + 'created_at' => date("Y-m-d H:i:s"), + ) + ); + } + + // Go to payment url + Tools::redirect($payment->getPaymentUrl()); + } + + /** + * Checks if this payment option is still available + * May redirect the user to a more appropriate page + * + * @param Cart $cart + * @param Customer $customer + * + * @return bool + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ + private function validate($cart, $customer) + { + if (!$cart->id_customer || !$cart->id_address_delivery || !$cart->id_address_invoice || !$this->module->active) { + // We be like: how did you even get here? + Tools::redirect(Context::getContext()->link->getPageLink('index', true)); + return false; + } + + $authorized = false; + + foreach (Module::getPaymentModules() as $module) { + if ($module['name'] == 'mollie') { + $authorized = true; + break; + } + } + + if (!$authorized) { + return false; + } + + if (!Validate::isLoadedObject($customer)) { + return false; + } + + return true; + } + + /** + * Retrieves a list of issuers for the selected method + * + * @param string $method + * + * @return array + * + * @throws PrestaShopException + */ + private function getIssuerListByMethod($method) + { + try { + $issuers = $this->module->api->issuers->all(); + $issuerList = array(); + foreach ($issuers as $issuer) { + if ($issuer->method === $method) { + $issuerList[$issuer->id] = $issuer->name; + } + } + return $issuerList; + } catch (Mollie_API_Exception $e) { + if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ERRORS) { + Logger::addLog(__METHOD__.' said: '.$e->getMessage(), Mollie::NOTICE); + } + } + return array(); + } + + /** + * @param float $amount + * + * @return float + * + * @throws PrestaShopException + */ + private function convertCurrencyToEuro($amount) + { + $cart = $this->context->cart; + $currencyEuro = Currency::getIdByIsoCode('EUR'); + if (!$currencyEuro) { + // No Euro currency available! + if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ERRORS) { + Logger::addLog( + __METHOD__.' said: In order to use this module, you need to enable Euros as currency.', + Mollie::CRASH + ); + } + die($this->module->lang['This payment method is only available for Euros.']); + } + + if ($cart->id_currency !== $currencyEuro) { + // Convert non-euro currency to default + $amount = Tools::convertPrice( + $amount, + $cart->id_currency, + false + ); + + if (Currency::getDefaultCurrency() !== $currencyEuro) { + // If default is not euro, convert to euro + $amount = Tools::convertPrice( + $amount, + $currencyEuro, + true + ); + } + } + + return round( + $amount, + 2 + ); + } + + /** + * @param int $cartId + * + * @return string + * @throws PrestaShopException + */ + private function generateDescriptionFromCart($cartId) + { + $cart = new Cart($cartId); + + $buyer = null; + if ($cart->id_customer) { + $buyer = new Customer($cart->id_customer); + } + + $filters = array( + 'cart.id' => $cartId, + 'customer.firstname' => $buyer == null ? '' : $buyer->firstname, + 'customer.lastname' => $buyer == null ? '' : $buyer->lastname, + 'customer.company' => $buyer == null ? '' : $buyer->company, + ); + + $content = Configuration::get(Mollie::MOLLIE_DESCRIPTION); + + foreach ($filters as $key => $value) { + $content = str_replace( + "{".$key."}", + $value, + $content + ); + } + + return $content; + } + + /** + * @param float $amount + * @param string $method + * @param string|null $issuer + * @param int $cartId + * + * @return array + * @throws PrestaShopException + */ + private function getPaymentData($amount, $method, $issuer, $cartId, $secureKey) + { + $description = $this->generateDescriptionFromCart($cartId); + $shippingAddress = new Address($this->context->cart->id_address_delivery); + $billingAddress = new Address($this->context->cart->id_address_invoice); + $customer = new Customer((int) $this->context->cart->id_customer); + $ipAddress = Tools::getRemoteAddr(); + + $paymentData = array( + "amount" => $amount, + "method" => $method, + "issuer" => $issuer, + "description" => str_replace( + '%', + $cartId, + $description + ), + "redirectUrl" => $this->context->link->getModuleLink( + 'mollie', + 'return', + array('cart_id' => $cartId, 'utm_nooverride' => 1) + ), + "webhookUrl" => $this->context->link->getModuleLink( + 'mollie', + 'webhook' + ), + ); + + if (!Configuration::get(Mollie::MOLLIE_CREDENTIALS)) { + $paymentData['metadata'] = array( + "cart_id" => $cartId, + "secure_key" => $secureKey, + ); + } else { + $paymentData['metadata'] = array( + 'cart_id' => $cartId, + 'secure_key' => $secureKey, + 'customerEmailAddress' => $customer->email, + 'ipAddress' => $ipAddress, + 'billingAddress' => array( + 'language' => Language::getIsoById((int) $this->context->cookie->id_lang), + 'firstName' => $billingAddress->firstname, + 'lastName' => $billingAddress->lastname, + 'phoneNumber' => $billingAddress->phone, + 'address' => array( + 'postcode' => $billingAddress->postcode, + 'address1' => $billingAddress->address1, + 'address2' => $billingAddress->address2, + 'city' => $billingAddress->city, + 'country' => $billingAddress->country, + ), + ), + 'shippingAddress' => array( + 'firstName' => $shippingAddress->firstname, + 'lastName' => $shippingAddress->lastname, + 'phoneNumber' => $shippingAddress->phone, + 'address' => array( + 'postcode' => $shippingAddress->postcode, + 'address1' => $shippingAddress->address1, + 'address2' => $shippingAddress->address2, + 'city' => $shippingAddress->city, + 'country' => $shippingAddress->country, + ), + ), + 'products' => array(), + ); + + + $orderProducts = $this->context->cart->getProducts(); + + foreach ($orderProducts as $orderProduct) { + $paymentData['metadata']['products'][] = array( + 'price' => str_replace(',', '.', round($orderProduct['total_wt'], 2)), + 'quantity' => $orderProduct['cart_quantity'], + 'identifier' => $orderProduct['id_product'], + 'description' => $orderProduct['name'], + ); + } + + $discounts = $this->context->cart->getCartRules(); + + foreach ($discounts as $discount) { + $priceDiscount = -1 * str_replace(',', '.', round($discount['value_tax_exc'], 2)); + $taxDiscount = -1 * str_replace( + ',', + '.', + round($discount['value_real'] - $discount['value_tax_exc'], 2) + ); + + $paymentData['metadata']['products'][] = array( + 'price' => $priceDiscount + $taxDiscount, + 'quantity' => 1, + 'identifier' => $discount['name'], + 'description' => strip_tags($discount['description']), + ); + } + + $giftWrapping = $this->context->cart->getGiftWrappingPrice(); + + if ($this->context->cart->gift == 1) { + $giftWrappingPrice = str_replace(',', '.', round($giftWrapping, 2)); + + $paymentData['metadata']['products'][] = array( + 'price' => $giftWrappingPrice, + 'quantity' => 1, + 'identifier' => $this->module->l('Gift wrapping'), + 'description' => $this->module->l('Gift wrapping'), + ); + } + + $shippingCost = $this->context->cart->getPackageShippingCost(); + $carrier = new Carrier($this->context->cart->id_carrier, $this->context->cart->id_lang); + + $paymentData['metadata']['products'][] = array( + 'price' => str_replace(',', '.', round($shippingCost, 2)), + 'quantity' => 1, + 'identifier' => $carrier->name, + 'description' => $carrier->name, + ); + } + + // Send webshop locale + if (Configuration::get( + Mollie::MOLLIE_PAYMENTSCREEN_LOCALE + ) === Mollie::PAYMENTSCREEN_LOCALE_SEND_WEBSITE_LOCALE + ) { + $locale = $this->getWebshopLocale(); + + if (preg_match( + '/^[a-z]{2}(?:[\-_][A-Z]{2})?$/iu', + $locale + )) { + $paymentData['locale'] = $locale; + } + } + + if (isset($this->context, $this->context->cart)) { + if (isset($this->context->cart->id_customer)) { + $buyer = new Customer($this->context->cart->id_customer); + $paymentData['billingEmail'] = $buyer->email; + } + if (isset($this->context->cart->id_address_invoice)) { + $billing = new Address((int) $this->context->cart->id_address_invoice); + $paymentData['billingCity'] = $billing->city; + $paymentData['billingRegion'] = State::getNameById($billing->id_state); + $paymentData['billingPostal'] = $billing->postcode; + $paymentData['billingCountry'] = Country::getIsoById($billing->id_country); + } + if (isset($this->context->cart->id_address_delivery)) { + $shipping = new Address((int) $this->context->cart->id_address_delivery); + $paymentData['shippingCity'] = $shipping->city; + $paymentData['shippingRegion'] = State::getNameById($shipping->id_state); + $paymentData['shippingPostal'] = $shipping->postcode; + $paymentData['shippingCountry'] = Country::getIsoById($shipping->id_country); + } + } + + return $paymentData; + } + + /** + * @return string + * @throws PrestaShopException + */ + private function getWebshopLocale() + { + if ($this->context->language) { + // Current language + $language = $this->context->language->iso_code; + } else { + // Default locale language + $language = Configuration::get('PS_LOCALE_LANGUAGE'); + } + + return Tools::strtolower($language).'_'.Tools::strtoupper(Configuration::get('PS_LOCALE_COUNTRY')); + } + + /** + * @param array $data + * + * @return Mollie_API_Object_Payment|null + * + * @throws PrestaShopException + */ + private function createPayment($data) + { + $payment = null; + if (Configuration::get(Mollie::MOLLIE_USE_PROFILE_WEBHOOK)) { + unset($data['webhookUrl']); + } + + try { + /** @var Mollie_API_Object_Payment $payment */ + $payment = $this->module->api->payments->create($data); + } catch (Mollie_API_Exception $e) { + try { + if ($e->getField() == "webhookUrl") { + if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ERRORS) { + Logger::addLog( + __METHOD__.' said: Could not reach generated webhook url, falling back to profile webhook url.', + Mollie::WARNING + ); + } + unset($data['webhookUrl']); + $payment = $this->module->api->payments->create($data); + } else { + throw $e; + } + } catch (Mollie_API_Exception $e) { + if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ERRORS) { + Logger::addLog( + __METHOD__.' said: '.$e->getMessage(), + Mollie::CRASH + ); + } + if (Configuration::get(Mollie::MOLLIE_DISPLAY_ERRORS)) { + $this->errors[] = $this->module->lang['There was an error while processing your request: '].'
'.$e->getMessage().''; + + $this->setTemplate('error.tpl'); + + return null; + } else { + Tools::redirect(Context::getContext()->link->getPageLink('index', true)); + } + } + } + return $payment; + } +} diff --git a/controllers/front/return.php b/controllers/front/return.php new file mode 100644 index 000000000..07f5f0a5b --- /dev/null +++ b/controllers/front/return.php @@ -0,0 +1,161 @@ + + * @copyright Mollie B.V. + * @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php + * @category Mollie + * @package Mollie + * @link https://www.mollie.nl + */ + +if (!defined('_PS_VERSION_')) { + die('No direct script access'); +} + +/** + * Class MollieReturnModuleFrontController + * + * @property Context|null $context + * @property Mollie $module + */ +class MollieReturnModuleFrontController extends ModuleFrontController +{ + // @codingStandardsIgnoreStart + /** @var bool $ssl */ + public $ssl = true; + /** @var bool $display_column_left */ + public $display_column_left = false; + // @codingStandardsIgnoreEnd + + /** + * Unset the cart id from cookie if the order exists + * + * @throws PrestaShopException + */ + public function init() + { + /** @var Context $context */ + $context = Context::getContext(); + /** @var Cart $cart */ + $cart = new Cart((int) $this->context->cookie->id_cart); + if (Validate::isLoadedObject($cart) && $cart->orderExists()) { + unset($context->cart); + unset($context->cookie->id_cart); + unset($context->cookie->checkedTOS); + unset($context->cookie->check_cgv); + } + + parent::init(); + } + + /** + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ + public function initContent() + { + parent::initContent(); + $data = array(); + /** + * Set ref is indicative of a payment that is tied to an order instead of a cart, which + * we still support for transitional reasons. + */ + if (Tools::getIsset('ref')) { + $idOrder = (int) Tools::getValue('id'); + + // Check if user is allowed to be on the return page + $data['auth'] = Order::getUniqReferenceOf($idOrder) === Tools::getValue('ref'); + if ($data['auth']) { + $data['mollie_info'] = $this->module->getPaymentBy('order_id', (int) $idOrder); + } + } elseif (Tools::getIsset('cart_id')) { + $idCart = (int) Tools::getValue('cart_id'); + + // Check if user that's seeing this is the cart-owner + $cart = new Cart($idCart); + $data['auth'] = (int) $cart->id_customer === $this->context->customer->id; + if ($data['auth']) { + $data['mollie_info'] = $this->module->getPaymentBy('cart_id', (int) $idCart); + } + } + + if (isset($data['auth']) && $data['auth']) { + // any paid payments for this cart? + + if ($data['mollie_info'] === false) { + $data['mollie_info'] = array(); + $data['msg_details'] = $this->module->lang('The order with this id does not exist.'); + } else { + switch ($data['mollie_info']['bank_status']) { + case Mollie_API_Object_Payment::STATUS_OPEN: + $data['msg_details'] = $this->module->lang('We have not received a definite payment status. You will be notified as soon as we receive a confirmation of the bank/merchant.'); + break; + case Mollie_API_Object_Payment::STATUS_CANCELLED: + Tools::redirect($this->context->link->getPagelink('order', true, null, array('step' => 3))); + break; + case Mollie_API_Object_Payment::STATUS_EXPIRED: + $data['msg_details'] = $this->module->lang('Unfortunately your payment was expired.'); + break; + case Mollie_API_Object_Payment::STATUS_PAID: + // Validate the Order + if (isset($cart) && Validate::isLoadedObject($cart)) { + Tools::redirect( + $this->context->link->getPageLink( + 'order-confirmation', + true, + null, + array( + 'id_cart' => (int) $cart->id, + 'id_module' => (int) $this->module->id, + 'id_order' => (int) Order::getOrderByCartId($cart->id), + 'key' => $cart->secure_key, + ) + ) + ); + } + + $data['msg_details'] = $this->module->lang('Thank you. Your order has been received.'); + break; + default: + $data['msg_details'] = $this->module->lang('The transaction has an unexpected status.'); + if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ERRORS) { + Logger::addLog(__METHOD__.'said: The transaction has an unexpected status ('.$data['mollie_info']['bank_status'].')', Mollie::WARNING); + } + } + } + } else { + // Not allowed? Don't make query but redirect. + $data['mollie_info'] = array(); + $data['msg_details'] = $this->module->lang('You are not authorised to see this page.'); + Tools::redirect(Context::getContext()->link->getPageLink('index', true)); + } + + $this->context->smarty->assign($data); + $this->context->smarty->assign('link', $this->context->link); + $this->setTemplate('mollie_return.tpl'); + } +} diff --git a/controllers/front/webhook.php b/controllers/front/webhook.php new file mode 100644 index 000000000..77b046042 --- /dev/null +++ b/controllers/front/webhook.php @@ -0,0 +1,272 @@ + + * @copyright Mollie B.V. + * @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php + * @category Mollie + * @package Mollie + * @link https://www.mollie.nl + */ + +if (!defined('_PS_VERSION_')) { + die('No direct script access'); +} + +/** + * Class MollieReturnModuleFrontController + * @method setTemplate + * + * @property mixed context + * @property Mollie module + */ +class MollieWebhookModuleFrontController extends ModuleFrontController +{ + // @codingStandardsIgnoreStart + /** @var bool $ssl */ + public $ssl = true; + /** @var bool $display_column_left */ + public $display_column_left = false; + /** @var bool $display_column_right */ + public $display_column_right = false; + // @codingStandardsIgnoreEnd + + /** + * Prevent displaying the maintenance page + * + * @return void + */ + protected function displayMaintenancePage() + { + } + + /** + * @throws Adapter_Exception + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ + public function initContent() + { + die($this->executeWebhook()); + } + + /** + * @return string + * @throws Adapter_Exception + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ + protected function executeWebhook() + { + if (Tools::getValue('testByMollie')) { + if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ERRORS) { + Logger::addLog(__METHOD__.' said: Mollie webhook tester successfully communicated with the shop.', Mollie::NOTICE); + } + + return 'OK'; + } + + $transactionId = Tools::getValue('id'); + + if (empty($transactionId)) { + if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ERRORS) { + Logger::addLog(__METHOD__.' said: Received webhook request without proper transaction ID.', Mollie::WARNING); + } + + return 'NO ID'; + } + + try { + /** @var Mollie_API_Object_Payment $apiPayment */ + $apiPayment = $this->module->api->payments->get($transactionId); + $transactionId = $apiPayment->id; + } catch (Exception $e) { + if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ERRORS) { + Logger::addLog(__METHOD__.' said: Could not retrieve payment details for transaction_id "'.$transactionId.'". Reason: '.$e->getMessage(), Mollie::WARNING); + } + + return 'NOT OK'; + } + + $psPayment = $this->module->getPaymentBy('transaction_id', $transactionId); + + $this->setCountryContextIfNotSet($apiPayment); + + $orderId = (int) Order::getOrderByCartId($apiPayment->metadata->cart_id); + if ($apiPayment->metadata->cart_id) { + if (in_array($apiPayment->status, array(Mollie_API_Object_Payment::STATUS_CHARGED_BACK, Mollie_API_Object_Payment::STATUS_REFUNDED))) { + $this->module->setOrderStatus($orderId, Mollie_API_Object_Payment::STATUS_REFUNDED); + } elseif ($psPayment['method'] == 'banktransfer' && + $psPayment['bank_status'] === Mollie_API_Object_Payment::STATUS_OPEN && + $apiPayment->status === Mollie_API_Object_Payment::STATUS_PAID + ) { + $this->module->setOrderStatus($orderId, $apiPayment->status); + } elseif ($psPayment['method'] != 'banktransfer' && + $psPayment['bank_status'] === Mollie_API_Object_Payment::STATUS_OPEN && + $apiPayment->status === Mollie_API_Object_Payment::STATUS_PAID + ) { + $this->module->validateOrder((int) $apiPayment->metadata->cart_id, + $this->module->statuses[$apiPayment->status], + $this->convertEuroToCartCurrency($apiPayment->amount, (int) $apiPayment->metadata->cart_id), + isset(Mollie::$methods[$apiPayment->method]) ? Mollie::$methods[$apiPayment->method] : 'Mollie', + null, + array(), + null, + false, + $apiPayment->metadata->secure_key + ); + + $orderId = Order::getOrderByCartId($apiPayment->metadata->cart_id); + } + } + + // Store status in database + + $this->saveOrderTransactionData($apiPayment->id, $apiPayment->method, $orderId); + + if (!$this->savePaymentStatus($transactionId, $apiPayment->status, $orderId)) { + if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ERRORS) { + Logger::addLog(__METHOD__.' said: Could not save Mollie payment status for transaction "'.$transactionId.'". Reason: '.Db::getInstance()->getMsgError(), Mollie::WARNING); + } + } + + // Log successful webhook requests in extended log mode only + if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ALL) { + Logger::addLog(__METHOD__.' said: Received webhook request for order '.(int) $orderId.' / transaction '.$transactionId, Mollie::NOTICE); + } + + return 'OK'; + } + + /** + * Retrieves the OrderPayment object, created at validateOrder. And add transaction data. + * + * @param string $molliePaymentId + * @param string $molliePaymentMethod + * @param int $orderId + * + * @return void + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ + private function saveOrderTransactionData($molliePaymentId, $molliePaymentMethod, $orderId) + { + // retrieve ALL payments of order. + // in the case of a cancel or expired on banktransfer, this will fire too. + // if no OrderPayment objects is retrieved in the collection, do nothing. + $order = new Order((int) $orderId); + $collection = OrderPayment::getByOrderReference($order->reference); + if (count($collection) > 0) { + $orderPayment = $collection[0]; + + // for older versions (1.5) , we check if it hasn't been filled yet. + if (!$orderPayment->transaction_id) { + $orderPayment->transaction_id = $molliePaymentId; + $orderPayment->payment_method = $molliePaymentMethod; + $orderPayment->update(); + } + } + } + + + /** + * @param string $transactionId + * @param int $status + * @param int $orderId + * + * @return bool + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ + protected function savePaymentStatus($transactionId, $status, $orderId) + { + $data = array( + 'updated_at' => date("Y-m-d H:i:s"), + 'bank_status' => $status, + 'order_id' => (int) $orderId, + ); + + return Db::getInstance()->update('mollie_payments', $data, + '`transaction_id` = \''.pSQL($transactionId).'\''); + } + + /** + * Transforms euro prices from mollie back to the currency of the Cart (order) + * + * @param float $amount in euros + * @param int $cartId + * + * @return float in the currency of the cart + * @throws PrestaShopException + */ + private function convertEuroToCartCurrency($amount, $cartId) + { + $cart = new Cart($cartId); + $currencyEuro = Currency::getIdByIsoCode('EUR'); + + if (!$currencyEuro) { + // No Euro currency available! + if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ERRORS) { + Logger::addLog(__METHOD__.' said: In order to use this module, you need to enable Euros as currency. Cart ID: '.$cartId, Mollie::CRASH); + } + die($this->module->lang['This payment method is only available for Euros.']); + } + + if ($cart->id_currency !== $currencyEuro) { + // Convert euro currency to cart currency + $amount = Tools::convertPriceFull($amount, Currency::getCurrencyInstance($currencyEuro), + Currency::getCurrencyInstance($cart->id_currency)); + } + + return round($amount, 2); + } + + /** + * (Re)sets the controller country context. + * When Prestashop receives a call from Mollie (without context) + * Prestashop allways has default context to fall back on, so context->country + * is allways Set before executing any controller methods + * + * @param Mollie_API_Object_Payment $payment + */ + private function setCountryContextIfNotSet(Mollie_API_Object_Payment $payment) + { + if (empty($this->context->country) || !$this->context->country->active) { + if ($payment->metadata->cart_id) { + $cart = new Cart((int) $payment->metadata->cart_id); + if (!empty($cart)) { + $address = new Address($cart->id_address_delivery); + if (!empty($address)) { + $country = new Country($address->id_country); + if (!empty($country)) { + $this->context->country = $country; + } + } + } + } + } + } +} diff --git a/controllers/index.php b/controllers/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/controllers/index.php @@ -0,0 +1,11 @@ +=5.2" + }, + "require-dev": { + "phpunit/phpunit": "^3.7 || ^4.8 || ^5.4" + }, + "suggest": { + "mollie/oauth2-mollie-php": "Use OAuth to authenticate with the Mollie API. This is needed for some endpoints. Visit https://mollie.com/en/docs for more information." + }, + "type": "library", + "autoload": { + "psr-0": { + "Mollie": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Mollie B.V.", + "email": "info@mollie.com" + } + ], + "description": "Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.", + "homepage": "https://github.com/mollie/mollie-api-php", + "keywords": [ + "CBC", + "api", + "bancontact", + "banktransfer", + "belfius", + "belfius direct net", + "bitcoin", + "charges", + "creditcard", + "direct debit", + "fashioncheque", + "gateway", + "gift cards", + "ideal", + "intersolve", + "kbc", + "mistercash", + "mollie", + "payment", + "payments", + "paypal", + "paysafecard", + "podiumcadeaukaart", + "recurring", + "refunds", + "sepa", + "service", + "sofort", + "sofortbanking", + "subscriptions" + ], + "time": "2017-08-22 09:24:05" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/lib/index.php b/lib/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/lib/index.php @@ -0,0 +1,11 @@ + + * @copyright Mollie B.V. + * @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php + * @category Mollie + * @package Mollie + * @link https://www.mollie.nl + */ + +if (!defined('_PS_VERSION_')) { + return; +} + +$mollie = Module::getInstanceByName('mollie'); + +if (!$mollie->active) { + return null; +} + +if (!Currency::exists('EUR', 0)) { + return null; +} + +try { + $methods = $mollie->api->methods->all(); +} catch (Mollie_API_Exception $e) { + if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ERRORS) { + Logger::addLog(__METHOD__.' said: '.$e->getMessage(), Mollie::ERROR); + } + + return null; +} + +$idealIssuers = array(); +$issuers = $mollie->getIssuerList(); +if (isset($issuers['ideal'])) { + foreach ($issuers['ideal'] as $issuer) { + $idealIssuers[$issuer->id] = $issuer->name; + } +} +Context::getContext()->smarty->assign(array( + 'idealIssuers' => $idealIssuers, +)); + +$reflection = new ReflectionClass($mollie); +$paymentOptions = array(); +foreach ($methods as $method) { + if ($method->id === 'ideal' && Configuration::get(Mollie::MOLLIE_ISSUERS) == Mollie::ISSUERS_ON_CLICK) { + $newOption = new PrestaShop\PrestaShop\Core\Payment\PaymentOption(); + $newOption + ->setCallToActionText($mollie->lang[$method->description]) + ->setAction(Context::getContext()->link->getModuleLink( + 'mollie', + 'payment', + array('method' => $method->id), + true + )) + ->setInputs(array( + 'token' => array( + 'name' => 'issuer', + 'type' => 'hidden', + 'value' => '', + ), + )) + ->setLogo($method->image->normal) + ->setAdditionalInformation($mollie->display($reflection->getFileName(), 'ideal_dropdown.tpl')) + ; + + $paymentOptions[] = $newOption; + } else { + $newOption = new PrestaShop\PrestaShop\Core\Payment\PaymentOption(); + $newOption + ->setCallToActionText($mollie->lang[$method->description]) + ->setAction(Context::getContext()->link->getModuleLink( + 'mollie', 'payment', + array('method' => $method->id), true + )) + ->setLogo($method->image->normal) + ; + + $paymentOptions[] = $newOption; + } +} + +return $paymentOptions; diff --git a/lib/vendor/autoload.php b/lib/vendor/autoload.php new file mode 100644 index 000000000..4e69b3d7f --- /dev/null +++ b/lib/vendor/autoload.php @@ -0,0 +1,7 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see http://www.php-fig.org/psr/psr-0/ + * @see http://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + // PSR-4 + private $prefixLengthsPsr4 = array(); + private $prefixDirsPsr4 = array(); + private $fallbackDirsPsr4 = array(); + + // PSR-0 + private $prefixesPsr0 = array(); + private $fallbackDirsPsr0 = array(); + + private $useIncludePath = false; + private $classMap = array(); + + private $classMapAuthoritative = false; + + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', $this->prefixesPsr0); + } + + return array(); + } + + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + } + + /** + * Unregisters this instance as an autoloader. + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return bool|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 + if ('\\' == $class[0]) { + $class = substr($class, 1); + } + + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative) { + return false; + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if ($file === null && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if ($file === null) { + // Remember that this class does not exist. + return $this->classMap[$class] = false; + } + + return $file; + } + + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { + if (0 === strpos($class, $prefix)) { + foreach ($this->prefixDirsPsr4[$prefix] as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + */ +function includeFile($file) +{ + include $file; +} diff --git a/lib/vendor/composer/LICENSE b/lib/vendor/composer/LICENSE new file mode 100644 index 000000000..1a2812488 --- /dev/null +++ b/lib/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) 2016 Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/lib/vendor/composer/autoload_classmap.php b/lib/vendor/composer/autoload_classmap.php new file mode 100644 index 000000000..df3f9dfde --- /dev/null +++ b/lib/vendor/composer/autoload_classmap.php @@ -0,0 +1,43 @@ + $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Autoloader.php', + 'Mollie_API_Client' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Client.php', + 'Mollie_API_CompatibilityChecker' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/CompatibilityChecker.php', + 'Mollie_API_Exception' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Exception.php', + 'Mollie_API_Exception_IncompatiblePlatform' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Exception/IncompatiblePlatform.php', + 'Mollie_API_Object_Customer' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Object/Customer.php', + 'Mollie_API_Object_Customer_Mandate' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Object/Customer/Mandate.php', + 'Mollie_API_Object_Customer_Subscription' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Object/Customer/Subscription.php', + 'Mollie_API_Object_Issuer' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Object/Issuer.php', + 'Mollie_API_Object_List' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Object/List.php', + 'Mollie_API_Object_Method' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Object/Method.php', + 'Mollie_API_Object_Organization' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Object/Organization.php', + 'Mollie_API_Object_Payment' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Object/Payment.php', + 'Mollie_API_Object_Payment_Refund' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Object/Payment/Refund.php', + 'Mollie_API_Object_Permission' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Object/Permission.php', + 'Mollie_API_Object_Profile' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Object/Profile.php', + 'Mollie_API_Object_Profile_APIKey' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Object/Profile/APIKey.php', + 'Mollie_API_Object_Settlement' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Object/Settlement.php', + 'Mollie_API_Resource_Base' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Base.php', + 'Mollie_API_Resource_Customers' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Customers.php', + 'Mollie_API_Resource_Customers_Mandates' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Mandates.php', + 'Mollie_API_Resource_Customers_Payments' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Payments.php', + 'Mollie_API_Resource_Customers_Subscriptions' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Subscriptions.php', + 'Mollie_API_Resource_Issuers' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Issuers.php', + 'Mollie_API_Resource_Methods' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Methods.php', + 'Mollie_API_Resource_Organizations' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Organizations.php', + 'Mollie_API_Resource_Payments' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Payments.php', + 'Mollie_API_Resource_Payments_Refunds' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Payments/Refunds.php', + 'Mollie_API_Resource_Permissions' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Permissions.php', + 'Mollie_API_Resource_Profiles' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles.php', + 'Mollie_API_Resource_Profiles_APIKeys' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles/APIKeys.php', + 'Mollie_API_Resource_Refunds' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Refunds.php', + 'Mollie_API_Resource_Settlements' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Settlements.php', + 'Mollie_API_Resource_Undefined' => $vendorDir . '/mollie/mollie-api-php/src/Mollie/API/Resource/Undefined.php', +); diff --git a/lib/vendor/composer/autoload_namespaces.php b/lib/vendor/composer/autoload_namespaces.php new file mode 100644 index 000000000..675344c66 --- /dev/null +++ b/lib/vendor/composer/autoload_namespaces.php @@ -0,0 +1,10 @@ + array($vendorDir . '/mollie/mollie-api-php/src'), +); diff --git a/lib/vendor/composer/autoload_psr4.php b/lib/vendor/composer/autoload_psr4.php new file mode 100644 index 000000000..b265c64a2 --- /dev/null +++ b/lib/vendor/composer/autoload_psr4.php @@ -0,0 +1,9 @@ += 50600 && !defined('HHVM_VERSION'); + if ($useStaticLoader) { + require_once __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInit361f7850479446367c2ae3a5a978d48c::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } + + $loader->register(true); + + return $loader; + } +} diff --git a/lib/vendor/composer/autoload_static.php b/lib/vendor/composer/autoload_static.php new file mode 100644 index 000000000..669c253f1 --- /dev/null +++ b/lib/vendor/composer/autoload_static.php @@ -0,0 +1,64 @@ + + array ( + 'Mollie' => + array ( + 0 => __DIR__ . '/..' . '/mollie/mollie-api-php/src', + ), + ), + ); + + public static $classMap = array ( + 'Mollie_API_Autoloader' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Autoloader.php', + 'Mollie_API_Client' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Client.php', + 'Mollie_API_CompatibilityChecker' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/CompatibilityChecker.php', + 'Mollie_API_Exception' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Exception.php', + 'Mollie_API_Exception_IncompatiblePlatform' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Exception/IncompatiblePlatform.php', + 'Mollie_API_Object_Customer' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Object/Customer.php', + 'Mollie_API_Object_Customer_Mandate' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Object/Customer/Mandate.php', + 'Mollie_API_Object_Customer_Subscription' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Object/Customer/Subscription.php', + 'Mollie_API_Object_Issuer' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Object/Issuer.php', + 'Mollie_API_Object_List' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Object/List.php', + 'Mollie_API_Object_Method' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Object/Method.php', + 'Mollie_API_Object_Organization' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Object/Organization.php', + 'Mollie_API_Object_Payment' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Object/Payment.php', + 'Mollie_API_Object_Payment_Refund' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Object/Payment/Refund.php', + 'Mollie_API_Object_Permission' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Object/Permission.php', + 'Mollie_API_Object_Profile' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Object/Profile.php', + 'Mollie_API_Object_Profile_APIKey' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Object/Profile/APIKey.php', + 'Mollie_API_Object_Settlement' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Object/Settlement.php', + 'Mollie_API_Resource_Base' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Base.php', + 'Mollie_API_Resource_Customers' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Customers.php', + 'Mollie_API_Resource_Customers_Mandates' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Mandates.php', + 'Mollie_API_Resource_Customers_Payments' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Payments.php', + 'Mollie_API_Resource_Customers_Subscriptions' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Subscriptions.php', + 'Mollie_API_Resource_Issuers' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Issuers.php', + 'Mollie_API_Resource_Methods' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Methods.php', + 'Mollie_API_Resource_Organizations' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Organizations.php', + 'Mollie_API_Resource_Payments' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Payments.php', + 'Mollie_API_Resource_Payments_Refunds' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Payments/Refunds.php', + 'Mollie_API_Resource_Permissions' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Permissions.php', + 'Mollie_API_Resource_Profiles' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles.php', + 'Mollie_API_Resource_Profiles_APIKeys' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles/APIKeys.php', + 'Mollie_API_Resource_Refunds' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Refunds.php', + 'Mollie_API_Resource_Settlements' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Settlements.php', + 'Mollie_API_Resource_Undefined' => __DIR__ . '/..' . '/mollie/mollie-api-php/src/Mollie/API/Resource/Undefined.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixesPsr0 = ComposerStaticInit361f7850479446367c2ae3a5a978d48c::$prefixesPsr0; + $loader->classMap = ComposerStaticInit361f7850479446367c2ae3a5a978d48c::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/lib/vendor/composer/index.php b/lib/vendor/composer/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/lib/vendor/composer/index.php @@ -0,0 +1,11 @@ +=5.2" + }, + "require-dev": { + "phpunit/phpunit": "^3.7 || ^4.8 || ^5.4" + }, + "suggest": { + "mollie/oauth2-mollie-php": "Use OAuth to authenticate with the Mollie API. This is needed for some endpoints. Visit https://mollie.com/en/docs for more information." + }, + "time": "2017-08-22 09:24:05", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Mollie": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Mollie B.V.", + "email": "info@mollie.com" + } + ], + "description": "Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.", + "homepage": "https://github.com/mollie/mollie-api-php", + "keywords": [ + "CBC", + "api", + "bancontact", + "banktransfer", + "belfius", + "belfius direct net", + "bitcoin", + "charges", + "creditcard", + "direct debit", + "fashioncheque", + "gateway", + "gift cards", + "ideal", + "intersolve", + "kbc", + "mistercash", + "mollie", + "payment", + "payments", + "paypal", + "paysafecard", + "podiumcadeaukaart", + "recurring", + "refunds", + "sepa", + "service", + "sofort", + "sofortbanking", + "subscriptions" + ] + } +] diff --git a/lib/vendor/index.php b/lib/vendor/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/lib/vendor/index.php @@ -0,0 +1,11 @@ += 5.3 ++ PHP cURL extension ++ Up-to-date OpenSSL (or other SSL/TLS toolkit) ++ SSL v3 disabled. Mollie does not support SSL v3 anymore. + +## Installation ## + +By far the easiest way to install the Mollie API client is to require it with [Composer](http://getcomposer.org/doc/00-intro.md). + + $ composer require mollie/mollie-api-php:1.9.* + + { + "require": { + "mollie/mollie-api-php": "1.9.*" + } + } + +You may also git checkout or [download all the files](https://github.com/mollie/mollie-api-php/archive/master.zip), and include the Mollie API client manually. + +## How to receive payments ## + +To successfully receive a payment, these steps should be implemented: + +1. Use the Mollie API client to create a payment with the requested amount, description and optionally, a payment method. It is important to specify a unique redirect URL where the customer is supposed to return to after the payment is completed. + +2. Immediately after the payment is completed, our platform will send an asynchronous request to the configured webhook to allow the payment details to be retrieved, so you know when exactly to start processing the customer's order. + +3. The customer returns, and should be satisfied to see that the order was paid and is now being processed. + +## Getting started ## + +Requiring the included autoloader. If you're using Composer, you can skip this step. + +```php +require "Mollie/API/Autoloader.php"; +``` + +Initializing the Mollie API client, and setting your API key. + +```php +$mollie = new Mollie_API_Client; +$mollie->setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM"); +``` + +Creating a new payment. + +```php +$payment = $mollie->payments->create(array( + "amount" => 10.00, + "description" => "My first API payment", + "redirectUrl" => "https://webshop.example.org/order/12345/", + "webhookUrl" => "https://webshop.example.org/mollie-webhook/", +)); +``` + +_After creation, the payment id is available in the `$payment->id` property. You should store this id with your order._ + +Retrieving a payment. + +```php +$payment = $mollie->payments->get($payment->id); + +if ($payment->isPaid()) +{ + echo "Payment received."; +} +``` + +### Fully integrated iDEAL payments ### + +If you want to fully integrate iDEAL payments in your web site, some additional steps are required. First, you need to +retrieve the list of issuers (banks) that support iDEAL and have your customer pick the issuer he/she wants to use for +the payment. + +Retrieve the list of issuers: + +```php +$issuers = $mollie->issuers->all(); +``` + +_`$issuers` will be a list of `Mollie_API_Object_Issuer` objects. Use the property `$id` of this object in the + API call, and the property `$name` for displaying the issuer to your customer. For a more in-depth example, see [Example 4](https://github.com/mollie/mollie-api-php/blob/master/examples/04-ideal-payment.php)._ + +Create a payment with the selected issuer: + +```php +$payment = $mollie->payments->create(array( + "amount" => 10.00, + "description" => "My first API payment", + "redirectUrl" => "https://webshop.example.org/order/12345/", + "webhookUrl" => "https://webshop.example.org/mollie-webhook/", + "method" => Mollie_API_Object_Method::IDEAL, + "issuer" => $selected_issuer_id, // e.g. "ideal_INGBNL2A" +)); +``` + +_The `links` property of the `$payment` object will contain a string `paymentUrl`, which is a URL that points directly to the online banking environment of the selected issuer._ + +### Refunding payments ### + +The API also supports refunding payments. Note that there is no confirmation and that all refunds are immediate and +definitive. Refunds are only supported for iDEAL, credit card, Bancontact/Mister Cash, SOFORT Banking, PayPal, Belfius Direct Net and bank transfer payments. Other types of payments cannot +be refunded through our API at the moment. + +```php +$payment = $mollie->payments->get($payment->id); + +// Refund € 15 of this payment +$refund = $mollie->payments->refund($payment, 15.00); +``` + +## How to use OAuth2 to connect Mollie accounts to your application? ## + +The resources `permissions`, `organizations`, `refunds`, `profiles`, `settlements` and `invoices` are only available with an OAuth2 access token. This is because an API key is linked to a website profile, and those resources are linked to an Mollie account. Visit our [API documentation](https://www.mollie.com/en/docs/oauth/overview) for more information about how to get an OAuth2 access token. For an example of how to use those resources, see [Example 8](https://github.com/mollie/mollie-api-php/blob/master/examples/08-oauth-list-profiles.php), [Example 9](https://github.com/mollie/mollie-api-php/blob/master/examples/09-oauth-list-settlements.php) and [Example 10](https://github.com/mollie/mollie-api-php/blob/master/examples/10-oauth-new-payment.php). + +## API documentation ## +If you wish to learn more about our API, please visit the [Mollie Developer Portal](https://www.mollie.com/developer/). API Documentation is available in both Dutch and English. + +## Want to help us make our API client even better? ## + +Want to help us make our API client even better? We take [pull requests](https://github.com/mollie/mollie-api-php/pulls?utf8=%E2%9C%93&q=is%3Apr), sure. But how would you like to contribute to a [technology oriented organization](https://www.mollie.com/nl/blog/post/werken-bij-mollie-als-developer/)? Mollie is hiring developers and system engineers. [Check out our vacancies](https://www.mollie.com/nl/jobs) or [get in touch](mailto:personeel@mollie.com). + +## License ## +[BSD (Berkeley Software Distribution) License](https://opensource.org/licenses/bsd-license.php). +Copyright (c) 2013-2017, Mollie B.V. + +## Support ## +Contact: [www.mollie.com](https://www.mollie.com) — info@mollie.com — +31 20 820 20 70 + ++ [More information about iDEAL via Mollie](https://www.mollie.com/ideal/) ++ [More information about credit card via Mollie](https://www.mollie.com/creditcard/) ++ [More information about Bancontact/Mister Cash via Mollie](https://www.mollie.com/mistercash/) ++ [More information about SOFORT Banking via Mollie](https://www.mollie.com/sofort/) ++ [More information about SEPA Bank transfer via Mollie](https://www.mollie.com/banktransfer/) ++ [More information about SEPA Direct debit via Mollie](https://www.mollie.com/directdebit/) ++ [More information about Bitcoin via Mollie](https://www.mollie.com/bitcoin/) ++ [More information about PayPal via Mollie](https://www.mollie.com/paypal/) ++ [More information about Belfius Direct Net via Mollie](https://www.mollie.com/belfiusdirectnet/) ++ [More information about paysafecard via Mollie](https://www.mollie.com/paysafecard/) ++ [More information about KBC/CBC via Mollie](https://www.mollie.com/kbccbc/) diff --git a/lib/vendor/mollie/mollie-api-php/composer.json b/lib/vendor/mollie/mollie-api-php/composer.json new file mode 100644 index 000000000..7b27ca35b --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/composer.json @@ -0,0 +1,35 @@ +{ + "name": "mollie/mollie-api-php", + "description": "Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.", + "homepage": "https://github.com/mollie/mollie-api-php", + "license": "BSD-2-Clause", + "authors": [ + { + "name": "Mollie B.V.", + "email": "info@mollie.com" + } + ], + "keywords": [ + "mollie", "payment", "service", "ideal", "creditcard", "mistercash", "bancontact", "sofort", "sofortbanking", + "sepa", "bitcoin", "paypal", "paysafecard", "podiumcadeaukaart", "banktransfer", "direct debit", "belfius", + "belfius direct net", "refunds", "api", "payments", "gateway", "subscriptions", "recurring", "charges", "kbc", + "cbc", "gift cards", "intersolve", "fashioncheque" + ], + "require" : { + "php": ">=5.2", + "ext-curl": "*", + "ext-json": "*", + "ext-openssl": "*" + }, + "require-dev": { + "phpunit/phpunit": "^3.7 || ^4.8 || ^5.4" + }, + "autoload": { + "psr-0": { + "Mollie": "src/" + } + }, + "suggest": { + "mollie/oauth2-mollie-php": "Use OAuth to authenticate with the Mollie API. This is needed for some endpoints. Visit https://mollie.com/en/docs for more information." + } +} diff --git a/lib/vendor/mollie/mollie-api-php/index.php b/lib/vendor/mollie/mollie-api-php/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/index.php @@ -0,0 +1,11 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Autoloader +{ + /** + * @param string $class_name + */ + public static function autoload ($class_name) + { + if (strpos($class_name, "Mollie_") === 0) + { + $file_name = str_replace("_", "/", $class_name); + $file_name = realpath(dirname(__FILE__) . "/../../{$file_name}.php"); + + if ($file_name !== false) + { + require $file_name; + } + } + } + + /** + * @return bool + */ + public static function register () + { + return spl_autoload_register(array(__CLASS__, "autoload")); + } + + /** + * @return bool + */ + public static function unregister () + { + return spl_autoload_unregister(array(__CLASS__, "autoload")); + } +} + +Mollie_API_Autoloader::register(); diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Client.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Client.php new file mode 100644 index 000000000..184201739 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Client.php @@ -0,0 +1,457 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Client +{ + /** + * Version of our client. + */ + const CLIENT_VERSION = "1.9.1"; + + /** + * Endpoint of the remote API. + */ + const API_ENDPOINT = "https://api.mollie.nl"; + + /** + * Version of the remote API. + */ + const API_VERSION = "v1"; + + const HTTP_GET = "GET"; + const HTTP_POST = "POST"; + const HTTP_DELETE = "DELETE"; + + const HTTP_STATUS_NO_CONTENT = 204; + + /** + * @var string + */ + protected $api_endpoint = self::API_ENDPOINT; + + /** + * RESTful Payments resource. + * + * @var Mollie_API_Resource_Payments + */ + public $payments; + + /** + * RESTful Payments Refunds resource. + * + * @var Mollie_API_Resource_Payments_Refunds + */ + public $payments_refunds; + + /** + * RESTful Issuers resource. + * + * @var Mollie_API_Resource_Issuers + */ + public $issuers; + + /** + * RESTful Methods resource. + * + * @var Mollie_API_Resource_Methods + */ + public $methods; + + /** + * RESTful Permissions resource. NOTE: requires OAuth access token. + * + * @var Mollie_API_Resource_Permissions + */ + public $permissions; + + /** + * RESTful Organizations resource. NOTE: requires OAuth access token. + * + * @var Mollie_API_Resource_Organizations + */ + public $organizations; + + /** + * RESTful Profiles resource. NOTE: requires OAuth access token. + * + * @var Mollie_API_Resource_Profiles + */ + public $profiles; + + /** + * RESTful refunds resource. NOTE: requires OAuth access token. + * + * If you wish to create / get / list / cancel refunds with an API key, use the payment_refunds resource + * + * @see $payments_refunds + * @var Mollie_API_Resource_Refunds + */ + public $refunds; + + /** + * RESTful Settlements resource. NOTE: requires OAuth access token. + * + * @var Mollie_API_Resource_Settlements + */ + public $settlements; + + /** + * RESTful Customers resource. + * + * @var Mollie_API_Resource_Customers + */ + public $customers; + + /** + * RESTful Customers Payments resource. + * + * @var Mollie_API_Resource_Customers_Payments + */ + public $customers_payments; + + /** + * RESTful Customers Mandates resource. + * + * @var Mollie_API_Resource_Customers_Mandates + */ + public $customers_mandates; + + /** + * RESTful Customers Subscriptions resource. + * + * @var Mollie_API_Resource_Customers_Subscriptions + */ + public $customers_subscriptions; + + /** + * @var string + */ + protected $api_key; + + /** + * True if an OAuth access token is set as API key. + * + * @var bool + */ + protected $oauth_access; + + /** + * @var array + */ + protected $version_strings = array(); + + /** + * @var resource + */ + protected $ch; + + /** + * @var string + */ + protected $pem_path; + + /** + * @var int + */ + protected $last_http_response_status_code; + + /** + * @throws Mollie_API_Exception_IncompatiblePlatform + */ + public function __construct () + { + $this->getCompatibilityChecker() + ->checkCompatibility(); + + $this->payments = new Mollie_API_Resource_Payments($this); + $this->payments_refunds = new Mollie_API_Resource_Payments_Refunds($this); + $this->issuers = new Mollie_API_Resource_Issuers($this); + $this->methods = new Mollie_API_Resource_Methods($this); + $this->customers = new Mollie_API_Resource_Customers($this); + $this->customers_payments = new Mollie_API_Resource_Customers_Payments($this); + $this->customers_mandates = new Mollie_API_Resource_Customers_Mandates($this); + $this->customers_subscriptions = new Mollie_API_Resource_Customers_Subscriptions($this); + + // OAuth2 endpoints + $this->permissions = new Mollie_API_Resource_Permissions($this); + $this->organizations = new Mollie_API_Resource_Organizations($this); + $this->refunds = new Mollie_API_Resource_Refunds($this); + $this->profiles = new Mollie_API_Resource_Profiles($this); + $this->profiles_apikeys = new Mollie_API_Resource_Profiles_APIKeys($this); + $this->settlements = new Mollie_API_Resource_Settlements($this); + + $curl_version = curl_version(); + + $this->addVersionString("Mollie/" . self::CLIENT_VERSION); + $this->addVersionString("PHP/" . phpversion()); + $this->addVersionString("cURL/" . $curl_version["version"]); + $this->addVersionString($curl_version["ssl_version"]); + + // The PEM path may be overwritten with setPemPath(). + $this->pem_path = realpath(dirname(__FILE__) . "/cacert.pem"); + } + + /** + * @param string $resource_path + * @return Mollie_API_Resource_Undefined + */ + public function __get ($resource_path) + { + $undefined_resource = new Mollie_API_Resource_Undefined($this); + $undefined_resource->setResourcePath($resource_path); + + return $undefined_resource; + } + + /** + * @param string $url + */ + public function setApiEndpoint ($url) + { + $this->api_endpoint = rtrim(trim($url), '/'); + } + + /** + * @return string + */ + public function getApiEndpoint () + { + return $this->api_endpoint; + } + + /** + * @param string $api_key The Mollie API key, starting with 'test_' or 'live_' + * @throws Mollie_API_Exception + */ + public function setApiKey ($api_key) + { + $api_key = trim($api_key); + + if (!preg_match('/^(live|test)_\w{30,}$/', $api_key)) + { + throw new Mollie_API_Exception("Invalid API key: '{$api_key}'. An API key must start with 'test_' or 'live_'."); + } + + $this->api_key = $api_key; + $this->oauth_access = FALSE; + } + + /** + * @param string $access_token OAuth access token, starting with 'access_' + * @throws Mollie_API_Exception + */ + public function setAccessToken ($access_token) + { + $access_token = trim($access_token); + + if (!preg_match('/^access_\w+$/', $access_token)) + { + throw new Mollie_API_Exception("Invalid OAuth access token: '{$access_token}'. An access token must start with 'access_'."); + } + + $this->api_key = $access_token; + $this->oauth_access = TRUE; + } + + /** + * @return bool + */ + public function usesOAuth () + { + return $this->oauth_access; + } + + /** + * @param string $version_string + */ + public function addVersionString ($version_string) + { + $this->version_strings[] = str_replace(array(" ", "\t", "\n", "\r"), '-', $version_string); + } + + /** + * Overwrite the default path to the PEM file. Should only be used by advanced users. + * + * @param string $pem_path + */ + public function setPemPath ($pem_path) + { + $this->pem_path = strval($pem_path); + } + + /** + * Perform an http call. This method is used by the resource specific classes. Please use the $payments property to + * perform operations on payments. + * + * @see $payments + * @see $isuers + * + * @param $http_method + * @param $api_method + * @param $http_body + * + * @return string + * @throws Mollie_API_Exception + * + * @codeCoverageIgnore + */ + public function performHttpCall ($http_method, $api_method, $http_body = NULL) + { + if (empty($this->api_key)) + { + throw new Mollie_API_Exception("You have not set an API key or OAuth access token. Please use setApiKey() to set the API key."); + } + + if (empty($this->ch) || !function_exists("curl_reset")) + { + /* + * Initialize a cURL handle. + */ + $this->ch = curl_init(); + } + else + { + /* + * Reset the earlier used cURL handle. + */ + curl_reset($this->ch); + } + + $url = $this->api_endpoint . "/" . self::API_VERSION . "/" . $api_method; + + curl_setopt($this->ch, CURLOPT_URL, $url); + curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, TRUE); + curl_setopt($this->ch, CURLOPT_TIMEOUT, 10); + curl_setopt($this->ch, CURLOPT_ENCODING, ""); + + $user_agent = join(' ', $this->version_strings); + + if ($this->usesOAuth()) + { + $user_agent .= " OAuth/2.0"; + } + + $request_headers = array( + "Accept: application/json", + "Authorization: Bearer {$this->api_key}", + "User-Agent: {$user_agent}", + "X-Mollie-Client-Info: " . php_uname(), + "Expect:", + ); + + curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, $http_method); + + if ($http_body !== NULL) + { + $request_headers[] = "Content-Type: application/json"; + curl_setopt($this->ch, CURLOPT_POST, 1); + curl_setopt($this->ch, CURLOPT_POSTFIELDS, $http_body); + } + + curl_setopt($this->ch, CURLOPT_HTTPHEADER, $request_headers); + curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 2); + curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, true); + + /* + * On some servers, the list of installed certificates is outdated or not present at all (the ca-bundle.crt + * is not installed). So we tell cURL which certificates we trust. + */ + curl_setopt($this->ch, CURLOPT_CAINFO, $this->pem_path); + + $body = curl_exec($this->ch); + + $this->last_http_response_status_code = (int) curl_getinfo($this->ch, CURLINFO_HTTP_CODE); + + if (curl_errno($this->ch)) + { + $message = "Unable to communicate with Mollie (".curl_errno($this->ch)."): " . curl_error($this->ch) . "."; + + $this->closeTcpConnection(); + throw new Mollie_API_Exception($message); + } + + if (!function_exists("curl_reset")) + { + /* + * Keep it open if supported by PHP, else close the handle. + */ + $this->closeTcpConnection(); + } + + return $body; + } + + /** + * Close the TCP connection to the Mollie API. + */ + private function closeTcpConnection () + { + if (is_resource($this->ch)) + { + curl_close($this->ch); + $this->ch = null; + } + } + + /** + * Close any cURL handles, if we have them. + */ + public function __destruct () + { + $this->closeTcpConnection(); + } + + /** + * @return Mollie_API_CompatibilityChecker + * @codeCoverageIgnore + */ + protected function getCompatibilityChecker () + { + static $checker = NULL; + + if (!$checker) + { + $checker = new Mollie_API_CompatibilityChecker(); + } + + return $checker; + } + + /** + * @deprecated Do not use this method, it should only be used internally + * + * @return int + */ + public function getLastHttpResponseStatusCode () + { + return $this->last_http_response_status_code; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/CompatibilityChecker.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/CompatibilityChecker.php new file mode 100644 index 000000000..2fe771f00 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/CompatibilityChecker.php @@ -0,0 +1,158 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_CompatibilityChecker +{ + /** + * @var string + */ + public static $MIN_PHP_VERSION = '5.2.0'; + + /** + * Used cURL functions + * + * @var array + */ + public static $REQUIRED_CURL_FUNCTIONS = array( + 'curl_init', + 'curl_setopt', + 'curl_exec', + 'curl_error', + 'curl_errno', + 'curl_close', + 'curl_version', + ); + + /** + * @throws Mollie_API_Exception_IncompatiblePlatform + * @return void + */ + public function checkCompatibility () + { + if (!$this->satisfiesPhpVersion()) + { + throw new Mollie_API_Exception_IncompatiblePlatform( + "The client requires PHP version >= " . self::$MIN_PHP_VERSION . ", you have " . PHP_VERSION . ".", + Mollie_API_Exception_IncompatiblePlatform::INCOMPATIBLE_PHP_VERSION + ); + } + + if (!$this->satisfiesJsonExtension()) + { + throw new Mollie_API_Exception_IncompatiblePlatform( + "PHP extension json is not enabled. Please make sure to enable 'json' in your PHP configuration.", + Mollie_API_Exception_IncompatiblePlatform::INCOMPATIBLE_JSON_EXTENSION + ); + } + + if (!$this->satisfiesCurlExtension()) + { + throw new Mollie_API_Exception_IncompatiblePlatform( + "PHP extension cURL is not enabled. Please make sure to enable 'curl' in your PHP configuration.", + Mollie_API_Exception_IncompatiblePlatform::INCOMPATIBLE_CURL_EXTENSION + ); + } + + if (!$this->satisfiesCurlFunctions()) + { + throw new Mollie_API_Exception_IncompatiblePlatform( + "This client requires the following cURL functions to be available: " . implode(', ', self::$REQUIRED_CURL_FUNCTIONS) . ". " . + "Please check that none of these functions are disabled in your PHP configuration.", + Mollie_API_Exception_IncompatiblePlatform::INCOMPATIBLE_CURL_FUNCTION + ); + } + } + + /** + * @return bool + * @codeCoverageIgnore + */ + public function satisfiesPhpVersion () + { + return (bool) version_compare(PHP_VERSION, self::$MIN_PHP_VERSION, ">="); + } + + /** + * @return bool + * @codeCoverageIgnore + */ + public function satisfiesJsonExtension () + { + // Check by extension_loaded + if (function_exists('extension_loaded') && extension_loaded('json')) + { + return TRUE; + } + elseif (function_exists('json_encode')) + { + return TRUE; + } + + return FALSE; + } + + /** + * @return bool + * @codeCoverageIgnore + */ + public function satisfiesCurlExtension () + { + // Check by extension_loaded + if (function_exists('extension_loaded') && extension_loaded('curl')) + { + return TRUE; + } + // Check by calling curl_version() + elseif (function_exists('curl_version') && curl_version()) + { + return TRUE; + } + + return FALSE; + } + + /** + * @return bool + * @codeCoverageIgnore + */ + public function satisfiesCurlFunctions () + { + foreach (self::$REQUIRED_CURL_FUNCTIONS as $curl_function) + { + if (!function_exists($curl_function)) + { + return FALSE; + } + } + + return TRUE; + } +} \ No newline at end of file diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Exception.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Exception.php new file mode 100644 index 000000000..295044750 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Exception.php @@ -0,0 +1,54 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Exception extends Exception +{ + /** + * @var string + */ + protected $_field; + + /** + * @return string + */ + public function getField () + { + return $this->_field; + } + + /** + * @param string $field + */ + public function setField ($field) + { + $this->_field = (string) $field; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Exception/IncompatiblePlatform.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Exception/IncompatiblePlatform.php new file mode 100644 index 000000000..d139112d7 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Exception/IncompatiblePlatform.php @@ -0,0 +1,38 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Exception_IncompatiblePlatform extends Mollie_API_Exception +{ + const INCOMPATIBLE_PHP_VERSION = 1000; + const INCOMPATIBLE_CURL_EXTENSION = 2000; + const INCOMPATIBLE_CURL_FUNCTION = 2500; + const INCOMPATIBLE_JSON_EXTENSION = 3000; +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Exception/index.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Exception/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Exception/index.php @@ -0,0 +1,11 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Object_Customer +{ + /** + * @var string + */ + public $resource; + + /** + * Id of the customer. + * + * @var string + */ + public $id; + + /** + * Either "live" or "test". Indicates this being a test or a live (verified) customer. + * + * @var string + */ + public $mode; + + /** + * @var string + */ + public $name; + + /** + * @var string + */ + public $email; + + /** + * @var string|null + */ + public $locale; + + /** + * @var object|mixed|null + */ + public $metadata; + + /** + * @var string[]|array + */ + public $recentlyUsedMethods; + + /** + * @var string + */ + public $createdDatetime; +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Customer/Mandate.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Customer/Mandate.php new file mode 100644 index 000000000..cd0b12caf --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Customer/Mandate.php @@ -0,0 +1,80 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Object_Customer_Mandate +{ + const STATUS_PENDING = "pending"; + const STATUS_VALID = "valid"; + const STATUS_INVALID = "invalid"; + + /** + * @var string + */ + public $resource; + + /** + * @var string + */ + public $id; + + /** + * @var string + */ + public $status; + + /** + * @var string + */ + public $method; + + /** + * @var string + */ + public $customerId; + + /** + * @var object|null + */ + public $details; + + /** + * @var string + */ + public $createdDatetime; + + /** + * @return bool + */ + public function isValid () + { + return $this->status === self::STATUS_VALID; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Customer/Subscription.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Customer/Subscription.php new file mode 100644 index 000000000..fb16121d9 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Customer/Subscription.php @@ -0,0 +1,132 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Object_Customer_Subscription +{ + const STATUS_ACTIVE = "active"; + const STATUS_PENDING = "pending"; // Waiting for a valid mandate. + const STATUS_CANCELLED = "cancelled"; + const STATUS_SUSPENDED = "suspended"; // Active, but mandate became invalid. + const STATUS_COMPLETED = "completed"; + + /** + * @var string + */ + public $resource; + + /** + * @var string + */ + public $id; + + /** + * @var string + */ + public $customerId; + + /** + * Either "live" or "test" depending on the customer's mode. + * + * @var string + */ + public $mode; + + /** + * ISO 8601 format. + * + * @var string + */ + public $createdDatetime; + + /** + * @var string + */ + public $status; + + /** + * @var string + */ + public $amount; + + /** + * @var int|null + */ + public $times; + + /** + * @var string + */ + public $interval; + + /** + * @var string + */ + public $description; + + /** + * @var string|null + */ + public $method; + + /** + * ISO 8601 format. + * + * @var string|null + */ + public $cancelledDatetime; + + /** + * Contains an optional 'webhookUrl'. + * + * @var object|null + */ + public $links; + + /** + * Returns whether the Subscription is valid or not. + * + * @return bool + */ + public function isValid () + { + return $this->status === self::STATUS_ACTIVE; + } + + /** + * Returns whether the Subscription is cancelled or not. + * + * @return bool + */ + public function isCancelled () + { + return $this->status === self::STATUS_CANCELLED; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Customer/index.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Customer/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Customer/index.php @@ -0,0 +1,11 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Object_Issuer +{ + /** + * Id of the issuer. + * + * @var string + */ + public $id; + + /** + * Name of the issuer. + * + * @var string + */ + public $name; + + /** + * The payment method this issuer belongs to. + * + * @see Mollie_API_Object_Method + * @var string + */ + public $method; +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/List.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/List.php new file mode 100644 index 000000000..f7666d8fb --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/List.php @@ -0,0 +1,54 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Object_List extends ArrayObject +{ + /** + * Total number of available objects on the Mollie platform. + * + * @var int + */ + public $totalCount; + + /** + * Numeric offset from which this list of object was created. + * + * @var int + */ + public $offset; + + /** + * Total number of retrieved objects. + * + * @var int + */ + public $count; +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Method.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Method.php new file mode 100644 index 000000000..b3a3c403d --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Method.php @@ -0,0 +1,168 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Object_Method +{ + /** + * @link https://mollie.com/ideal + */ + const IDEAL = "ideal"; + + /** + * @link https://mollie.com/paysafecard + */ + const PAYSAFECARD = "paysafecard"; + + /** + * Credit card (includes Mastercard, Maestro, Visa and American Express). + * + * @link https://mollie.com/creditcard + */ + const CREDITCARD = "creditcard"; + + /** + * Bancontact, formerly known as Mister Cash. + * + * @link https://mollie.com/mistercash + */ + const MISTERCASH = "mistercash"; + + /** + * @link https://mollie.com/sofort + */ + const SOFORT = "sofort"; + + /** + * @link https://mollie.com/banktransfer + */ + const BANKTRANSFER = "banktransfer"; + + /** + * @link https://mollie.com/directdebit + */ + const DIRECTDEBIT = "directdebit"; + + /** + * @link https://mollie.com/paypal + */ + const PAYPAL = "paypal"; + + /** + * @link https://mollie.com/bitcoin + */ + const BITCOIN = "bitcoin"; + + /** + * @link https://mollie.com/belfiusdirectnet + */ + const BELFIUS = "belfius"; + + /** + * @deprecated + * @link https://mollie.com/giftcards + */ + const PODIUMCADEAUKAART = "podiumcadeaukaart"; + + /** + * @link https://www.mollie.com/nl/kbccbc + */ + const KBC = "kbc"; + + /** + * Gift cards + */ + const GIFTCARD = "giftcard"; + + /** + * This is a special method that indicates in the API that the payment consists of several partial transactions. + * + * The individual transactions (amount, method and details) can be found in the details property of the payment. + * + * Note that you cannot use this method to create payments. + * + * @internal + */ + const STACKED = "stacked"; + + /** + * Id of the payment method. + * + * @var string + */ + public $id; + + /** + * More legible description of the payment method. + * + * @var string + */ + public $description; + + /** + * The $amount->minimum and $amount->maximum supported by this method and the used API key. + * + * @var object + */ + public $amount; + + /** + * The $image->normal and $image->bigger to display the payment method logo. + * + * @var object + */ + public $image; + + /** + * @return float|null + */ + public function getMinimumAmount () + { + if (empty($this->amount)) + { + return NULL; + } + + return (float) $this->amount->minimum; + } + + /** + * @return float|null + */ + public function getMaximumAmount () + { + if (empty($this->amount)) + { + return NULL; + } + + return (float) $this->amount->maximum; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Organization.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Organization.php new file mode 100644 index 000000000..844100033 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Organization.php @@ -0,0 +1,95 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Object_Organization +{ + /** + * Id of the organization. + * + * @var string + */ + public $id; + + /** + * @var string + */ + public $name; + + /** + * @var string + */ + public $email; + + /** + * @var string + */ + public $address; + + /** + * @var string + */ + public $postalCode; + + /** + * @var string + */ + public $city; + + /** + * @var string + */ + public $country; + + /** + * @var string + */ + public $countryCode; + + /** + * @var string + */ + public $registrationType; + + /** + * @var string + */ + public $registrationNumber; + + /** + * @var string + */ + public $registrationDatetime; + + /** + * @var string + */ + public $verifiedDatetime; +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Payment.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Payment.php new file mode 100644 index 000000000..9ab9ef504 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Payment.php @@ -0,0 +1,447 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Object_Payment +{ + /** + * The payment has just been created, no action has happened on it yet. + */ + const STATUS_OPEN = "open"; + + /** + * The payment has just been started, no final confirmation yet. + */ + const STATUS_PENDING = "pending"; + + /** + * The customer has cancelled the payment. + */ + const STATUS_CANCELLED = "cancelled"; + + /** + * The payment has expired due to inaction of the customer. + */ + const STATUS_EXPIRED = "expired"; + + /** + * The payment has been paid. + */ + const STATUS_PAID = "paid"; + + /** + * The payment has been paidout and the money has been transferred to the bank account of the merchant. + */ + const STATUS_PAIDOUT = "paidout"; + + /** + * The payment has been refunded, either through Mollie or through the payment provider (in the case of PayPal). + */ + const STATUS_REFUNDED = "refunded"; + + /** + * Some payment methods provide your customers with the ability to dispute payments which could + * ultimately lead to a chargeback. + */ + const STATUS_CHARGED_BACK = "charged_back"; + + /** + * The payment has failed. + */ + const STATUS_FAILED = "failed"; + + /** + * Recurring types. + * + * @see https://www.mollie.com/en/docs/recurring + */ + const RECURRINGTYPE_NONE = NULL; + const RECURRINGTYPE_FIRST = "first"; + const RECURRINGTYPE_RECURRING = "recurring"; + + /** + * @var string + */ + public $resource; + + /** + * Id of the payment (on the Mollie platform). + * + * @var string + */ + public $id; + + /** + * Mode of the payment, either "live" or "test" depending on the API Key that was used. + * + * @var string + */ + public $mode; + + /** + * The amount of the payment in EURO with 2 decimals. + * + * @var float + */ + public $amount; + + /** + * The amount of the payment that has been refunded to the consumer, in EURO with 2 decimals. This field will be + * NULL if the payment can not be refunded. + * + * @var float|null + */ + public $amountRefunded; + + /** + * The amount of a refunded payment that can still be refunded, in EURO with 2 decimals. This field will be + * NULL if the payment can not be refunded. + * + * For some payment methods this amount can be higher than the payment amount. This is possible to reimburse + * the costs for a return shipment to your customer for example. + * + * @var float|null + */ + public $amountRemaining; + + /** + * Description of the payment that is shown to the customer during the payment, and + * possibly on the bank or credit card statement. + * + * @var string + */ + public $description; + + /** + * If method is empty/null, the customer can pick his/her preferred payment method. + * + * @see Mollie_API_Object_Method + * @var string|null + */ + public $method; + + /** + * The status of the payment. + * + * @var string + */ + public $status = self::STATUS_OPEN; + + /** + * The period after which the payment will expire in ISO-8601 format. + * + * @example P12DT11H30M45S (12 days, 11 hours, 30 minutes and 45 seconds) + * @var string|null + */ + public $expiryPeriod; + + /** + * Date and time the payment was created in ISO-8601 format. + * + * @example "2013-12-25T10:30:54.0Z" + * @var string|null + */ + public $createdDatetime; + + /** + * Date and time the payment was paid in ISO-8601 format. + * + * @var string|null + */ + public $paidDatetime; + + /** + * Date and time the payment was cancelled in ISO-8601 format. + * + * @var string|null + */ + public $cancelledDatetime; + + /** + * Date and time the payment was cancelled in ISO-8601 format. + * + * @var string|null + */ + public $expiredDatetime; + + /** + * The profile ID this payment belongs to. + * + * @example pfl_xH2kP6Nc6X + * @var string + */ + public $profileId; + + /** + * The customer ID this payment is performed by. + * + * @example cst_51EkUqla3 + * @var string|null + */ + public $customerId; + + /** + * Either "first", "recurring", or NULL for regular payments. + * + * @var string|null + */ + public $recurringType; + + /** + * The mandate ID this payment is performed with. + * + * @example mdt_pXm1g3ND + * @var string|null + */ + public $mandateId; + + /** + * The subscription ID this payment belongs to. + * + * @example sub_rVKGtNd6s3 + * @var string|null + */ + public $subscriptionId; + + /** + * The locale used for this payment. + * + * @var string|null + */ + public $locale; + + /** + * During creation of the payment you can set custom metadata that is stored with + * the payment, and given back whenever you retrieve that payment. + * + * @var object|mixed|null + */ + public $metadata; + + /** + * Details of a successfully paid payment are set here. For example, the iDEAL + * payment method will set $details->consumerName and $details->consumerAccount. + * + * @var object + */ + public $details; + + /** + * @var object + */ + public $links; + + /** + * Is this payment cancelled? + * + * @return bool + */ + public function isCancelled () + { + return $this->status == self::STATUS_CANCELLED; + } + + /** + * Is this payment expired? + * + * @return bool + */ + public function isExpired () + { + return $this->status == self::STATUS_EXPIRED; + } + + /** + * Is this payment still open / ongoing? + * + * @return bool + */ + public function isOpen () + { + return $this->status == self::STATUS_OPEN; + } + + /** + * Is this payment pending? + * + * @return bool + */ + public function isPending () + { + return $this->status == self::STATUS_PENDING; + } + + /** + * Is this payment paid for? + * + * @return bool + */ + public function isPaid () + { + return !empty($this->paidDatetime); + } + + /** + * Has the money been transferred to the bank account of the merchant? + * + * Note: When a payment is refunded or charged back, the status 'refunded'/'charged_back' will + * overwrite the 'paidout' status. + * + * @return bool + */ + public function isPaidOut () + { + return $this->status == self::STATUS_PAIDOUT; + } + + /** + * Is this payment (partially) refunded? + * + * @return bool + */ + public function isRefunded () + { + return $this->status == self::STATUS_REFUNDED; + } + + /** + * Is this payment charged back? + * + * @return bool + */ + public function isChargedBack () + { + return $this->status == self::STATUS_CHARGED_BACK; + } + + /** + * Is this payment failing? + * + * @return bool + */ + public function isFailed () + { + return $this->status == self::STATUS_FAILED; + } + + /** + * Check whether the 'recurringType' parameter has been defined for this payment. + * + * @return bool + */ + public function hasRecurringType () + { + return $this->hasRecurringTypeFirst() || $this->hasRecurringTypeRecurring(); + } + + /** + * Check whether 'recurringType' is set to 'first'. If a 'first' payment has been completed successfully, the + * consumer's account may be charged automatically using recurring payments. + * + * @return bool + */ + public function hasRecurringTypeFirst () + { + return $this->recurringType == self::RECURRINGTYPE_FIRST; + } + + /** + * Check whether 'recurringType' is set to 'recurring'. This type of payment is processed without involving + * the consumer. + * + * @return bool + */ + public function hasRecurringTypeRecurring () + { + return $this->recurringType == self::RECURRINGTYPE_RECURRING; + } + + /** + * Get the payment URL where the customer can complete the payment. + * + * @return string|null + */ + public function getPaymentUrl () + { + if (empty($this->links->paymentUrl)) + { + return NULL; + } + + return $this->links->paymentUrl; + } + + /** + * @return bool + */ + public function canBeRefunded () + { + return $this->amountRemaining !== NULL; + } + + /** + * @return bool + */ + public function canBePartiallyRefunded () + { + return $this->canBeRefunded(); + } + + /** + * Get the amount that is already refunded + * + * @return float + */ + public function getAmountRefunded () + { + if ($this->amountRefunded) + { + return floatval($this->amountRefunded); + } + + return 0.0; + } + + /** + * Get the remaining amount that can be refunded. For some payment methods this amount can be higher than + * the payment amount. This is possible to reimburse the costs for a return shipment to your customer for example. + * + * @return float + */ + public function getAmountRemaining () + { + if ($this->amountRemaining) + { + return floatval($this->amountRemaining); + } + + return 0.0; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Payment/Refund.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Payment/Refund.php new file mode 100644 index 000000000..396bc348b --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Payment/Refund.php @@ -0,0 +1,135 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Object_Payment_Refund +{ + /** + * The refund is queued until there is enough balance to process te refund. You can still cancel the refund. + */ + const STATUS_QUEUED = 'queued'; + + /** + * The refund will be sent to the bank on the next business day. You can still cancel the refund. + */ + const STATUS_PENDING = 'pending'; + + /** + * The refund has been sent to the bank. The refund amount will be transferred to the consumer account as soon as possible. + */ + const STATUS_PROCESSING = 'processing'; + + /** + * The refund amount has been transferred to the consumer. + */ + const STATUS_REFUNDED = 'refunded'; + + /** + * Id of the payment method. + * + * @var string + */ + public $id; + + /** + * The $amount that was refunded. + * + * @var float + */ + public $amount; + + /** + * The refund's description, if available. + * + * @var string|null + */ + public $description; + + /** + * The payment that was refunded. + * + * @var Mollie_API_Object_Payment + */ + public $payment; + + /** + * Date and time the payment was cancelled in ISO-8601 format. + * + * @var string|null + */ + public $refundedDatetime; + + /** + * The refund status + * + * @var string + */ + public $status; + + /** + * Is this refund queued? + * + * @return bool + */ + public function isQueued () + { + return $this->status == self::STATUS_QUEUED; + } + + /** + * Is this refund pending? + * + * @return bool + */ + public function isPending () + { + return $this->status == self::STATUS_PENDING; + } + + /** + * Is this refund processing? + * + * @return bool + */ + public function isProcessing () + { + return $this->status == self::STATUS_PROCESSING; + } + + /** + * Is this refund transferred to consumer? + * + * @return bool + */ + public function isTransferred () + { + return $this->status == self::STATUS_REFUNDED; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Payment/index.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Payment/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Payment/index.php @@ -0,0 +1,11 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Object_Permission +{ + /** + * Id of the permission. + * + * @var string + */ + public $id; + + /** + * Description of the permission. + * + * @var string + */ + public $description; + + /** + * Warning for the permission. + * + * @var string|NULL + */ + public $warning; + + /** + * True if this permission is granted. + * + * @var boolean + */ + public $granted; +} \ No newline at end of file diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Profile.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Profile.php new file mode 100644 index 000000000..4c2a2e09b --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Profile.php @@ -0,0 +1,109 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Object_Profile +{ + /** + * Id of the payment profile. + * + * @var string + */ + public $id; + + /** + * Either "live" or "test". Indicates this being a test or a live (verified) profile. + * + * @var string + */ + public $mode; + + /** + * @var string + */ + public $name; + + /** + * @var string + */ + public $website; + + /** + * @var string + */ + public $email; + + /** + * @var string + */ + public $phone; + + /** + * Merchant category code. + * + * @see https://www.mollie.com/en/docs/profiles#profiles-object + * @var int + */ + public $categoryCode; + + /** + * Profile status. "unverified", "verified" or "blocked". + * + * @var string + */ + public $status; + + /** + * Review object with "status" property that's either "pending" or "rejected". + * + * @see https://www.mollie.com/en/docs/profiles#profiles-object + * + * @var object|null + */ + public $review; + + /** + * @var string + */ + public $createdDatetime; + + /** + * @var string + */ + public $updatedDatetime; + + /** + * If the App owner is also owner this profile, then links may contain a link + * to the live and test API keys of this profile. + * + * @var object + */ + public $links; +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Profile/APIKey.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Profile/APIKey.php new file mode 100644 index 000000000..e45477e03 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Profile/APIKey.php @@ -0,0 +1,73 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Object_Profile_APIKey +{ + const TEST_KEY = "test"; + const LIVE_KEY = "live"; + + /** + * The mode ('live' or 'test') functions as the ID of the API key. + * + * @var string + */ + public $id; + + /** + * The API key (live_... or test_...) + * + * @var string + */ + public $key; + + /** + * The datetime at which the API key was created in ISO-8601 format. + * + * @var string + */ + public $createdDatetime; + + /** + * @return bool + */ + public function isLiveKey () + { + return $this->id == self::LIVE_KEY; + } + + /** + * @return bool + */ + public function isTestKey () + { + return $this->id == self::TEST_KEY; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Profile/index.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Profile/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/Profile/index.php @@ -0,0 +1,11 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +class Mollie_API_Object_Settlement +{ + /** + * Id of the settlement. + * + * @var string + */ + public $id; + + /** + * The settlement reference. This corresponds to an invoice that's in your Dashboard. + * + * @var string + */ + public $reference; + + /** + * Total settlement amount in euros. + * + * @var double + */ + public $amount; + + /** + * @var string + */ + public $settledDatetime; + + /** + * Revenues and costs nested per year, per month, and per payment method. + * + * @see https://www.mollie.com/en/docs/settlements#settlements-object + * @var object + */ + public $periods; + + /** + * Payment IDs that were settled (either paid out or reversed). + * + * @var string[] + */ + public $paymentIds; +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/index.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Object/index.php @@ -0,0 +1,11 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + */ +abstract class Mollie_API_Resource_Base +{ + const REST_CREATE = Mollie_API_Client::HTTP_POST; + const REST_UPDATE = Mollie_API_Client::HTTP_POST; + const REST_READ = Mollie_API_Client::HTTP_GET; + const REST_LIST = Mollie_API_Client::HTTP_GET; + const REST_DELETE = Mollie_API_Client::HTTP_DELETE; + + /** + * Default number of objects to retrieve when listing all objects. + */ + const DEFAULT_LIMIT = 50; + + /** + * @var Mollie_API_Client + */ + protected $api; + + /** + * @var string + */ + protected $resource_path; + + /** + * @var string|null + */ + protected $parent_id; + + /** + * @param Mollie_API_Client $api + */ + public function __construct(Mollie_API_Client $api) + { + $this->api = $api; + + if (empty($this->resource_path)) + { + $class_parts = explode("_", get_class($this)); + $this->resource_path = strtolower(end($class_parts)); + } + } + + /** + * @param array $filters + * @return string + * @throws Mollie_API_Exception + */ + private function buildQueryString (array $filters) + { + if (empty($filters)) + { + return ""; + } + + // Force & because of some PHP 5.3 defaults. + return "?" . http_build_query($filters, "", "&"); + } + + /** + * @param string $rest_resource + * @param $body + * @param array $filters + * @return object + * @throws Mollie_API_Exception + */ + private function rest_create($rest_resource, $body, array $filters) + { + $result = $this->performApiCall( + self::REST_CREATE, + $rest_resource . $this->buildQueryString($filters), + $body + ); + + return $this->copy($result, $this->getResourceObject()); + } + + /** + * Retrieves a single object from the REST API. + * + * @param string $rest_resource Resource name. + * @param string $id Id of the object to retrieve. + * @param array $filters + * @return object + * @throws Mollie_API_Exception + */ + private function rest_read ($rest_resource, $id, array $filters) + { + if (empty($id)) + { + throw new Mollie_API_Exception("Invalid resource id."); + } + + $id = urlencode($id); + $result = $this->performApiCall( + self::REST_READ, + "{$rest_resource}/{$id}" . $this->buildQueryString($filters) + ); + + return $this->copy($result, $this->getResourceObject()); + } + + /** + * Sends a DELETE request to a single Molle API object. + * + * @param string $rest_resource + * @param string $id + * + * @return object + * @throws Mollie_API_Exception + */ + private function rest_delete ($rest_resource, $id) + { + if (empty($id)) + { + throw new Mollie_API_Exception("Invalid resource id."); + } + + $id = urlencode($id); + $result = $this->performApiCall( + self::REST_DELETE, + "{$rest_resource}/{$id}" + ); + + if ($result === NULL) + { + return NULL; + } + + return $this->copy($result, $this->getResourceObject()); + } + + /** + * Sends a POST request to a single Molle API object to update it. + * + * @param string $rest_resource + * @param string $id + * @param string $body + * + * @return object + * @throws Mollie_API_Exception + */ + protected function rest_update ($rest_resource, $id, $body) + { + if (empty($id)) + { + throw new Mollie_API_Exception("Invalid resource id."); + } + + $id = urlencode($id); + $result = $this->performApiCall( + self::REST_UPDATE, + "{$rest_resource}/{$id}", + $body + ); + + return $this->copy($result, $this->getResourceObject()); + } + + /** + * Get a collection of objects from the REST API. + * + * @param $rest_resource + * @param int $offset + * @param int $limit + * @param array $filters + * + * @return Mollie_API_Object_List + */ + private function rest_list($rest_resource, $offset = 0, $limit = self::DEFAULT_LIMIT, array $filters) + { + $filters = array_merge(array("offset" => $offset, "count" => $limit), $filters); + + $api_path = $rest_resource . $this->buildQueryString($filters); + + $result = $this->performApiCall(self::REST_LIST, $api_path); + + /** @var Mollie_API_Object_List $collection */ + $collection = $this->copy($result, new Mollie_API_Object_List); + + foreach ($result->data as $data_result) + { + $collection[] = $this->copy($data_result, $this->getResourceObject()); + } + + return $collection; + } + + /** + * Copy the results received from the API into the PHP objects that we use. + * + * @param object $api_result + * @param object $object + * + * @return object + */ + protected function copy($api_result, $object) + { + foreach ($api_result as $property => $value) + { + $object->$property = $value; + } + + return $object; + } + + /** + * Get the object that is used by this API. Every API uses one type of object. + * + * @return object + */ + abstract protected function getResourceObject(); + + /** + * Create a resource with the remote API. + * + * @param array $data An array containing details on the resource. Fields supported depend on the resource created. + * @param array $filters + * + * @return object + * @throws Mollie_API_Exception + */ + public function create(array $data = array(), array $filters = array()) + { + $encoded = json_encode($data); + + if (version_compare(phpversion(), "5.3.0", ">=")) + { + if (json_last_error() != JSON_ERROR_NONE) + { + throw new Mollie_API_Exception("Error encoding parameters into JSON: '" . json_last_error() . "'."); + } + } + else + { + if ($encoded === FALSE) + { + throw new Mollie_API_Exception("Error encoding parameters into JSON."); + } + } + + return $this->rest_create($this->getResourcePath(), $encoded, $filters); + } + + /** + * Retrieve information on a single resource from Mollie. + * + * Will throw a Mollie_API_Exception if the resource cannot be found. + * + * @param string $resource_id + * @param array $filters + * + * @return object + * @throws Mollie_API_Exception + */ + public function get ($resource_id, array $filters = array()) + { + return $this->rest_read($this->getResourcePath(), $resource_id, $filters); + } + + /** + * Delete a single resource from Mollie. + * + * Will throw a Mollie_API_Exception if the resource cannot be found. + * + * @param string $resource_id + * + * @return object + * @throws Mollie_API_Exception + */ + public function delete ($resource_id) + { + return $this->rest_delete($this->getResourcePath(), $resource_id); + } + + /** + * Retrieve all objects of a certain resource. + * + * @param int $offset + * @param int $limit + * @param array $filters + * + * @return Mollie_API_Object_List + */ + public function all ($offset = 0, $limit = 0, array $filters = array()) + { + return $this->rest_list($this->getResourcePath(), $offset, $limit, $filters); + } + + /** + * Perform an API call, and interpret the results and convert them to correct objects. + * + * @param $http_method + * @param $api_method + * @param null $http_body + * + * @return object + * @throws Mollie_API_Exception + */ + protected function performApiCall($http_method, $api_method, $http_body = NULL) + { + $body = $this->api->performHttpCall($http_method, $api_method, $http_body); + + if ($this->api->getLastHttpResponseStatusCode() == Mollie_API_Client::HTTP_STATUS_NO_CONTENT) + { + return NULL; + } + + if (empty($body)) + { + throw new Mollie_API_Exception("Unable to decode Mollie response: '{$body}'."); + } + + $object = @json_decode($body); + + if (json_last_error() != JSON_ERROR_NONE) + { + throw new Mollie_API_Exception("Unable to decode Mollie response: '{$body}'."); + } + + if (!empty($object->error)) + { + $exception = new Mollie_API_Exception("Error executing API call ({$object->error->type}): {$object->error->message}."); + + if (!empty($object->error->field)) + { + $exception->setField($object->error->field); + } + + throw $exception; + } + + return $object; + } + + /** + * @param string $resource_path + */ + public function setResourcePath ($resource_path) + { + $this->resource_path = strtolower($resource_path); + } + + /** + * @return string + * @throws Mollie_API_Exception + */ + public function getResourcePath () + { + if (strpos($this->resource_path, "_") !== FALSE) + { + list($parent_resource, $child_resource) = explode("_", $this->resource_path, 2); + + if (!strlen($this->parent_id)) + { + throw new Mollie_API_Exception("Subresource '{$this->resource_path}' used without parent '$parent_resource' ID."); + } + + return "$parent_resource/{$this->parent_id}/$child_resource"; + } + + return $this->resource_path; + } + + /** + * @param string $parent_id + * @return $this + */ + public function withParentId ($parent_id) + { + $this->parent_id = $parent_id; + + return $this; + } + + /** + * Set the resource to use a certain parent. Use this method before performing a get() or all() call. + * + * @param Mollie_API_Object_Payment|object $parent An object with an 'id' property + * @return $this + */ + public function with ($parent) + { + return $this->withParentId($parent->id); + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers.php new file mode 100644 index 000000000..ad70e200a --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers.php @@ -0,0 +1,65 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method Mollie_API_Object_Customer[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method Mollie_API_Object_Customer get($id, array $filters = array()) + * @method Mollie_API_Object_Customer create(array $data, array $filters = array()) + */ +class Mollie_API_Resource_Customers extends Mollie_API_Resource_Base +{ + /** + * @param Mollie_API_Object_Customer $customer + * + * @return Mollie_API_Object_Customer + */ + public function update (Mollie_API_Object_Customer $customer) + { + $body = json_encode(array( + "name" => $customer->name, + "email" => $customer->email, + "locale" => $customer->locale, + "metadata" => $customer->metadata, + )); + + /** @var Mollie_API_Object_Customer $updated_customer */ + $updated_customer = $this->rest_update($this->getResourcePath(), $customer->id, $body); + + return $updated_customer; + } + + /** + * @return Mollie_API_Object_Customer + */ + protected function getResourceObject () + { + return new Mollie_API_Object_Customer; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Mandates.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Mandates.php new file mode 100644 index 000000000..8cf5c6ab6 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Mandates.php @@ -0,0 +1,51 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method Mollie_API_Object_Customer_Mandate[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method Mollie_API_Object_Customer_Mandate get($mandate_id, array $filters = array()) + * @method Mollie_API_Object_Customer_Mandate create(array $data, array $filters = array()) + * @method Mollie_API_Object_Customer_Mandate delete($mandate_id) + */ +class Mollie_API_Resource_Customers_Mandates extends Mollie_API_Resource_Base +{ + /** + * @var string + */ + protected $resource_path = "customers_mandates"; + + /** + * @return Mollie_API_Object_Customer_Mandate + */ + protected function getResourceObject () + { + return new Mollie_API_Object_Customer_Mandate; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Payments.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Payments.php new file mode 100644 index 000000000..df02efd88 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Payments.php @@ -0,0 +1,41 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method Mollie_API_Object_Payment[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method Mollie_API_Object_Payment create(array $data, array $filters = array()) + */ +class Mollie_API_Resource_Customers_Payments extends Mollie_API_Resource_Payments +{ + /** + * @var string + */ + protected $resource_path = "customers_payments"; +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Subscriptions.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Subscriptions.php new file mode 100644 index 000000000..b8d763e11 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/Subscriptions.php @@ -0,0 +1,64 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method Mollie_API_Object_Customer_Subscription[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method Mollie_API_Object_Customer_Subscription get($subscription_id, array $filters = array()) + * @method Mollie_API_Object_Customer_Subscription create(array $data = array(), array $filters = array()) + * @method Mollie_API_Object_Customer_Subscription delete($subscription_id) + */ +class Mollie_API_Resource_Customers_Subscriptions extends Mollie_API_Resource_Base +{ + /** + * @var string + */ + protected $resource_path = "customers_subscriptions"; + + /** + * @return Mollie_API_Object_Customer_Subscription + */ + protected function getResourceObject () + { + return new Mollie_API_Object_Customer_Subscription; + } + + /** + * Cancel the given Subscription. This is just an alias of the 'delete' method. + * + * @param string $subscription_id + * + * @return Mollie_API_Object_Customer_Subscription + * @throws Mollie_API_Exception + */ + public function cancel ($subscription_id) + { + return $this->delete($subscription_id); + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/index.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Customers/index.php @@ -0,0 +1,11 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method Mollie_API_Object_Issuer[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method Mollie_API_Object_Issuer get($id, array $filters = array()) + */ +class Mollie_API_Resource_Issuers extends Mollie_API_Resource_Base +{ + /** + * @return Mollie_API_Object_Issuer + */ + protected function getResourceObject () + { + return new Mollie_API_Object_Issuer; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Methods.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Methods.php new file mode 100644 index 000000000..bacafc1af --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Methods.php @@ -0,0 +1,44 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method Mollie_API_Object_Method[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method Mollie_API_Object_Method get($id, array $filters = array()) + */ +class Mollie_API_Resource_Methods extends Mollie_API_Resource_Base +{ + /** + * @return Mollie_API_Object_Method + */ + protected function getResourceObject () + { + return new Mollie_API_Object_Method; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Organizations.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Organizations.php new file mode 100644 index 000000000..eee7634cb --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Organizations.php @@ -0,0 +1,57 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method Mollie_API_Object_Organization[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method Mollie_API_Object_Organization get($id, array $filters = array()) + */ +class Mollie_API_Resource_Organizations extends Mollie_API_Resource_Base +{ + /** + * @return Mollie_API_Object_Organization + */ + protected function getResourceObject () + { + return new Mollie_API_Object_Organization; + } + + /** + * Retrieve information on the currently logged in organization. + * + * Will throw a Mollie_API_Exception if the resource cannot be found. + * + * @return Mollie_API_Object_Organization + * @throws Mollie_API_Exception + */ + public function me () + { + return $this->get('me'); + } +} \ No newline at end of file diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Payments.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Payments.php new file mode 100644 index 000000000..3b6ba30a3 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Payments.php @@ -0,0 +1,116 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method Mollie_API_Object_Payment[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method Mollie_API_Object_Payment create(array $data, array $filters = array()) + */ +class Mollie_API_Resource_Payments extends Mollie_API_Resource_Base +{ + /** + * @var string + */ + const RESOURCE_ID_PREFIX = 'tr_'; + + /** + * @return Mollie_API_Object_Payment + */ + protected function getResourceObject () + { + return new Mollie_API_Object_Payment; + } + + /** + * Retrieve a single payment from Mollie. + * + * Will throw a Mollie_API_Exception if the payment id is invalid or the resource cannot be found. + * + * @param string $payment_id + * @param array $filters + * @return Mollie_API_Object_Payment + * @throws Mollie_API_Exception + */ + public function get ($payment_id, array $filters = array()) + { + if (empty($payment_id) || strpos($payment_id, self::RESOURCE_ID_PREFIX) !== 0) + { + throw new Mollie_API_Exception("Invalid payment ID: '{$payment_id}'. A payment ID should start with '" . self::RESOURCE_ID_PREFIX . "'."); + } + + return parent::get($payment_id, $filters); + } + + /** + * Issue a refund for the given payment. + * + * The $filters parameter may either be an array of endpoint parameters, a float value to + * initiate a partial refund, or empty to do a full refund. + * + * @param Mollie_API_Object_Payment $payment + * @param array|float|NULL $filters + * + * @return Mollie_API_Object_Payment_Refund + */ + public function refund (Mollie_API_Object_Payment $payment, $filters = array()) + { + $resource = "{$this->getResourcePath()}/" . urlencode($payment->id) . "/refunds"; + + if (!is_array($filters)) + { + if ((is_numeric($filters))) { + // $filters is numeric, so it must be an amount + $filters = array('amount' => $filters); + } + else + { + // $filters is not an array, but also not an amount, so reset $filters + $filters = array(); + } + } + + $body = NULL; + if (count($filters) > 0) + { + $body = json_encode($filters); + } + + $result = $this->performApiCall(self::REST_CREATE, $resource, $body); + + /* + * Update the payment with the new properties that we got from the refund. + */ + if (!empty($result->payment)) + { + $this->copy($result->payment, $payment); + } + + return $this->copy($result, new Mollie_API_Object_Payment_Refund); + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Payments/Refunds.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Payments/Refunds.php new file mode 100644 index 000000000..9c9ddfedf --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Payments/Refunds.php @@ -0,0 +1,64 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method Mollie_API_Object_Payment_Refund[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method Mollie_API_Object_Payment_Refund get($refund_id, array $filters = array()) + * @method Mollie_API_Object_Payment_Refund create(array $data = array(), array $filters = array()) + * @method Mollie_API_Object_Payment_Refund delete($refund_id) + */ +class Mollie_API_Resource_Payments_Refunds extends Mollie_API_Resource_Base +{ + /** + * @var string + */ + protected $resource_path = "payments_refunds"; + + /** + * @return Mollie_API_Object_Payment_Refund + */ + protected function getResourceObject () + { + return new Mollie_API_Object_Payment_Refund; + } + + /** + * Cancel the given Refund. This is just an alias of the 'delete' method. + * + * @param string $refund_id + * + * @return Mollie_API_Object_Payment_Refund + * @throws Mollie_API_Exception + */ + public function cancel ($refund_id) + { + return $this->delete($refund_id); + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Payments/index.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Payments/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Payments/index.php @@ -0,0 +1,11 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method Mollie_API_Object_Permission[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method Mollie_API_Object_Permission get($id, array $filters = array()) + */ +class Mollie_API_Resource_Permissions extends Mollie_API_Resource_Base +{ + /** + * @return Mollie_API_Object_Permission + */ + protected function getResourceObject () + { + return new Mollie_API_Object_Permission; + } + + /** + * Returns true if the requested permission is granted, false otherwise. + * + * @param string $permission_id + * @return bool + */ + public function isGranted ($permission_id) + { + $permission = $this->get($permission_id); + + if ($permission && $permission->granted) + { + return TRUE; + } + + return FALSE; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles.php new file mode 100644 index 000000000..cefc1a928 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles.php @@ -0,0 +1,68 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method Mollie_API_Object_Profile[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method Mollie_API_Object_Profile get($profile_id, array $filters = array()) + * @method Mollie_API_Object_Profile create(array $data = array(), array $filters = array()) + * @method Mollie_API_Object_Profile delete($profile_id0) + */ +class Mollie_API_Resource_Profiles extends Mollie_API_Resource_Base +{ + /** + * @return Mollie_API_Object_Profile + */ + protected function getResourceObject () + { + return new Mollie_API_Object_Profile; + } + + /** + * @param Mollie_API_Object_Profile $profile + * + * @return Mollie_API_Object_Profile + */ + public function update (Mollie_API_Object_Profile $profile) + { + $body = json_encode(array( + "name" => $profile->name, + "website" => $profile->website, + "email" => $profile->email, + "phone" => $profile->phone, + "categoryCode" => $profile->categoryCode, + "mode" => $profile->mode + )); + + /** @var Mollie_API_Object_Profile $updated_profile */ + $updated_profile = $this->rest_update($this->getResourcePath(), $profile->id, $body); + + return $updated_profile; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles/APIKeys.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles/APIKeys.php new file mode 100644 index 000000000..9c453de86 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles/APIKeys.php @@ -0,0 +1,63 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method Mollie_API_Object_Profile_APIKey[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method Mollie_API_Object_Profile_APIKey get($mode, array $filters = array()) + */ +class Mollie_API_Resource_Profiles_APIKeys extends Mollie_API_Resource_Base +{ + /** + * @var string + */ + protected $resource_path = "profiles_apikeys"; + + /** + * @return Mollie_API_Object_Profile_APIKey + */ + protected function getResourceObject () + { + return new Mollie_API_Object_Profile_APIKey; + } + + /** + * @param string $mode + * + * @return Mollie_API_Object_Profile_APIKey + */ + public function reset ($mode) + { + /** @var Mollie_API_Object_Profile_APIKey $updated_api_key */ + $updated_api_key = $this->rest_update($this->getResourcePath(), $mode, ''); + + return $updated_api_key; + } + +} \ No newline at end of file diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles/index.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Profiles/index.php @@ -0,0 +1,11 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method Mollie_API_Object_Payment_Refund[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method Mollie_API_Object_Payment_Refund get($refund_id, array $filters = array()) + */ +class Mollie_API_Resource_Refunds extends Mollie_API_Resource_Base +{ + /** + * @var string + */ + protected $resource_path = "refunds"; + + /** + * @return Mollie_API_Object_Payment_Refund + */ + protected function getResourceObject () + { + return new Mollie_API_Object_Payment_Refund; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Settlements.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Settlements.php new file mode 100644 index 000000000..bd7d85716 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Settlements.php @@ -0,0 +1,44 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method Mollie_API_Object_Settlement[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method Mollie_API_Object_Settlement get($settlement_id, array $filters = array()) + */ +class Mollie_API_Resource_Settlements extends Mollie_API_Resource_Base +{ + /** + * @return Mollie_API_Object_Settlement + */ + protected function getResourceObject () + { + return new Mollie_API_Object_Settlement; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Undefined.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Undefined.php new file mode 100644 index 000000000..f88d662a9 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/Undefined.php @@ -0,0 +1,44 @@ + + * @copyright Mollie B.V. + * @link https://www.mollie.com + * + * @method stdClass[]|Mollie_API_Object_List all($offset = 0, $limit = 0, array $filters = array()) + * @method stdClass get($id, array $filters = array()) + */ +class Mollie_API_Resource_Undefined extends Mollie_API_Resource_Base +{ + /** + * @return stdClass + */ + protected function getResourceObject () + { + return new stdClass; + } +} diff --git a/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/index.php b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/lib/vendor/mollie/mollie-api-php/src/Mollie/API/Resource/index.php @@ -0,0 +1,11 @@ +qBCq`=Yi#|oqo;_dSQEOC;;<%WI$+H?l%pffw z77!~)D@YsSY~a{H*+ARDwIkjRemfEzNOT~{f#eRPII+ZurA{oriOf!{=tNc*L|w@4 z#>#H2bAfR~;X#Q9sy-a_qQ;9uUK|;~(E*%#jMGnW)`yGF(ex7LSFpTBhaXNqZusGP zhg-ww8Ak62?u_E@DBQ6I;10kOz`ZftAH#zn`hpmm!i#TsJB^X=2>d{B2JdGuK7)x_ zOoZ_%j4xq)jX8&@IfQ;96v1=^vkQnUVm^w6C>Epm9YypH{x56h>9|BvOE!}j|DF)u z_$6*#eS^O7iow`)_1bk)v$@4$ZEdsJ+Z}p}O679uC_06vtaQ#EwQ5sx!g~3RZEG#G zyi&um+Fi0@X0Rle-%Lxj>|SM=X8%6L_B=VG*hrhwcC(eM_~|=!x&k3jq+qtDnKDZ& z7{aAjAE=h}a5fa>XPC0eDrB6eA)UUQUrn)-{pWpEjkQ~7ftdMx>~cersPIC+T8xrc`y_P)8T LbCo|5@=5VuyX=aZ literal 0 HcmV?d00001 diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..0092ec331f0698ea252e828227b58ed3f9a3d8cc GIT binary patch literal 1454 zcmeAS@N?(olHy`uVBq!ia0vp^MIg+<1|<9Mw$=hEwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&pI!QI1K^noxSJfva082=6tr?fB)~?;{4+u zDg_j}u^%L2WJmbq2zV2sLIxbM!tOcg%$bq?QMf20a5dldQQ*mld8|57hRai2Ba zpu_c0z(?i5pHK@+u6F%{FG3QZuRkRG@^)iQrR<(E`J5f%SxN~!D$FzfhA1Q}q`Z0m znA7@(_5bF%dj;nE8NM(+AAg_W{MyEERV#X%%y0kmJ($O zi|ZxxWSa*^(|&vijEH9a_~cH`tgcT2bM|t{%Qn6DKU886p5!fCvdt-5R%Mcz#@zJ1 z=}X_eYQ4KW(J0VDb4P;9HJ1msbvG1Rs{FC`F=nfBdvJBHfk`I2b4mUEsklYsd)j`%~ zvy|1ljVnJt^Wd)jd_F)vBAoZG^Y&#oCo~odfBRVP{^nO{C6AfOf#%Y%b*GnnX0BMx z$~W(HPHohb(Cku{f0cLl9@r_;es2E4*E#~TtTnIcx6ArFC%(ha-9~tnB+; z-Xzz@H>sC9zhCiHz-Xnq=M9J8r@a~Xs|3D%)!*R!_@?dM-2I3D8RxAuo7i&J_ld2_ z-kRlC&-#|lKK*pg=TmVzWc=&j+%T=k?7z$4A^x(Cf%mDIX#F4YIdY}d`nRhSK4ewR zwEGZXTX}!i>GdZVtfVf@&v#d4z0qN1P0qn9ch@%Zv(uT5c?FMF~eO!~*7Y}>i_-%OIZ_1&kl`%B|G$4hasa-Ea!#%8en z+mZ3U%)40Pq{8lRzmLDE-MmuI$KAGix0l_?|NF19zH6R#`MSoFZ{3PppDk@(#`0@H sl6&ZC(#x0$9>}E)sN7L<{rJf~P%FGdH1^9qV9Cnh>FVdQ&MBb@0G}n8(EtDd literal 0 HcmV?d00001 diff --git a/mollie.php b/mollie.php new file mode 100644 index 000000000..55c24a0a9 --- /dev/null +++ b/mollie.php @@ -0,0 +1,1128 @@ + + * @copyright Mollie B.V. + * @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php + * @category Mollie + * @package Mollie + * @link https://www.mollie.nl + */ + +require_once(dirname(__FILE__).'/lib/vendor/autoload.php'); + +if (!defined('_PS_VERSION_')) { + return; +} + +/** + * Class Mollie + */ +class Mollie extends PaymentModule +{ + /** @var Mollie_API_Client|null */ + public $api = null; + public $statuses = array(); + public $lang = array(); + + const NOTICE = 1; + const WARNING = 2; + const ERROR = 3; + const CRASH = 4; + + const NAME = 'mollie'; + + const PAYMENTSCREEN_LOCALE_BROWSER_LOCALE = 'browser_locale'; + const PAYMENTSCREEN_LOCALE_SEND_WEBSITE_LOCALE = 'website_locale'; + + const LOGOS_BIG = 'big'; + const LOGOS_NORMAL = 'normal'; + const LOGOS_HIDE = 'hide'; + + const ISSUERS_ON_CLICK = 'on-click'; + const ISSUERS_OWN_PAGE = 'own-page'; + const ISSUERS_PAYMENT_PAGE = 'payment-page'; + + const DEBUG_LOG_NONE = 0; + const DEBUG_LOG_ERRORS = 1; + const DEBUG_LOG_ALL = 2; + + const MOLLIE_API_KEY = 'MOLLIE_API_KEY'; + const MOLLIE_DESCRIPTION = 'MOLLIE_DESCRIPTION'; + const MOLLIE_PAYMENTSCREEN_LOCALE = 'MOLLIE_PAYMENTSCREEN_LOCALE'; + const MOLLIE_IMAGES = 'MOLLIE_IMAGES'; + const MOLLIE_ISSUERS = 'MOLLIE_ISSUERS'; + const MOLLIE_CSS = 'MOLLIE_CSS'; + const MOLLIE_DEBUG_LOG = 'MOLLIE_DEBUG_LOG'; + const MOLLIE_CREDENTIALS = 'MOLLIE_CREDENTIALS'; + const MOLLIE_DISPLAY_ERRORS = 'MOLLIE_DISPLAY_ERRORS'; + const MOLLIE_USE_PROFILE_WEBHOOK = 'MOLLIE_USE_PROFILE_WEBHOOK'; + const MOLLIE_PENDING = 'MOLLIE_PENDING'; + const MOLLIE_STATUS_OPEN = 'MOLLIE_STATUS_OPEN'; + const MOLLIE_STATUS_PAID = 'MOLLIE_STATUS_PAID'; + const MOLLIE_STATUS_CANCELLED = 'MOLLIE_STATUS_CANCELLED'; + const MOLLIE_STATUS_EXPIRED = 'MOLLIE_STATUS_EXPIRED'; + const MOLLIE_STATUS_REFUNDED = 'MOLLIE_STATUS_REFUNDED'; + const MOLLIE_MAIL_WHEN_OPEN = 'MOLLIE_MAIL_WHEN_OPEN'; + const MOLLIE_MAIL_WHEN_PAID = 'MOLLIE_MAIL_WHEN_PAID'; + const MOLLIE_MAIL_WHEN_CANCELLED = 'MOLLIE_MAIL_WHEN_CANCELLED'; + const MOLLIE_MAIL_WHEN_EXPIRED = 'MOLLIE_MAIL_WHEN_EXPIRED'; + const MOLLIE_MAIL_WHEN_REFUNDED = 'MOLLIE_MAIL_WHEN_REFUNDED'; + + /** + * Hooks for this module + * + * @var array $hooks + */ + public $hooks = array( + 'displayPayment', + 'displayPaymentEU', + 'paymentOptions', + 'displayAdminOrder', + 'displayHeader', + 'displayBackOfficeHeader', + 'displayOrderConfirmation', + ); + + /** @var array $methods */ + public static $methods = array( + 'banktransfer' => 'Bank', + 'belfius ' => 'Belfius', + 'bitcoin ' => 'Bitcoin', + 'creditcard' => 'Credit Card', + 'directdebit' => 'Direct Debit', + 'giftcard' => 'Giftcard', + 'ideal' => 'iDEAL', + 'inghomepay ' => 'ING Homepay', + 'kbc' => 'KBC', + 'mistercash' => 'Bancontact', + 'paypal' => 'PayPal', + 'paysafecard' => 'Paysafecard', + 'sofort' => 'Sofort Banking', + ); + + /** + * Mollie constructor. + * + * @throws PrestaShopException + */ + public function __construct() + { + $this->name = 'mollie'; + $this->tab = 'payments_gateways'; + $this->version = '2.0.0'; + $this->author = 'Mollie B.V.'; + $this->need_instance = 1; + $this->bootstrap = true; + + parent::__construct(); + + $this->displayName = $this->l('Mollie Payment Module'); + $this->description = $this->l('Mollie Payments'); + + $this->confirmUninstall = $this->l('Are you sure you want to uninstall the Mollie Payment Module?'); + + $this->controllers = array('payment', 'return', 'webhook'); + + try { + $this->api = new Mollie_API_Client; + if (Configuration::get(Mollie::MOLLIE_API_KEY)) { + $this->api->setApiKey(Configuration::get(Mollie::MOLLIE_API_KEY)); + } + if (defined('_TB_VERSION_')) { + $this->api->addVersionString('ThirtyBees/'._TB_VERSION_); + $this->api->addVersionString("MollieThirtyBees/{$this->version}"); + } else { + $this->api->addVersionString('PrestaShop/'._PS_VERSION_); + $this->api->addVersionString("MolliePrestaShop/{$this->version}"); + } + + } catch (Mollie_API_Exception_IncompatiblePlatform $e) { + Logger::addLog(__METHOD__.' - System incompatible: '.$e->getMessage(), Mollie::CRASH); + } catch (Mollie_API_Exception $e) { + $this->warning = $this->l('Payment error:').$e->getMessage(); + Logger::addLog(__METHOD__.' said: '.$this->warning, Mollie::CRASH); + } + + $this->statuses = array( + Mollie_API_Object_Payment::STATUS_PAID => Configuration::get(Mollie::MOLLIE_STATUS_PAID), + Mollie_API_Object_Payment::STATUS_CANCELLED => Configuration::get(Mollie::MOLLIE_STATUS_CANCELLED), + Mollie_API_Object_Payment::STATUS_EXPIRED => Configuration::get(Mollie::MOLLIE_STATUS_EXPIRED), + Mollie_API_Object_Payment::STATUS_REFUNDED => Configuration::get(Mollie::MOLLIE_STATUS_REFUNDED), + Mollie_API_Object_Payment::STATUS_OPEN => Configuration::get(Mollie::MOLLIE_STATUS_OPEN), + ); + + // Load all translatable text here so we have a single translation point + $this->lang = array( + Mollie_API_Object_Payment::STATUS_PAID => $this->l('paid'), + Mollie_API_Object_Payment::STATUS_CANCELLED => $this->l('cancelled'), + Mollie_API_Object_Payment::STATUS_EXPIRED => $this->l('expired'), + Mollie_API_Object_Payment::STATUS_REFUNDED => $this->l('refunded'), + Mollie_API_Object_Payment::STATUS_OPEN => $this->l('bankwire pending'), + 'This payment method is not available.' => $this->l('This payment method is not available.'), + 'Click here to continue' => $this->l('Click here to continue'), + 'This payment method is only available for Euros.' => $this->l('This payment method is only available for Euros.'), + 'There was an error while processing your request: ' => $this->l('There was an error while processing your request: '), + 'The order with this id does not exist.' => $this->l('The order with this id does not exist.'), + 'We have not received a definite payment status. You will be notified as soon as we receive a confirmation of the bank/merchant.' => $this->l('We have not received a definite payment status. You will be notified as soon as we receive a confirmation of the bank/merchant.'), + 'Unfortunately your payment was expired.' => $this->l('Unfortunately your payment was expired.'), + 'Thank you. Your payment has been received.' => $this->l('Thank you. Your payment has been received.'), + 'The transaction has an unexpected status.' => $this->l('The transaction has an unexpected status.'), + 'You are not authorised to see this page.' => $this->l('You are not authorised to see this page.'), + 'Continue shopping' => $this->l('Continue shopping'), + 'Welcome back' => $this->l('Welcome back'), + 'Select your bank:' => $this->l('Select your bank:'), + 'OK' => $this->l('OK'), + 'Different payment method' => $this->l('Different payment method'), + 'Pay with %s' => $this->l('Pay with %s'), + 'Refund this order' => $this->l('Refund this order'), + 'Mollie refund' => $this->l('Mollie refund'), + 'Refund order #%d through the Mollie API.' => $this->l('Refund order #%d through the Mollie API.'), + 'The order has been refunded!' => $this->l('The order has been refunded!'), + 'Mollie B.V. will transfer the money back to the customer on the next business day.' => $this->l('Mollie B.V. will transfer the money back to the customer on the next business day.'), + 'Awaiting Mollie payment' => $this->l('Awaiting Mollie payment'), + 'iDEAL' => $this->l('iDEAL'), + 'Credit card' => $this->l('Credit card'), + 'Bancontact' => $this->l('Bancontact'), + 'SOFORT Banking' => $this->l('SOFORT Banking'), + 'SEPA Direct Debit' => $this->l('SEPA Direct Debit'), + 'Belfius Pay Button' => $this->l('Belfius Pay Button'), + 'Bitcoin' => $this->l('Bitcoin'), + 'PODIUM Cadeaukaart' => $this->l('PODIUM Cadeaukaart'), + 'Gift cards' => $this->l('Gift cards'), + 'Bank transfer' => $this->l('Bank transfer'), + 'PayPal' => $this->l('PayPal'), + 'paysafecard' => $this->l('paysafecard'), + 'KBC/CBC Payment Button' => $this->l('KBC/CBC Payment Button'), + ); + } + + /** + * Installs the Mollie Payments Module + * + * @return bool + * + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ + public function install() + { + if (!parent::install()) { + $this->_errors[] = 'Unable to install module'; + + return false; + } + + foreach ($this->hooks as $hook) { + $this->registerHook($hook); + } + + if (!$this->pendingOrderState()) { + $this->_errors[] = 'Unable to install Mollie pending order state'; + + return false; + } + + $this->initConfig(); + + include(dirname(__FILE__).'/sql/install.php'); + + return true; + } + + /** + * @return bool + * + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ + public function uninstall() + { + foreach ($this->hooks as $hook) { + $this->unregisterHook($hook); + } + + Configuration::deleteByName(Mollie::MOLLIE_API_KEY); + Configuration::deleteByName(Mollie::MOLLIE_DESCRIPTION); + Configuration::deleteByName(Mollie::MOLLIE_PAYMENTSCREEN_LOCALE); + Configuration::deleteByName(Mollie::MOLLIE_IMAGES); + Configuration::deleteByName(Mollie::MOLLIE_ISSUERS); + Configuration::deleteByName(Mollie::MOLLIE_CSS); + Configuration::deleteByName(Mollie::MOLLIE_DEBUG_LOG); + Configuration::deleteByName(Mollie::MOLLIE_CREDENTIALS); + Configuration::deleteByName(Mollie::MOLLIE_DISPLAY_ERRORS); + Configuration::deleteByName(Mollie::MOLLIE_USE_PROFILE_WEBHOOK); + Configuration::deleteByName(Mollie::MOLLIE_PENDING); + Configuration::deleteByName(Mollie::MOLLIE_STATUS_OPEN); + Configuration::deleteByName(Mollie::MOLLIE_STATUS_PAID); + Configuration::deleteByName(Mollie::MOLLIE_STATUS_CANCELLED); + Configuration::deleteByName(Mollie::MOLLIE_STATUS_EXPIRED); + Configuration::deleteByName(Mollie::MOLLIE_STATUS_REFUNDED); + Configuration::deleteByName(Mollie::MOLLIE_MAIL_WHEN_OPEN); + Configuration::deleteByName(Mollie::MOLLIE_MAIL_WHEN_PAID); + Configuration::deleteByName(Mollie::MOLLIE_MAIL_WHEN_CANCELLED); + Configuration::deleteByName(Mollie::MOLLIE_MAIL_WHEN_EXPIRED); + Configuration::deleteByName(Mollie::MOLLIE_MAIL_WHEN_REFUNDED); + + return parent::uninstall(); + } + + + /** + * @return void + * + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ + public function reinstall() + { + foreach ($this->hooks as $hook) { + $this->unregisterHook($hook); + $this->registerHook($hook); + } + + $this->initConfig(); + } + + /** + * @return void + * + * @throws PrestaShopException + */ + protected function initConfig() + { + Configuration::updateGlobalValue(Mollie::MOLLIE_API_KEY, ''); + Configuration::updateGlobalValue(Mollie::MOLLIE_DESCRIPTION, 'Cart %'); + Configuration::updateGlobalValue(Mollie::MOLLIE_PAYMENTSCREEN_LOCALE, Mollie::PAYMENTSCREEN_LOCALE_BROWSER_LOCALE); + Configuration::updateGlobalValue(Mollie::MOLLIE_IMAGES, Mollie::LOGOS_NORMAL); + Configuration::updateGlobalValue(Mollie::MOLLIE_ISSUERS, Mollie::ISSUERS_ON_CLICK); + Configuration::updateGlobalValue(Mollie::MOLLIE_CSS, ''); + Configuration::updateGlobalValue(Mollie::MOLLIE_DEBUG_LOG, Mollie::DEBUG_LOG_ERRORS); + Configuration::updateGlobalValue(Mollie::MOLLIE_CREDENTIALS, false); + Configuration::updateGlobalValue(Mollie::MOLLIE_DISPLAY_ERRORS, false); + Configuration::updateGlobalValue(Mollie::MOLLIE_USE_PROFILE_WEBHOOK, false); + Configuration::updateGlobalValue(Mollie::MOLLIE_STATUS_OPEN, Configuration::get(Mollie::MOLLIE_PENDING)); + Configuration::updateGlobalValue(Mollie::MOLLIE_STATUS_PAID, Configuration::get('PS_OS_PAYMENT')); + Configuration::updateGlobalValue(Mollie::MOLLIE_STATUS_CANCELLED, Configuration::get('PS_OS_CANCELED')); + Configuration::updateGlobalValue(Mollie::MOLLIE_STATUS_EXPIRED, Configuration::get('PS_OS_CANCELED')); + Configuration::updateGlobalValue(Mollie::MOLLIE_STATUS_REFUNDED, Configuration::get('PS_OS_REFUND')); + Configuration::updateGlobalValue(Mollie::MOLLIE_MAIL_WHEN_PAID, true); + Configuration::updateGlobalValue(Mollie::MOLLIE_MAIL_WHEN_CANCELLED, true); + Configuration::updateGlobalValue(Mollie::MOLLIE_MAIL_WHEN_EXPIRED, true); + Configuration::updateGlobalValue(Mollie::MOLLIE_MAIL_WHEN_REFUNDED, true); + } + + /** + * @return mixed + */ + public function getErrors() + { + return $this->_errors; + } + + + /** + * @return string + * + * @throws Exception + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + * @throws SmartyException + */ + public function getContent() + { + $cookie = Context::getContext()->cookie; + $lang = isset($cookie->id_lang) ? (int) $cookie->id_lang : Configuration::get('PS_LANG_DEFAULT'); + $lang = $lang == 0 ? Configuration::get('PS_LANG_DEFAULT') : $lang; + + $updateMessage = defined('_TB_VERSION_') + ? $this->getUpdateMessage('https://github.com/mollie/thirtybees') + : $this->getUpdateMessage('https://github.com/mollie/PrestaShop'); + $resultMessage = ''; + $warningMessage = ''; + + $payscreenLocaleOptions = array( + Mollie::PAYMENTSCREEN_LOCALE_BROWSER_LOCALE => $this->l('Do not send locale, use browser language'), + Mollie::PAYMENTSCREEN_LOCALE_SEND_WEBSITE_LOCALE => $this->l('Send webshop locale'), + ); + + $imageOptions = array( + Mollie::LOGOS_BIG => $this->l('big'), + Mollie::LOGOS_NORMAL => $this->l('normal'), + Mollie::LOGOS_HIDE => $this->l('hide'), + ); + $issuerOptions = array( + Mollie::ISSUERS_ON_CLICK => $this->l('On click'), + Mollie::ISSUERS_OWN_PAGE => $this->l('Own page'), + Mollie::ISSUERS_PAYMENT_PAGE => $this->l('Payment page'), + ); + $loggerOptions = array( + Mollie::DEBUG_LOG_NONE => $this->l('Nothing'), + Mollie::DEBUG_LOG_ERRORS => $this->l('Errors'), + Mollie::DEBUG_LOG_ALL => $this->l('Everything'), + ); + + if (Tools::isSubmit('Mollie_Config_Save')) { + $resultMessage = $this->getSaveResult( + array_keys($payscreenLocaleOptions), array_keys($imageOptions), + array_keys($issuerOptions), array_keys($loggerOptions) + ); + } + + $data = array( + 'form_action' => Tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']), + 'config_title' => $this->l('Mollie Configuration'), + 'config_legend' => $this->l('Mollie Settings'), + 'update_message' => $updateMessage, + 'all_statuses' => OrderState::getOrderStates($lang), + 'payscreen_locale_options' => $payscreenLocaleOptions, + 'image_options' => $imageOptions, + 'issuer_options' => $issuerOptions, + 'logger_options' => $loggerOptions, + 'title_status' => $this->l('%s statuses:'), + 'title_visual' => $this->l('Visual settings:'), + 'title_debug' => $this->l('Debug info:'), + 'msg_result' => $resultMessage, + 'msg_warning' => $warningMessage, + 'path' => $this->_path, + 'val_api_key' => Configuration::get(Mollie::MOLLIE_API_KEY), + 'val_desc' => Configuration::get(Mollie::MOLLIE_DESCRIPTION), + 'payscreen_locale_value' => Configuration::get(Mollie::MOLLIE_PAYMENTSCREEN_LOCALE), + 'val_images' => Configuration::get(Mollie::MOLLIE_IMAGES), + 'val_issuers' => Configuration::get(Mollie::MOLLIE_ISSUERS), + 'val_css' => Configuration::get(Mollie::MOLLIE_CSS), + 'val_credentials' => Configuration::get(Mollie::MOLLIE_CREDENTIALS), + 'val_errors' => Configuration::get(Mollie::MOLLIE_DISPLAY_ERRORS), + 'val_logger' => Configuration::get(Mollie::MOLLIE_DEBUG_LOG), + 'val_save' => $this->l('Save'), + 'lang' => $this->lang, + ); + + $messageStatus = $this->l('Status for %s payments'); + $descriptionStatus = $this->l('`%s` payments get status `%s`'); + $messageMail = $this->l('Send mails when %s'); + $descriptionMail = $this->l('Send mails when transaction status becomes %s?'); + foreach ($this->statuses as $name => $val) { + $val = (int) $val; + $data['msg_status_'.$name] = sprintf($messageStatus, $this->lang[$name]); + $data['desc_status_'.$name] = Tools::strtolower( + sprintf( + $descriptionStatus, + $this->lang[$name], + Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue( + 'SELECT `name` + FROM `'._DB_PREFIX_.'order_state_lang` + WHERE `id_order_state` = '.(int) $val.' + AND `id_lang` = '.(int) $lang + ) + ) + ); + $data['val_status_'.$name] = $val; + $data['msg_mail_'.$name] = sprintf($messageMail, $this->lang[$name]); + $data['desc_mail_'.$name] = sprintf($descriptionMail, $this->lang[$name]); + $data['val_mail_'.$name] = Configuration::get('MOLLIE_MAIL_WHEN_'.Tools::strtoupper($name)); + $data['statuses'][] = $name; + } + + $this->context->smarty->assign($data); + $this->context->smarty->assign(array( + 'link' => Context::getContext()->link, + 'module_dir' => __PS_BASE_URI__.'modules/'.basename(__FILE__, '.php').'/', + )); + + return $this->display(__FILE__, 'views/templates/admin/mollie_config.tpl'); + } + + /** + * @param string $str + * + * @return string + */ + public function lang($str) + { + if (array_key_exists($str, $this->lang)) { + return $this->lang[$str]; + } + + return $str; + } + + /** + * @param int $orderId + * @param int $status + * + * @return void + * + * @throws Adapter_Exception + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ + public function setOrderStatus($orderId, $status) + { + $statusId = (int) $this->statuses[$status]; + $order = new Order((int) $orderId); + if ($statusId === (int) $order->current_state) { + return; + } + + $history = new OrderHistory(); + $history->id_order = $orderId; + $history->changeIdOrderState($statusId, $orderId, !$order->hasInvoice()); + + if (Configuration::get('MOLLIE_MAIL_WHEN_'.Tools::strtoupper($status))) { + $history->addWithemail(); + } else { + $history->add(); + } + } + + /** + * @param string $column + * @param int $id + * + * @return array + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ + + public function getPaymentBy($column, $id) + { + $paidPayment = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow( + sprintf( + 'SELECT * FROM `%s` WHERE `%s` = \'%s\' AND `bank_status` = \'%s\'', + _DB_PREFIX_.'mollie_payments', + bqSQL($column), + pSQL($id), + Mollie_API_Object_Payment::STATUS_PAID + ) + ); + + if ($paidPayment) { + return $paidPayment; + } + + $nonPaidPayment = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow( + sprintf( + 'SELECT * FROM `%s` WHERE `%s` = \'%s\' ORDER BY `created_at` DESC', + _DB_PREFIX_.'mollie_payments', + bqSQL($column), + pSQL($id) + ) + ); + + return $nonPaidPayment; + } + + /** + * @param array $payscreenLocaleOptions + * @param array $imageOptions + * @param array $issuerOptions + * @param array $loggerOptions + * + * @return string + * @throws PrestaShopException + */ + protected function getSaveResult( + array $payscreenLocaleOptions = array(), + array $imageOptions = array(), + array $issuerOptions = array(), + array $loggerOptions = array() + ) + { + $errors = array(); + + $mollieApiKey = Tools::getValue('Mollie_Api_Key'); + + if (!empty($mollieApiKey) && strpos($mollieApiKey, 'live') !== 0 && strpos($mollieApiKey, 'test') !== 0) { + $errors[] = $this->l('The API key needs to start with test or live.'); + } + + $mollieDescription = Tools::getValue('Mollie_Description'); + + $molliePaymentscreenLocale = Tools::getValue('Mollie_Paymentscreen_Locale'); + + if (!in_array($molliePaymentscreenLocale, $payscreenLocaleOptions)) { + $errors[] = $this->l('Invalid locale setting.'); + } + + $mollieImages = Tools::getValue('Mollie_Images'); + + if (!in_array($mollieImages, $imageOptions)) { + $errors[] = $this->l('Invalid image setting.'); + } + + $mollieIssuers = Tools::getValue('Mollie_Issuers'); + + if (!in_array($mollieIssuers, $issuerOptions)) { + $errors[] = $this->l('Invalid issuer setting.'); + } + + $mollieCss = Tools::getValue('Mollie_Css'); + + if (!isset($mollieCss)) { + $mollieCss = ''; + } + + $mollieLogger = Tools::getValue('Mollie_Logger'); + + if (!in_array($mollieLogger, $loggerOptions)) { + $errors[] = $this->l('Invalid debug log setting.'); + } + + $mollieCredentials = Tools::getValue('Mollie_Credentials'); + + if (!isset($mollieCredentials)) { + $mollieCredentials = false; + } else { + $mollieCredentials = ($mollieCredentials == 1); + } + + $mollieErrors = Tools::getValue('Mollie_Errors'); + + if (!isset($mollieErrors)) { + $mollieErrors = false; + } else { + $mollieErrors = ($mollieErrors == 1); + } + + foreach ($this->statuses as $name => $val) { + if (!is_numeric(Tools::getValue('Mollie_Status_'.$name))) { + $errors[] = Tools::ucfirst($name).'('.Tools::ucfirst($val).') status must be numeric.'; + } + } + + if (empty($errors)) { + Configuration::updateValue(Mollie::MOLLIE_API_KEY, $mollieApiKey); + Configuration::updateValue(Mollie::MOLLIE_DESCRIPTION, $mollieDescription); + Configuration::updateValue(Mollie::MOLLIE_PAYMENTSCREEN_LOCALE, $molliePaymentscreenLocale); + Configuration::updateValue(Mollie::MOLLIE_IMAGES, $mollieImages); + Configuration::updateValue(Mollie::MOLLIE_ISSUERS, $mollieIssuers); + Configuration::updateValue(Mollie::MOLLIE_CSS, $mollieCss); + Configuration::updateValue(Mollie::MOLLIE_CREDENTIALS, (int) $mollieCredentials); + Configuration::updateValue(Mollie::MOLLIE_DISPLAY_ERRORS, (int) $mollieErrors); + Configuration::updateValue(Mollie::MOLLIE_DEBUG_LOG, (int) $mollieLogger); + + foreach (array_keys($this->statuses) as $name) { + $new = (int) Tools::getValue('Mollie_Status_'.$name); + $this->statuses[$name] = $new; + Configuration::updateValue('MOLLIE_STATUS_'.Tools::strtoupper($name), $new); + + if ($name != Mollie_API_Object_Payment::STATUS_OPEN) { + Configuration::updateValue( + 'MOLLIE_MAIL_WHEN_'.Tools::strtoupper($name), + Tools::getValue('Mollie_Mail_When_'.$name) ? true : false + ); + } + } + $resultMessage = $this->l('The configuration has been saved!'); + } else { + $resultMessage = 'The configuration could not be saved:
- '.implode('
- ', $errors); + } + return $resultMessage; + } + + + /** + * @param string $url + * + * @return string + * @throws Exception + * @throws PrestaShopException + * @throws SmartyException + */ + protected function getUpdateMessage($url) + { + $updateMessage = ''; + $updateXml = $this->getUpdateXML($url); + if ($updateXml === false) { + $updateMessage = $this->l('Warning: Could not retrieve update xml file from github.'); + } else { + try { + /** @var SimpleXMLElement $tags */ + @$tags = new SimpleXMLElement($updateXml); + if (!empty($tags) && isset($tags->entry, $tags->entry[0], $tags->entry[0]->id)) { + $title = $tags->entry[0]->id; + $latestVersion = preg_replace("/[^0-9,.]/", "", Tools::substr($title, strrpos($title, '/'))); + if (!version_compare($this->version, $latestVersion, '>=')) { + $this->context->smarty->assign(array( + 'release_url' => $url, + 'this_version' => $this->version, + 'release_version' => $latestVersion, + )); + } + } else { + $updateMessage = $this->l('Warning: Update xml file from github follows an unexpected format.'); + } + } catch (Exception $e) { + $updateMessage = $this->l('Warning: Update xml file from github follows an unexpected format.'); + } + } + + return $updateMessage; + } + + /** + * @param string $url + * + * @return string + */ + protected function getUpdateXML($url) + { + return @Tools::file_get_contents($url.'/releases.atom'); + } + + + /** + * @param int $orderId + * @param string $transactionId + * + * @return array + * @throws Adapter_Exception + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ + protected function doRefund($orderId, $transactionId) + { + try { + $payment = $this->api->payments->get($transactionId); + $this->api->payments->refund($payment); + } catch (Mollie_API_Exception $e) { + return array( + 'status' => 'fail', + 'msg_fail' => $this->lang('The order could not be refunded!'), + 'msg_details' => $this->lang('Reason:').' '.$e->getMessage(), + ); + } + + // Tell status to shop + $this->setOrderStatus($orderId, Mollie_API_Object_Payment::STATUS_REFUNDED); + + // Save status in mollie_payments table + $updateData = array( + 'updated_at' => date('Y-m-d H:i:s'), + 'bank_status' => Mollie_API_Object_Payment::STATUS_REFUNDED, + ); + + Db::getInstance(_PS_USE_SQL_SLAVE_)->update('mollie_payments', $updateData, '`order_id` = '.(int) $orderId); + + return array( + 'status' => 'success', + 'msg_success' => $this->lang('The order has been refunded!'), + 'msg_details' => $this->lang( + 'Mollie B.V. will transfer the money back to the customer on the next business day.' + ), + ); + } + + /** + * @return array + * + * @throws Mollie_API_Exception + * @throws PrestaShopException + */ + public function getIssuerList() + { + $methods = array(); + foreach ($this->api->issuers->all() as $method) { + $method->href = $this->context->link->getModuleLink( + $this->name, + 'payment', + array('method' => $method->method, 'issuer' => $method->id), + true + ); + if (!isset($methods[$method->method])) { + $methods[$method->method] = array(); + } + $methods[$method->method][$method->id] = $method; + } + + return $methods; + } + + /** + * @param string|null $file + * + * @throws PrestaShopException + */ + protected function addCSSFile($file = null) + { + if (is_null($file)) { + $file = Configuration::get(Mollie::MOLLIE_CSS); + } + + if (empty($file)) { + if (version_compare(_PS_VERSION_, '1.6.0.0', '<')) { + // Use a modified css file to display the new 1.6 default layout + $file = $this->_path.'views/css/mollie_bootstrap.css'; + } else { + // Use default css file + $file = $this->_path.'views/css/mollie.css'; + } + } else { + // Use a custom css file + $file = str_replace('{BASE}', _PS_BASE_URL_, $file); + $file = str_replace('{THEME}', _PS_THEME_DIR_, $file); + $file = str_replace('{CSS}', _PS_CSS_DIR_, $file); + $file = str_replace('{MOBILE}', _THEME_MOBILE_DIR_, $file); + $file = str_replace('{MOBILE_CSS}', _THEME_MOBILE_CSS_DIR_, $file); + $file = str_replace('{OVERRIDE}', _PS_THEME_OVERRIDE_DIR_, $file); + } + $this->context->controller->addCSS($file); + } + + // Hooks + /** + * @throws PrestaShopException + */ + public function hookDisplayHeader() + { + $this->addCSSFile(Configuration::get(Mollie::MOLLIE_CSS)); + } + + /** + * @throws PrestaShopException + */ + public function hookDisplayBackOfficeHeader() + { + if ($this->context->controller instanceof AdminOrdersController && version_compare(_PS_VERSION_, '1.6.0.0', '<') + || $this->context->controller instanceof AdminModulesController && Tools::getValue('configure') === $this->name + ) { + $this->addCSSFile(Configuration::get(Mollie::MOLLIE_CSS)); + } + } + + /** + * @param array $params + * + * @return string + * @throws Adapter_Exception + * @throws Exception + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + * @throws SmartyException + */ + public function hookDisplayAdminOrder($params) + { + $cartId = Cart::getCartIdByOrderId((int) $params['id_order']); + + $mollieData = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow( + sprintf( + 'SELECT * FROM `%s` WHERE `cart_id` = \'%s\';', + _DB_PREFIX_.'mollie_payments', + (int) $cartId + ) + ); + // If the order_id is NULL in the mollie_payments db table + // use Order::getOrderByCartId for backwards compatibility + if (empty($mollieData['order_id'])) { + $mollieData['order_id'] = Order::getOrderByCartId((int) $cartId); + } + + if (Tools::isSubmit('Mollie_Refund')) { + $tplData = $this->doRefund((int) $mollieData['order_id'], $mollieData['transaction_id']); + if ($tplData['status'] === 'success') { + Tools::redirectAdmin($this->context->link->getAdminLink('AdminOrders', true).'&vieworder&id_order='.(int) $params['id_order']); + } + } elseif (isset($mollieData['bank_status']) && $mollieData['bank_status'] !== Mollie_API_Object_Payment::STATUS_PAID) { + $tplData = array( + 'status' => 'success', + 'msg_success' => $this->lang('The order has been refunded!'), + 'msg_details' => $this->lang( + 'Mollie B.V. will transfer the money back to the customer on the next business day.' + ), + ); + } else { + $tplData = array( + 'status' => 'form', + 'msg_button' => $this->lang['Refund this order'], + 'msg_description' => sprintf( + $this->lang['Refund order #%d through the Mollie API.'], + (int) $mollieData['order_id'] + ), + ); + } + + $tplData['msg_title'] = $this->lang['Mollie refund']; + $tplData['img_src'] = $this->_path.'views/img/logo_small.png'; + $this->context->controller->addJS($this->_path.'views/js/app/dist/confirmrefund.min.js'); + $this->smarty->assign($tplData); + $this->context->smarty->assign(array( + 'link' => Context::getContext()->link, + 'module_dir' => __PS_BASE_URI__.'modules/'.basename(__FILE__, '.php').'/', + )); + + return $this->display(__FILE__, 'refund.tpl'); + } + + /** + * @return string + * @throws Exception + * @throws PrestaShopException + * @throws SmartyException + */ + public function hookDisplayPayment() + { + $smarty = $this->context->smarty; + + if (!Currency::exists('EUR', 0)) { + $smarty->assign('message', $this->l('Mollie Payment Methods are only available when Euros are activated.')); + + return $this->display(__FILE__, 'error_message.tpl'); + } + + $issuerSetting = Configuration::get(Mollie::MOLLIE_ISSUERS); + + try { + $methods = $this->api->methods->all(); + $issuerList = in_array( + $issuerSetting, + array(Mollie::ISSUERS_ON_CLICK) + ) + ? $this->getIssuerList() + : array(); + } catch (Mollie_API_Exception $e) { + $methods = array(); + $issuerList = array(); + + if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ERRORS) { + Logger::addLog(__METHOD__.' said: '.$e->getMessage(), Mollie::ERROR); + } + if (Configuration::get(Mollie::MOLLIE_DISPLAY_ERRORS)) { + $smarty->assign('message', $e->getMessage()); + + return $this->display(__FILE__, 'error_message.tpl'); + } + } + + $smarty->assign( + array( + 'methods' => $methods, + 'issuers' => $issuerList, + 'issuer_setting' => $issuerSetting, + 'images' => Configuration::get(Mollie::MOLLIE_IMAGES), + 'warning' => $this->warning, + 'msg_pay_with' => $this->lang['Pay with %s'], + 'msg_bankselect' => $this->lang['Select your bank:'], + 'module' => $this, + 'mollie_banks_app_path' => Mollie::getMediaPath($this->_path.'views/js/app/dist/banks.min.js'), + 'mollie_translations' => array( + 'chooseYourBank' => $this->l('Choose your bank'), + 'choose' => $this->l('Choose'), + 'cancel' => $this->l('Cancel'), + ), + ) + ); + + return $this->display(__FILE__, 'payment.tpl'); + } + + /** + * EU Advanced Compliance module (prestahop module) Advanced Checkout option enabled + * + * @return array|null + * + * @throws PrestaShopException + */ + public function hookDisplayPaymentEU() + { + if (!Currency::exists('EUR', 0)) { + return null; + } + + try { + $methods = $this->api->methods->all(); + } catch (Mollie_API_Exception $e) { + if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ERRORS) { + Logger::addLog(__METHOD__.' said: '.$e->getMessage(), Mollie::ERROR); + } + + return null; + } + + $paymentOptions = array(); + foreach ($methods as $method) { + $paymentOptions[] = array( + 'cta_text' => $this->lang[$method->description], + 'logo' => $method->image->normal, + 'action' => $this->context->link->getModuleLink( + 'mollie', 'payment', + array('method' => $method->id), true + ), + ); + } + + return $paymentOptions; + } + + /** + * @param $params + * + * @return array|null + * @throws Exception + * @throws PrestaShopException + * @throws SmartyException + */ + public function hookPaymentOptions() + { + if (version_compare(_PS_VERSION_, '1.7.0.0', '<')) { + return null; + } + + return include dirname(__FILE__).'/lib/paymentoptions.php'; + } + + /** + * @return string + * + * @throws Exception + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + * @throws SmartyException + */ + public function hookDisplayOrderConfirmation() + { + $payment = $this->getPaymentBy('cart_id', (int) Tools::getValue('id_cart')); + if ($payment && $payment['bank_status'] == Mollie_API_Object_Payment::STATUS_PAID) { + $this->context->smarty->assign('okMessage', $this->lang('Thank you. Your payment has been received.')); + + return $this->display(__FILE__, 'ok.tpl'); + } + + return ''; + } + + /** + * @return bool + */ + public function addCartIdChangePrimaryKey() + { + $sql = sprintf( + ' + ALTER TABLE `%1$s` DROP PRIMARY KEY; + ALTER TABLE `%1$s` ADD PRIMARY KEY (`transaction_id`), + ADD COLUMN `cart_id` INT(64), + ADD KEY (`cart_id`);', + _DB_PREFIX_.'mollie_payments' + ); + + try { + if (!Db::getInstance()->execute($sql)) { + $this->_errors[] = 'Database error: '.Db::getInstance()->getMsgError(); + + return false; + } + } catch (PrestaShopException $e) { + $this->_errors[] = 'Database error: '.Db::getInstance()->getMsgError(); + + return false; + } + + return true; + } + + /** + * Create new order state while mollie payment pending. + * + * @since 2.0.0 + * + * @return boolean + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ + public function pendingOrderState() + { + $stateExist = false; + $states = OrderState::getOrderStates((int)$this->context->language->id); + foreach ($states as $state) { + if (in_array($this->lang('Awaiting Mollie payment'), $state)) { + $stateExist = true; + break; + } + } + if (!$stateExist) { + $orderState = new OrderState(); + $orderState->send_email = false; + $orderState->color = '#4169E1'; + $orderState->hidden = false; + $orderState->delivery = false; + $orderState->logable = false; + $orderState->invoice = false; + $orderState->module_name = $this->name; + $orderState->name = array(); + $languages = Language::getLanguages(false); + foreach ($languages as $language) { + $orderState->name[$language['id_lang']] = $this->lang('Awaiting Mollie payment'); + } + if ($orderState->add()) { + $source = _PS_MODULE_DIR_ . 'mollie/views/img/logo_small.png'; + $destination = _PS_ROOT_DIR_ . '/img/os/' . (int)$orderState->id . '.gif'; + @copy($source, $destination); + } + Configuration::updateValue(Mollie::MOLLIE_PENDING, (int) $orderState->id); + } + + return true; + } + + /** + * @param string $mediaUri + * @param string|null $cssMediaType + * + * @return array|bool|mixed|string + * + * @since 1.0.0 + * @version 1.0.0 Initial version + */ + public static function getMediaPath($mediaUri, $cssMediaType = null) + { + if (is_array($mediaUri) || $mediaUri === null || empty($mediaUri)) { + return false; + } + + $urlData = parse_url($mediaUri); + if (!is_array($urlData)) { + return false; + } + + if (!array_key_exists('host', $urlData)) { + $mediaUri = '/'.ltrim(str_replace(str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, _PS_ROOT_DIR_), __PS_BASE_URI__, $mediaUri), '/\\'); + // remove PS_BASE_URI on _PS_ROOT_DIR_ for the following + $fileUri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $mediaUri); + + if (!@filemtime($fileUri) || @filesize($fileUri) === 0) { + return false; + } + + $mediaUri = str_replace('//', '/', $mediaUri); + } + + if ($cssMediaType) { + return array($mediaUri => $cssMediaType); + } + + return $mediaUri; + } +} diff --git a/mollie/controllers/front/payment.php b/mollie/controllers/front/payment.php deleted file mode 100755 index 74231e2bd..000000000 --- a/mollie/controllers/front/payment.php +++ /dev/null @@ -1,415 +0,0 @@ - - * @copyright Mollie B.V. - * @link https://www.mollie.nl - */ - -if (!defined('_PS_VERSION_')) -{ - die('No direct script access'); -} - -/** - * Class MolliePaymentModuleFrontController - * @method setTemplate - * @property mixed context - * @property Mollie module - */ - -class MolliePaymentModuleFrontController extends ModuleFrontController -{ - /** - * @see FrontController::initContent() - */ - public function initContent() - { - parent::initContent(); - /** @var Cart $cart */ - $cart = $this->context->cart; - $customer = new Customer($cart->id_customer); - - if (!$this->_validate($cart, $customer)) - { - die( - $this->module->lang['This payment method is not available.'] . - '

' . - '' . - $this->module->lang['Click here to continue'] . - '.' - ); - } - - $method = $_GET['method']; - $issuer = !empty($_GET['issuer']) ? $_GET['issuer'] : NULL; - - // If no issuer was set yet and the issuer list has its own page, show issuer list here - if ($issuer === null && $this->module->getConfigValue('MOLLIE_ISSUERS') === Mollie::ISSUERS_OWN_PAGE) - { - $tpl_data = array(); - $tpl_data['issuers'] = $this->_getIssuerList($method); - - // Only show issuers if a choice is available - if (sizeof($tpl_data['issuers']) === 1) - { - $issuer = key($tpl_data['issuers']); - } - else if (!empty($tpl_data['issuers'])) - { - $tpl_data['msg_bankselect'] = $this->module->lang['Select your bank:']; - $tpl_data['msg_ok'] = $this->module->lang['OK']; - $tpl_data['msg_return'] = $this->module->lang['Return to the homepage']; - $tpl_data['module'] = $this->module; - $this->context->smarty->assign($tpl_data); - $this->setTemplate('module:mollie/views/templates/front/mollie_issuers.tpl'); - return; - } - } - - // Currency conversion (thou shalt pay in euros) - $orig_amount = $cart->getOrderTotal(TRUE, Cart::BOTH); - $amount = $this->_convertCurrencyToEuro($orig_amount); - - // Prepare payment - $payment_data = $this->_getPaymentData($amount, $method, $issuer, (int) $cart->id, $customer->secure_key); - $payment = $this->_createPayment($payment_data); - - - // Store payment linked to cart - Db::getInstance()->insert( - 'mollie_payments', - array( - 'cart_id' => (int) $cart->id, - 'method' => $payment->method, - 'transaction_id' => $payment->id, - 'bank_status' => Mollie_API_Object_Payment::STATUS_OPEN, - 'created_at' => date("Y-m-d H:i:s") - ) - ); - - if ($payment->method == "banktransfer") - { - $this->module->validateOrder( - (int) $cart->id, - $this->module->statuses[$payment->status], - $orig_amount, - $payment->method, - NULL, - array(), - NULL, - FALSE, - $customer->secure_key - ); - } - - // Go to payment url - Tools::redirect($payment->getPaymentUrl()); - } - - /** - * Checks if this payment option is still available - * May redirect the user to a more appropriate page - * - * @param $cart - * @param $customer - * @return bool - */ - public function _validate($cart, $customer) - { - if (!$cart->id_customer || - !$cart->id_address_delivery || - !$cart->id_address_invoice || - !$this->module->active) - { - // We be like: how did you even get here? - Tools::redirect(_PS_BASE_URL_ . __PS_BASE_URI__); - return FALSE; - } - - $authorized = FALSE; - - foreach (Module::getPaymentModules() as $module) - { - if ($module['name'] == 'mollie') - { - $authorized = TRUE; - break; - } - } - - if (!$authorized) - { - return FALSE; - } - - if (!Validate::isLoadedObject($customer)) - { - return FALSE; - } - - return TRUE; - } - - /** - * Retrieves a list of issuers for the selected method - * - * @param string $method - * @return array - */ - protected function _getIssuerList($method) - { - try - { - $issuers = $this->module->api->issuers->all(); - $issuer_list = array(); - foreach ($issuers as $issuer) - { - if ($issuer->method === $method) - { - $issuer_list[$issuer->id] = $issuer->name; - } - } - return $issuer_list; - } - catch (Mollie_API_Exception $e) - { - if ($this->module->getConfigValue('MOLLIE_DEBUG_LOG') == Mollie::DEBUG_LOG_ERRORS) - { - Logger::addLog(__METHOD__ . ' said: ' . $e->getMessage(), Mollie::NOTICE); - } - } - return array(); - } - - /** - * @param float $amount - * @return float - */ - protected function _convertCurrencyToEuro($amount) - { - $cart = $this->context->cart; - $currency_euro = Currency::getIdByIsoCode('EUR'); - if (!$currency_euro) - { - // No Euro currency available! - if ($this->module->getConfigValue('MOLLIE_DEBUG_LOG') == Mollie::DEBUG_LOG_ERRORS) - { - Logger::addLog(__METHOD__ . ' said: In order to use this module, you need to enable Euros as currency.', Mollie::CRASH); - } - die($this->module->lang['This payment method is only available for Euros.']); - } - - if ($cart->id_currency !== $currency_euro) - { - // Convert non-euro currency to default - $amount = Tools::convertPrice($amount, $cart->id_currency, FALSE); - - if (Currency::getDefaultCurrency() !== $currency_euro) - { - // If default is not euro, convert to euro - $amount = Tools::convertPrice($amount, $currency_euro, TRUE); - } - - } - - return round($amount, 2); - } - - /** - * @param int $cart_id - * @return string - */ - protected function _generateDescriptionFromCart($cart_id) - { - $cart = new Cart($cart_id); - - $buyer = null; - if ($cart->id_customer) - { - $buyer = new Customer($cart->id_customer); - } - - $filters = array( - 'cart.id' => $cart_id, - 'customer.firstname' => $buyer == null ? '' : $buyer->firstname, - 'customer.lastname' => $buyer == null ? '' : $buyer->lastname, - 'customer.company' => $buyer == null ? '' : $buyer->company, - ); - - $content = $this->module->getConfigValue('MOLLIE_DESCRIPTION'); - - foreach($filters as $key => $value) - { - $content = str_replace("{".$key."}", $value, $content); - } - - return $content; - } - - /** - * @param float $amount - * @param string $method - * @param string|null $issuer - * @param int $cart_id - * @return array - */ - protected function _getPaymentData($amount, $method, $issuer, $cart_id, $secure_key) - { - $description = $this->_generateDescriptionFromCart($cart_id); - - $payment_data = array( - "amount" => $amount, - "method" => $method, - "issuer" => $issuer, - "description" => str_replace('%', $cart_id, $description), - "redirectUrl" => $this->context->link->getModuleLink('mollie','return', array('cart_id' => $cart_id, 'utm_nooverride' => 1)), - "webhookUrl" => $this->context->link->getModuleLink('mollie', 'webhook'), - "metadata" => array("cart_id" => $cart_id,"secure_key" => $secure_key) - ); - - // Send webshop locale - if ($this->module->getConfigValue('MOLLIE_PAYMENTSCREEN_LOCALE') === Mollie::PAYMENTSCREEN_LOCALE_SEND_WEBSITE_LOCALE) - { - $locale = $this->_getWebshopLocale(); - - if (preg_match('/^[a-z]{2}(?:[\-_][A-Z]{2})?$/iu', $locale)) - { - $payment_data['locale'] = $locale; - } - } - - if (isset($this->context, $this->context->cart)) - { - if (isset($this->context->cart->id_customer)) - { - $buyer = new Customer($this->context->cart->id_customer); - $payment_data['billingEmail'] = $buyer->email; - } - if (isset($this->context->cart->id_address_invoice)) - { - $billing = new Address(intval($this->context->cart->id_address_invoice)); - $payment_data['billingCity'] = $billing->city; - $payment_data['billingRegion'] = State::getNameById($billing->id_state); - $payment_data['billingPostal'] = $billing->postcode; - $payment_data['billingCountry'] = Country::getIsoById($billing->id_country); - } - if (isset($this->context->cart->id_address_delivery)) - { - $shipping = new Address(intval($this->context->cart->id_address_delivery)); - $payment_data['shippingCity'] = $shipping->city; - $payment_data['shippingRegion'] = State::getNameById($shipping->id_state); - $payment_data['shippingPostal'] = $shipping->postcode; - $payment_data['shippingCountry'] = Country::getIsoById($shipping->id_country); - } - } - - return $payment_data; - } - - /** - * @return string - */ - protected function _getWebshopLocale () - { - if ($this->context->language) - { - // Current language - $language = $this->context->language->iso_code; - } - else - { - // Default locale language - $language = Configuration::get('PS_LOCALE_LANGUAGE'); - } - - return strtolower($language).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY')); - } - - /** - * @param array $data - * @return Mollie_API_Object_Payment|null - */ - protected function _createPayment($data) - { - $payment = null; - if ($this->module->getConfigValue('MOLLIE_USE_PROFILE_WEBHOOK')) - { - unset($data['webhookUrl']); - } - - try - { - /** @var Mollie_API_Object_Payment $payment */ - $payment = $this->module->api->payments->create($data); - } - catch (Mollie_API_Exception $e) - { - try - { - if ($e->getField() == "webhookUrl") - { - if ($this->module->getConfigValue('MOLLIE_DEBUG_LOG') == Mollie::DEBUG_LOG_ERRORS) - { - Logger::addLog(__METHOD__ . ' said: Could not reach generated webhook url, falling back to profile webhook url.', Mollie::WARNING); - } - unset($data['webhookUrl']); - $payment = $this->module->api->payments->create($data); - } - else - { - throw $e; - } - } - catch (Mollie_API_Exception $e) - { - if ($this->module->getConfigValue('MOLLIE_DEBUG_LOG') == Mollie::DEBUG_LOG_ERRORS) - { - Logger::addLog(__METHOD__ . ' said: ' . $e->getMessage(), Mollie::CRASH); - } - if ($this->module->getConfigValue('MOLLIE_DISPLAY_ERRORS')) - { - die( - $this->module->lang['There was an error while processing your request: '] . - '
' . $e->getMessage() . '

' . - '' . - $this->module->lang['Click here to continue'] . - '.' - ); - } - else - { - Tools::redirect(_PS_BASE_URL_ . __PS_BASE_URI__); - } - } - } - return $payment; - } -} diff --git a/mollie/controllers/front/return.php b/mollie/controllers/front/return.php deleted file mode 100755 index a350390d3..000000000 --- a/mollie/controllers/front/return.php +++ /dev/null @@ -1,137 +0,0 @@ - - * @copyright Mollie B.V. - * @link https://www.mollie.nl - */ - -if (!defined('_PS_VERSION_')) -{ - die('No direct script access'); -} - -/** - * Class MollieReturnModuleFrontController - * @method setTemplate - * @property mixed context - * @property Mollie module - */ - -class MollieReturnModuleFrontController extends ModuleFrontController -{ - /** - * @see FrontController::initContent() - */ - public function initContent() - { - parent::initContent(); - $data = array(); - /** - * Set ref is indicative of a payment that is tied to an order instead of a cart, which - * we still support for transitional reasons. - */ - if (isset($_GET['ref'])) - { - $order_id = (int) $_GET['id']; - - // Check if user is allowed to be on the return page - $data['auth'] = Order::getUniqReferenceOf($order_id) === $_GET['ref']; - if ($data['auth']) - { - $data['mollie_info'] = $this->module->getPaymentBy('order_id', (int)$order_id); - } - } - elseif (isset($_GET['cart_id'])) - { - $cart_id = (int) $_GET['cart_id']; - - // Check if user that's seeing this is the cart-owner - $cart = new Cart($cart_id); - $data['auth'] = (int)$cart->id_customer === $this->context->customer->id; - if ($data['auth']) - { - $data['mollie_info'] = $this->module->getPaymentBy('cart_id', (int)$cart_id); - } - } - - if (isset($data['auth']) && $data['auth']) - { - // any paid payments for this cart? - - if ($data['mollie_info'] === FALSE) - { - $data['mollie_info'] = array(); - $data['msg_details'] = $this->module->lang('The order with this id does not exist.'); - } - else - { - switch ($data['mollie_info']['bank_status']) - { - case Mollie_API_Object_Payment::STATUS_OPEN: - $data['msg_details'] = $this->module->lang('We have not received a definite payment status. You will be notified as soon as we receive a confirmation of the bank/merchant.'); - break; - case Mollie_API_Object_Payment::STATUS_CANCELLED: - Tools::redirect('order&step=3'); - break; - case Mollie_API_Object_Payment::STATUS_EXPIRED: - $data['msg_details'] = $this->module->lang('Unfortunately your order was expired.'); - break; - case Mollie_API_Object_Payment::STATUS_PAID: - if(isset($cart_id)) - { - Tools::redirectLink(__PS_BASE_URI__ . 'index.php?controller=order-confirmation&id_cart=' . $cart_id .'&id_module='. $this->module->id .'&id_order=' . Order::getOrderByCartId(intval($cart_id)) . '&key=' . $this->context->customer->secure_key); - } - $data['msg_details'] = $this->module->lang('Thank you. Your order has been received.'); - break; - default: - $data['msg_details'] = $this->module->lang('The transaction has an unexpected status.'); - if (Configuration::get('MOLLIE_DEBUG_LOG') == Mollie::DEBUG_LOG_ERRORS) - { - Logger::addLog(__METHOD__ . 'said: The transaction has an unexpected status ('.$data['mollie_info']['bank_status'].')', Mollie::WARNING); - } - } - } - } - // Not allowed? Don't make query but redirect. - else - { - $data['mollie_info'] = array(); - $data['msg_details'] = $this->module->lang('You are not authorised to see this page.'); - Tools::redirect(_PS_BASE_URL_ . __PS_BASE_URI__); - } - - $data['msg_continue'] = '' . $this->module->lang('Continue shopping') . ''; - $data['msg_welcome'] = $this->module->lang('Welcome back'); - - $this->context->smarty->assign($data); - $this->setTemplate('module:mollie/views/templates/front/mollie_return.tpl'); - } -} diff --git a/mollie/controllers/front/webhook.php b/mollie/controllers/front/webhook.php deleted file mode 100755 index 7ce727309..000000000 --- a/mollie/controllers/front/webhook.php +++ /dev/null @@ -1,299 +0,0 @@ - - * @copyright Mollie B.V. - * @link https://www.mollie.nl - */ - -if (!defined('_PS_VERSION_')) -{ - die('No direct script access'); -} - -/** - * Class MollieReturnModuleFrontController - * @method setTemplate - * @property mixed context - * @property Mollie module - */ - -class MollieWebhookModuleFrontController extends ModuleFrontController -{ - /** - * @see FrontController::initContent() - */ - public function initContent() - { - parent::initContent(); - - echo $this->_executeWebhook(); - exit; - } - - - /** - * @return string - */ - protected function _executeWebhook() - { - if (Tools::getValue('testByMollie')) - { - if ($this->module->getConfigValue('MOLLIE_DEBUG_LOG') == Mollie::DEBUG_LOG_ERRORS) - { - Logger::addLog(__METHOD__ . 'said: Mollie webhook tester successfully communicated with the shop.', Mollie::NOTICE); - } - return 'OK'; - } - - $transaction_id = Tools::getValue('id'); - - if (empty($transaction_id)) - { - if ($this->module->getConfigValue('MOLLIE_DEBUG_LOG') == Mollie::DEBUG_LOG_ERRORS) - { - Logger::addLog(__METHOD__ . 'said: Received webhook request without proper transaction ID.', Mollie::WARNING); - } - return 'NO ID'; - } - - try - { - /** @var Mollie_API_Object_Payment $api_payment */ - $api_payment = $this->module->api->payments->get($transaction_id); - $transaction_id = $api_payment->id; - } - catch (Exception $e) - { - if ($this->module->getConfigValue('MOLLIE_DEBUG_LOG') == Mollie::DEBUG_LOG_ERRORS) - { - Logger::addLog(__METHOD__ . 'said: Could not retrieve payment details for transaction_id "' . $transaction_id . '". Reason: ' . $e->getMessage(), Mollie::WARNING); - } - return 'NOT OK'; - } - - $ps_payment = $this->module->getPaymentBy('transaction_id', $transaction_id); - - $this->_setCountryContextIfNotSet($api_payment); - - if ($api_payment->method == "banktransfer") - { - if (isset($api_payment->metadata->cart_id)) - { - // Possible failure because of old modules. So we check if order exists. if not, validateOrder - $order_id = Order::getOrderByCartId($api_payment->metadata->cart_id); - if ($order_id) - { - $this->module->setOrderStatus($order_id, $api_payment->status); - } - else - { - $this->module->validateOrder( - (int) $api_payment->metadata->cart_id, - $this->module->statuses[$api_payment->status], - $this->_convertEuroToCartCurrency($api_payment->amount,(int) $api_payment->metadata->cart_id), - $api_payment->method, - NULL, - array(), - NULL, - FALSE, - $api_payment->metadata->secure_key - ); - - $this->save_order_transaction_id($api_payment->id); - } - } - elseif (isset($api_payment->metadata->order_id)) - { - $order_id = $api_payment->metadata->order_id; - $this->module->setOrderStatus($order_id, $api_payment->status); - } - } - else - { - if (isset($api_payment->metadata->cart_id)) - { - if ( - $ps_payment['bank_status'] === Mollie_API_Object_Payment::STATUS_OPEN && - $api_payment->status === Mollie_API_Object_Payment::STATUS_PAID ) - { - // Misnomer ahead: think of validateOrder as "createOrderFromCart" - $this->module->validateOrder( - (int) $api_payment->metadata->cart_id, - $this->module->statuses[$api_payment->status], - $this->_convertEuroToCartCurrency($api_payment->amount,(int) $api_payment->metadata->cart_id), - $api_payment->method, - NULL, - array(), - NULL, - FALSE, - $api_payment->metadata->secure_key - ); - - $this->save_order_transaction_id($api_payment->id); - } - - $order_id = $this->module->currentOrder; - } - - /** - * Older versions tie payments to orders, and create a cart upon payment creation. - * In order to support the transition between these two cases we check for the - * occurrence of order_id in the metadata. In these cases we only update the order status - */ - - elseif (isset($api_payment->metadata->order_id)) - { - $order_id = $api_payment->metadata->order_id; - $this->module->setOrderStatus($order_id, $api_payment->status); - } - - } - - // Store status in database - if (!$this->_savePaymentStatus($transaction_id, $api_payment->status)) - { - if ($this->module->getConfigValue('MOLLIE_DEBUG_LOG') == Mollie::DEBUG_LOG_ERRORS) - { - Logger::addLog(__METHOD__ . 'said: Could not save Mollie payment status for transaction "' . $transaction_id . '". Reason: ' . Db::getInstance()->getMsgError(), Mollie::WARNING); - } - } - - // Log successful webhook requests in extended log mode only - if ($this->module->getConfigValue('MOLLIE_DEBUG_LOG') == Mollie::DEBUG_LOG_ALL) - { - Logger::addLog(__METHOD__ . 'said: Received webhook request for order ' . (int) $order_id . ' / transaction ' . $transaction_id, Mollie::NOTICE); - } - return 'OK'; - } - - /** - * Retrieves the OrderPayment object, created at validateOrder. And add transaction id. - * @param string $mollie_payment_id - * @return bool - */ - public function save_order_transaction_id($mollie_payment_id) - { - // retrieve ALL payments of order. - // in the case of a cancel or expired on banktransfer, this will fire too. - // if no OrderPayment objects is retrieved in the collection, do nothing. - $order = new Order($this->module->currentOrder); - $collection = OrderPayment::getByOrderReference($order->reference); - if (count($collection) > 0) - { - $order_payment = $collection[0]; - - // for older versions (1.5) , we check if it hasn't been filled yet. - if (!$order_payment->transaction_id) - { - $order_payment->transaction_id = $mollie_payment_id; - $order_payment->update(); - } - } - } - - - /** - * @param $transaction_id - * @param $status - * @return bool - */ - protected function _savePaymentStatus($transaction_id, $status) - { - $data = array( - 'updated_at' => date("Y-m-d H:i:s"), - 'bank_status' => $status, - ); - - return Db::getInstance()->update('mollie_payments', $data, '`transaction_id` = \'' . Db::getInstance()->escape($transaction_id) . '\''); - } - - /** - * Transforms euro prices from mollie back to the currency of the Cart (order) - * @param float $amount in euros - * @param int $cart_id - * @return float in the currency of the cart - */ - protected function _convertEuroToCartCurrency($amount, $cart_id) - { - $cart = new Cart($cart_id); - $currency_euro = Currency::getIdByIsoCode('EUR'); - - if (!$currency_euro) - { - // No Euro currency available! - if ($this->module->getConfigValue('MOLLIE_DEBUG_LOG') == Mollie::DEBUG_LOG_ERRORS) - { - Logger::addLog(__METHOD__ . ' said: In order to use this module, you need to enable Euros as currency. Cart ID: ' . $cart_id, Mollie::CRASH); - } - die($this->module->lang['This payment method is only available for Euros.']); - } - - if ($cart->id_currency !== $currency_euro) - { - // Convert euro currency to cart currency - $amount = Tools::convertPriceFull($amount, Currency::getCurrencyInstance($currency_euro), Currency::getCurrencyInstance($cart->id_currency)); - } - - return round($amount, 2); - } - - /** - * (Re)sets the controller country context. - * When Prestashop receives a call from Mollie (without context) - * Prestashop allways has default context to fall back on, so context->country - * is allways Set before executing any controller methods - * - * @param Mollie_API_Object_Payment $payment - */ - private function _setCountryContextIfNotSet(Mollie_API_Object_Payment $payment) - { - if (empty($this->context->country) || !$this->context->country->active) - { - if (isset($payment->metadata->cart_id)) - { - $cart = new Cart((int)$payment->metadata->cart_id); - if (!empty($cart)) - { - $address = new Address($cart->id_address_delivery); - if (!empty($address)) - { - $country = new Country($address->id_country); - if (!empty($country)) - { - $this->context->country = $country; - } - } - } - } - } - } - -} diff --git a/mollie/lib b/mollie/lib deleted file mode 160000 index 279a969eb..000000000 --- a/mollie/lib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 279a969eb3dca8111d0ce4cf3c716a133c478ab6 diff --git a/mollie/logo.png b/mollie/logo.png deleted file mode 100755 index f34df2891c5162ed9fda1638cc1aba822dd19c41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2028 zcmV-P)x09w$NHa0!l?_3$~%t`_aq2cjlaZ_Fl_}GjnF)=VyIFhDanR2Lu;z0>6=My? zjP>n`ec*eEAypl5r3k2?OC8iXuogrxwHj>OUYaK|u7Cnj1cgHv7eMd9W-riw%!22V^rYYz1VsK^#PI? zmT#gf%TP^neWoxwiVK5HBW_EYg9oMRYfV^I7gPG_{pg;BWp=Qc=!-* z;W`*lkxGmRZoP{fdTb0FKz8iJr!8Yi%Y101ceajb$i$&PcYcH3-7;&?{&*yt0#z!kwQQ=D1Zb)D8&bl z1SzApRvQN2)lXRZ>#3m|9y&xGMQGtl`d4n^Z@Yu!@YeyzZgf~W@h76e8fgKAD@W|v;wbN=@MmB%4QXn~a6rH^rU0OnIguDJJJn$gRUALBuop}R) z?oFabdA8X&Lfcb_bBM@B1r#@`fOx$3Fuk=>AW2igJLgzmSOB2WYQg>oaSI(x2xQJt zd;H02eDCy0YM)*k1|eYDZM@3~8w|D@RLc(`1VOyueSoPg!!T~7@UM?qz3^7mR6lT# zo)75FW&G}08jn0$x(mop{h3CZ5=PTR+9J3D@ls)hAlTCHVJJS}LV(H13M`;R4%W|~ z9lGI>BgpNuWdFW`y?RfJl5cm{Zv z)3#9j?G0SNE!}-P(cb&$twa6MCo1~8r%qDOKsKBOw$VUBz*RUUmhEPR$+DbY=ICZQ zS)P+S#YFX?0_#0Y3-Y)B&f-7bEf)mp_dUQW&^U0gqJQo9tJDG4%g0l3bAl`vdfkj( zmiNVBUGQ3jKoJ5y1e|kZ3Ys>D+pxP%rVy^JvT}NUm`v`vmtz0@Onl{@a_^r%NAKKO z!X)Ht>tig)^c1;3;XOqN6cX?fu%Z~%{t2jxIES{I*e$~#46CaY0<8wDoS3T?PWJ9) z`st?`)L=JHyh?PVhqNc~c}~&o4tK(qtprQydsRe~AW9rmDTFd&jlmWkNfOLR5Ee^| z1PAq9Qxq58V(HpdW^Ub0`<{DAzr1Hi|J-pVCL@A@kY|K$7n&uLQLBwNU`5KzIfxAr zQLjRfQVQqLMw57AdPv{$BI3bJPotMREWY+yKLcB8{nM^<_6+XrbJTXu5ELZOklv61 zTW=s3d`t(o%&B}nvjU_d(GC#K|HHwv=vpY*w~h^e&!8U*4BnD0#@ecXtoVO0@w&~ z`4|K7^fa_vXyM1VXQ671>1SsH;=wlCRVD<`qCkP5O1yOo{^Av`pB(0ftFOOKcK%K3 zJ7)-@NED&DE9=R@$vLx~Xkrra4mD;_5tz6@5j9Ak3XMSOHI`S`aCwFY)^6OuHv4sf ziP$<7@zIOF;?gG{m&?5J2WIMqqLvUs$pFr=_~8fC_k9iZp0$e?Dc067wHl(;293<| zJ9k{1v1ZSJm{^sydV@=~I;)Ed;0o@TYBL+hs0aZ_lNz0?i@d+QP7Szwy2;FKGvs;c zDr*cT2>6RB#CeaIYyV-Fwb;mFTuu?k zWmW@vnPbb$6c2Bo0t~8Jduj}Ls*xgO8WZcFxk*!ku0*=?D^ zZ*+qdI&$SR8`}TZ4b6VR-2T{Sp1iX7B0xOfb+-UlzHw#oh3B?UoU!n%zx#5`riy ztcWgDgtQQ(Qd0|Z#%9j>&iStI+w%mdPaS&_uL{-y00000yOP&>AAR*^XrDQDBFlVA z#(XYKc7;xdl~uBgl<0KGb7{Iue;}-^k_A#a9i}Ib{;<&N9%<`Z41wiUshA5p+l&^7 zk-C<$Agpaj`Ba!qb@~Iim^CTgN7DXvReAIgz4t!WJNJcZqnu1sRV8cdMpf0ywiOqb^txU3_uqi-;ro?~3?4dW zw)uf{={I0`S((q&bt9YRvy|tBJTHXN2;|>>tx8Gn&;#1T4}!_&S>37vvD-Jdy;V6_cVW)r$+d`}V76 zxzw=r{=2%1OYS)Nw7<{1u0)l9I2D~(2`*t&8>Gt9(mH(lF2XLRtO{KxO~`xM(-3KTI4fhY=J z-o18l9O9v>KlJx-L7MD3kR`*Ax%uyws;cZ?+p9C^+o@aEMvK@z&qW}N^ diff --git a/mollie/mollie.php b/mollie/mollie.php deleted file mode 100755 index a090cda1a..000000000 --- a/mollie/mollie.php +++ /dev/null @@ -1,981 +0,0 @@ - - * @copyright Mollie B.V. - * @link https://www.mollie.nl - */ - -use PrestaShop\PrestaShop\Core\Payment\PaymentOption; - -if (!defined('_PS_VERSION_')) -{ - die('No direct script access'); -} - -/** - * Class Mollie - * @method l - * @method display - * @method registerHook - * @method unregisterHook - * @method validateOrder - * @property mixed warning - * @property mixed _errors - * @property mixed _path - * @property mixed smarty - * @property mixed context - * @property mixed currentOrder - * @property mixed active - */ - -class Mollie extends PaymentModule -{ - /** @var Mollie_API_Client|null */ - public $api = NULL; - public $lang = array(); - public $statuses = array(); - - const NOTICE = 1; - const WARNING = 2; - const ERROR = 3; - const CRASH = 4; - - const NAME = 'mollie'; - - const PAYMENTSCREEN_LOCALE_BROWSER_LOCALE = 'browser_locale'; - const PAYMENTSCREEN_LOCALE_SEND_WEBSITE_LOCALE = 'website_locale'; - - const LOGOS_BIG = 'big'; - const LOGOS_NORMAL = 'normal'; - const LOGOS_HIDE = 'hide'; - - const ISSUERS_ALWAYS_VISIBLE = 'always-visible'; - const ISSUERS_ON_CLICK = 'on-click'; - const ISSUERS_OWN_PAGE = 'own-page'; - const ISSUERS_PAYMENT_PAGE = 'payment-page'; - - const DEBUG_LOG_NONE = 0; - const DEBUG_LOG_ERRORS = 1; - const DEBUG_LOG_ALL = 2; - - public function __construct() - { - $this->name = 'mollie'; - $this->author = 'Mollie B.V.'; - $this->tab = 'payments_gateways'; - $this->version = '2.0.0'; - $this->ps_versions_compliancy = array('min' => '1.7', 'max' => _PS_VERSION_); - $this->need_instance = true; - - parent::__construct(); - - $this->displayName = $this->l('Mollie Payment Module'); - $this->description = $this->l('Mollie Payments'); - - $this->confirmUninstall = $this->l('Are you sure you want to uninstall the Mollie Payment Module?'); - - $this->controllers = array('payment', 'return', 'webhook'); - - require_once(dirname(__FILE__) . '/lib/src/Mollie/API/Autoloader.php'); - - try - { - $this->api = new Mollie_API_Client; - $this->api->setApiKey($this->getConfigValue('MOLLIE_API_KEY')); - $this->api->addVersionString('Prestashop/' . (defined('_PS_VERSION_') ? _PS_VERSION_ : 'Unknown')); - $this->api->addVersionString('MolliePrestashop/' . (isset($this->version) ? $this->version : 'Unknown')); - } - catch (Mollie_API_Exception_IncompatiblePlatform $e) - { - Logger::addLog(__METHOD__ . ' - System incompatible: ' . $e->getMessage(), Mollie::CRASH); - } - catch (Mollie_API_Exception $e) - { - $this->warning = $this->l('Payment error:') . $e->getMessage(); - Logger::addLog(__METHOD__ . ' said: ' . $this->warning, Mollie::CRASH); - } - - $this->statuses = array( - Mollie_API_Object_Payment::STATUS_PAID => $this->getConfigValue('MOLLIE_STATUS_PAID'), - Mollie_API_Object_Payment::STATUS_CANCELLED => $this->getConfigValue('MOLLIE_STATUS_CANCELLED'), - Mollie_API_Object_Payment::STATUS_EXPIRED => $this->getConfigValue('MOLLIE_STATUS_EXPIRED'), - Mollie_API_Object_Payment::STATUS_REFUNDED => $this->getConfigValue('MOLLIE_STATUS_REFUNDED'), - Mollie_API_Object_Payment::STATUS_OPEN => $this->getConfigValue('MOLLIE_STATUS_OPEN'), - ); - - // Load all translatable text here so we have a single translation point - $this->lang = array( - Mollie_API_Object_Payment::STATUS_PAID => $this->l('paid'), - Mollie_API_Object_Payment::STATUS_CANCELLED => $this->l('cancelled'), - Mollie_API_Object_Payment::STATUS_EXPIRED => $this->l('expired'), - Mollie_API_Object_Payment::STATUS_REFUNDED => $this->l('refunded'), - Mollie_API_Object_Payment::STATUS_OPEN => $this->l('bankwire pending'), - 'This payment method is not available.' => $this->l('This payment method is not available.'), - 'Click here to continue' => $this->l('Click here to continue'), - 'This payment method is only available for Euros.' => $this->l('This payment method is only available for Euros.'), - 'There was an error while processing your request: ' => $this->l('There was an error while processing your request: '), - 'The order with this id does not exist.' => $this->l('The order with this id does not exist.'), - 'We have not received a definite payment status. You will be notified as soon as we receive a confirmation of the bank/merchant.' => - $this->l('We have not received a definite payment status. You will be notified as soon as we receive a confirmation of the bank/merchant.'), - 'You have cancelled your payment.' => $this->l('You have cancelled your payment.'), - 'Unfortunately your payment was expired.' => $this->l('Unfortunately your payment was expired.'), - 'Thank you. Your payment has been received.' => $this->l('Thank you. Your payment has been received.'), - 'The transaction has an unexpected status.' => $this->l('The transaction has an unexpected status.'), - 'You are not authorised to see this page.' => $this->l('You are not authorised to see this page.'), - 'Continue shopping' => $this->l('Continue shopping'), - 'Welcome back' => $this->l('Welcome back'), - 'Select your bank:' => $this->l('Select your bank:'), - 'OK' => $this->l('OK'), - 'Return to the homepage' => $this->l('Return to the homepage'), - 'Pay with %s' => $this->l('Pay with %s'), - 'Refund this order' => $this->l('Refund this order'), - 'Mollie refund' => $this->l('Mollie refund'), - 'Refund order #%d through the Mollie API.' => $this->l('Refund order #%d through the Mollie API.'), - 'iDEAL' => $this->l('iDEAL'), - 'Creditcard' => $this->l('Creditcard'), - 'Bancontact/Mister Cash' => $this->l('Bancontact/Mister Cash'), - 'SOFORT Banking' => $this->l('SOFORT Banking'), - 'SEPA Direct Debit' => $this->l('SEPA Direct Debit'), - 'Belfius Direct Net' => $this->l('Belfius Direct Net'), - 'Bitcoin' => $this->l('Bitcoin'), - 'PODIUM Cadeaukaart' => $this->l('PODIUM Cadeaukaart'), - 'Bank transfer' => $this->l('Bank transfer'), - 'PayPal' => $this->l('PayPal'), - 'paysafecard' => $this->l('paysafecard'), - 'MiniTix' => $this->l('MiniTix'), - 'Micropayments' => $this->l('Micropayments'), - ); - - // If an update includes a new hook, it normally takes a manual reinstall for it to take effect - // This would cause all config values to reset and the Mollie table to be cleared. - // $this->reinstall() fixes the hook registration without those sad side effects. - $version = $this->getConfigValue('MOLLIE_VERSION'); - if ($version === FALSE || version_compare($version, $this->version, '<')) - { - $this->reinstall(); - $this->updateConfigValue('MOLLIE_VERSION', $this->version); - } - } - - - /** - * Installs the Mollie Payments Module - * - * @return bool - */ - public function install() - { - if ( - !parent::install() || - !$this->_registerHooks() - ) - { - $this->_errors[] = 'Unable to install module'; - return FALSE; - } - if ( - !$this->_initConfig() - ) - { - $this->_errors[] = 'Unable to set config values'; - return FALSE; - } - - $sql = sprintf(' - CREATE TABLE IF NOT EXISTS `%s` ( - `transaction_id` VARCHAR(64) NOT NULL PRIMARY KEY, - `cart_id` INT(64), - `order_id` INT(64), - `method` VARCHAR(128) NOT NULL, - `bank_status` VARCHAR(64) NOT NULL, - `created_at` DATETIME NOT NULL, - `updated_at` DATETIME DEFAULT NULL, - INDEX (cart_id) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8;', - _DB_PREFIX_ . 'mollie_payments' - ); - - if (!Db::getInstance()->execute($sql)) - { - $this->_errors[] = 'Database error: ' . Db::getInstance()->getMsgError(); - return FALSE; - } - - return TRUE; - } - - /** - * @return bool - */ - public function uninstall() - { - if (!$this->_unregisterHooks()) - { - $this->_errors[] = 'Unable to unregister the module'; - return FALSE; - } - if ( - !$this->deleteConfigValue('MOLLIE_VERSION') || - !$this->deleteConfigValue('MOLLIE_API_KEY') || - !$this->deleteConfigValue('MOLLIE_DESCRIPTION') || - !$this->deleteConfigValue('MOLLIE_PAYMENTSCREEN_LOCALE') || - !$this->deleteConfigValue('MOLLIE_IMAGES') || - !$this->deleteConfigValue('MOLLIE_ISSUERS') || - !$this->deleteConfigValue('MOLLIE_CSS') || - !$this->deleteConfigValue('MOLLIE_DEBUG_LOG') || - !$this->deleteConfigValue('MOLLIE_DISPLAY_ERRORS') || - !$this->deleteConfigValue('MOLLIE_USE_PROFILE_WEBHOOK') || - !$this->deleteConfigValue('MOLLIE_STATUS_OPEN') || - !$this->deleteConfigValue('MOLLIE_STATUS_PAID') || - !$this->deleteConfigValue('MOLLIE_STATUS_CANCELLED') || - !$this->deleteConfigValue('MOLLIE_STATUS_EXPIRED') || - !$this->deleteConfigValue('MOLLIE_STATUS_REFUNDED') || - !$this->deleteConfigValue('MOLLIE_MAIL_WHEN_OPEN') || - !$this->deleteConfigValue('MOLLIE_MAIL_WHEN_PAID') || - !$this->deleteConfigValue('MOLLIE_MAIL_WHEN_CANCELLED') || - !$this->deleteConfigValue('MOLLIE_MAIL_WHEN_EXPIRED') || - !$this->deleteConfigValue('MOLLIE_MAIL_WHEN_REFUNDED') - ) - { - $this->_errors[] = 'Unable to unset the configuration'; - return FALSE; - } - - $sql = sprintf('DROP TABLE IF EXISTS `%s`;', - _DB_PREFIX_ . 'mollie_payments' - ); - - if (!Db::getInstance()->execute($sql)) - { - $this->_errors[] = 'Database error: ' . Db::getInstance()->getMsgError(); - return FALSE; - } - return parent::uninstall(); - } - - - public function reinstall() - { - return - $this->reinstallHooks() && - $this->_initConfig() - ; - } - - public function reinstallHooks() - { - return - $this->_unregisterHooks() && - $this->_registerHooks() - ; - } - - /** - * @return bool - */ - protected function _registerHooks() - { - return - $this->_registerHook('paymentOptions') && - $this->_registerHook('displayPaymentTop') && - $this->_registerHook('displayAdminOrder') && - $this->_registerHook('displayHeader') && - $this->_registerHook('displayBackOfficeHeader') && - $this->_registerHook('paymentReturn') - ; - } - - /** - * @return bool - */ - protected function _unregisterHooks() - { - return - $this->_unregisterHook('paymentOptions') && - $this->_unregisterHook('displayPaymentTop') && - $this->_unregisterHook('displayAdminOrder') && - $this->_unregisterHook('displayHeader') && - $this->_unregisterHook('displayBackOfficeHeader') && - $this->_unregisterHook('paymentReturn') - ; - } - - /** - * Override Registering, check hook existence first. - * On false return register completion, so installation doesn't fail if the Hook doesn't exist. - * For example the PaymentEU hook doesn't exist in every prestashop, and can therefore produce an unstallation error. - * @param string $name Name of the hook to register - * @param bool $standard If the hook is standard prestashop, therefore we can assume the hook exists - * @return bool - */ - protected function _registerHook($name, $standard = true) - { - if (!$standard && !Hook::getIdByName($name)) - { - return true; - } - - return $this->registerHook($name); - } - - /** - * Override Unregistering, check hook existence first. - * On false return unregister completion, so uninstallation doesn't fail if the Hook doesn't exist. - * For example the PaymentEU hook doesn't exist in every prestashop, and can therefore produce a uninstallation error. - * @param string $name Name of the hook to unregister - * @param bool $standard If the hook is standard prestashop, therefore we can assume the hook exists - * @return bool - */ - protected function _unregisterHook($name, $standard = true) - { - if (!$standard && !Hook::getIdByName($name)) - { - return true; - } - - return $this->unregisterHook($name); - } - - /** - * @return bool - */ - protected function _initConfig() - { - return - $this->initConfigValue('MOLLIE_VERSION', $this->version) && - $this->initConfigValue('MOLLIE_API_KEY', '') && - $this->initConfigValue('MOLLIE_DESCRIPTION', 'Cart %') && - $this->initConfigValue('MOLLIE_PAYMENTSCREEN_LOCALE', self::PAYMENTSCREEN_LOCALE_BROWSER_LOCALE) && - $this->initConfigValue('MOLLIE_IMAGES', self::LOGOS_NORMAL) && - $this->initConfigValue('MOLLIE_ISSUERS', self::ISSUERS_ON_CLICK) && - $this->initConfigValue('MOLLIE_CSS', '') && - $this->initConfigValue('MOLLIE_DEBUG_LOG', self::DEBUG_LOG_ERRORS) && - $this->initConfigValue('MOLLIE_DISPLAY_ERRORS', FALSE) && - $this->initConfigValue('MOLLIE_USE_PROFILE_WEBHOOK', FALSE) && - $this->initConfigValue('MOLLIE_STATUS_OPEN', 10) && - $this->initConfigValue('MOLLIE_STATUS_PAID', 2) && - $this->initConfigValue('MOLLIE_STATUS_CANCELLED', 6) && - $this->initConfigValue('MOLLIE_STATUS_EXPIRED', 8) && - $this->initConfigValue('MOLLIE_STATUS_REFUNDED', 7) && - $this->initConfigValue('MOLLIE_MAIL_WHEN_PAID', TRUE) && - $this->initConfigValue('MOLLIE_MAIL_WHEN_CANCELLED', FALSE) && - $this->initConfigValue('MOLLIE_MAIL_WHEN_EXPIRED', FALSE) && - $this->initConfigValue('MOLLIE_MAIL_WHEN_REFUNDED', TRUE) - ; - } - - /** - * @return mixed - */ - public function getErrors() - { - return $this->_errors; - } - - - /** - * @return string - */ - public function getContent() - { - $cookie = Context::getContext()->cookie; - $lang = isset($cookie->id_lang) ? (int) $cookie->id_lang : Configuration::get('PS_LANG_DEFAULT'); - $lang = $lang == 0 ? Configuration::get('PS_LANG_DEFAULT') : $lang; - - $update_message = $this->_getUpdateMessage('https://github.com/mollie/Prestashop'); - $result_msg = ''; - - $payscreen_locale_options = array( - self::PAYMENTSCREEN_LOCALE_BROWSER_LOCALE => $this->l('Do not send locale, use browser language'), - self::PAYMENTSCREEN_LOCALE_SEND_WEBSITE_LOCALE => $this->l('Send webshop locale'), - ); - - $image_options = array( - self::LOGOS_BIG => $this->l('big'), - self::LOGOS_NORMAL => $this->l('normal'), - self::LOGOS_HIDE => $this->l('hide') - ); - $issuer_options = array( - //self::ISSUERS_ALWAYS_VISIBLE => $this->l('Always visible'), temporarily removed for 1.7 ->todo: improve layout - //self::ISSUERS_ON_CLICK => $this->l('On click'), temporarily removed for 1.7 ->todo: improve layout - self::ISSUERS_OWN_PAGE => $this->l('Own page'), - self::ISSUERS_PAYMENT_PAGE => $this->l('Payment page') - ); - $logger_options = array( - self::DEBUG_LOG_NONE => $this->l('Nothing'), - self::DEBUG_LOG_ERRORS => $this->l('Errors'), - self::DEBUG_LOG_ALL => $this->l('Everything') - ); - - if (Tools::isSubmit('Mollie_Config_Save')) - { - $result_msg = $this->_getSaveResult(array_keys($payscreen_locale_options), array_keys($image_options), array_keys($issuer_options), array_keys($logger_options)); - } - - $data = array( - 'form_action' => Tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']), - 'config_title' => $this->l('Mollie Configuration'), - 'config_legend' => $this->l('Mollie Settings'), - 'update_message' => $update_message, - 'all_statuses' => OrderState::getOrderStates($lang), - 'payscreen_locale_options' => $payscreen_locale_options, - 'image_options' => $image_options, - 'issuer_options' => $issuer_options, - 'logger_options' => $logger_options, - 'title_status' => $this->l('%s statuses:'), - 'title_visual' => $this->l('Visual settings:'), - 'title_debug' => $this->l('Debug info:'), - 'msg_result' => $result_msg, - 'msg_api_key' => $this->l('API key:'), - 'msg_desc' => $this->l('Description:'), - 'msg_payscreen_locale' => $this->l('Send locale for payment screen'), - 'msg_images' => $this->l('Images:'), - 'msg_issuers' => $this->l('Issuer list:'), - 'msg_css' => $this->l('Css file:'), - 'msg_errors' => $this->l('Display errors:'), - 'msg_logger' => $this->l('Log level:'), - 'msg_save' => $this->l('Save settings:'), - 'desc_api_key' => sprintf( - $this->l('You can find your API key in your %sMollie Profile%s; it starts with test or live.'), - '', - '' - ), - 'desc_desc' => $this->l('Enter a description here. Note: Payment methods may have a character limit, best keep the description under 29 characters.'), - 'desc_payscreen_locale' => sprintf( - $this->l('Should the plugin send the current webshop %slocale%s to Mollie. Mollie payment screens will be in the same language as your webshop. Mollie can also detect the language based on the user\'s browser language.'), - '', - '' - ), - 'desc_images' => $this->l('Show big, normal or no payment method logos on checkout.'), - 'desc_issuers' => $this->l('Some payment methods (eg. iDEAL) have an issuer list. This setting specifies where it is shown.'), - 'desc_css' => $this->l('Leave empty for default stylesheet. Should include file path when set.') - . '
' - . $this->l('Hint: You can use {BASE}, {THEME}, {CSS}, {MOBILE}, {MOBILE_CSS} and {OVERRIDE} for easy folder mapping.'), - 'desc_errors' => $this->l('Enabling this feature will display error messages (if any) on the front page. Use for debug purposes only!'), - 'desc_logger' => sprintf( - $this->l('Recommended level: Errors. Set to Everything to monitor incoming webhook requests. %sView logs%s'), - '', - '' - ), - 'val_api_key' => $this->getConfigValue('MOLLIE_API_KEY'), - 'val_desc' => $this->getConfigValue('MOLLIE_DESCRIPTION'), - 'payscreen_locale_value' => $this->getConfigValue('MOLLIE_PAYMENTSCREEN_LOCALE'), - 'val_images' => $this->getConfigValue('MOLLIE_IMAGES'), - 'val_issuers' => $this->getConfigValue('MOLLIE_ISSUERS'), - 'val_css' => $this->getConfigValue('MOLLIE_CSS'), - 'val_errors' => $this->getConfigValue('MOLLIE_DISPLAY_ERRORS'), - 'val_logger' => $this->getConfigValue('MOLLIE_DEBUG_LOG'), - 'val_save' => $this->l('Save'), - 'lang' => $this->lang, - ); - - $db = Db::getInstance(); - $msg_status = $this->l('Status for %s payments'); - $desc_status = $this->l('%s payments get status "%s"'); - $msg_mail = $this->l('Send mails when %s'); - $desc_mail = $this->l('Send mails when transaction status becomes %s?'); - foreach ($this->statuses as $name => $val) - { - $val = (int) $val; - $data['msg_status_' . $name] = sprintf($msg_status, $this->lang[$name]); - $data['desc_status_' . $name] = ucfirst(sprintf($desc_status, - $this->lang[$name], - $db->getValue('SELECT `name` FROM `' . _DB_PREFIX_ . 'order_state_lang` WHERE `id_order_state` = ' . (int) $val . ' AND `id_lang` = ' . (int) $lang) - )); - $data['val_status_' . $name] = $val; - $data['msg_mail_' . $name] = sprintf($msg_mail, $this->lang[$name]); - $data['desc_mail_' . $name] = sprintf($desc_mail, $this->lang[$name]); - $data['val_mail_' . $name] = $this->getConfigValue('MOLLIE_MAIL_WHEN_' . strtoupper($name)); - $data['statuses'][] = $name; - } - - $this->context->smarty->assign($data); - - return $this->display(__FILE__, 'mollie_config.tpl'); - } - - /** - * @param $field - * @param $default_value - * @return bool - */ - public function initConfigValue($field, $default_value) - { - return Configuration::updateValue($field, (Configuration::get($field) !== FALSE) ? Configuration::get($field) : $default_value); - } - - /** - * @param $field - * @return bool - */ - public function deleteConfigValue($field) - { - return Configuration::deleteByName($field); - } - - /** - * @param $field - * @param $value - * @return bool - */ - public function updateConfigValue($field, $value) - { - return Configuration::updateValue($field, $value); - } - - /** - * @param $field - * @return mixed - */ - public function getConfigValue($field) - { - return Configuration::get($field); - } - - - /** - * @param string $str - * @return string - */ - public function lang($str) - { - if (array_key_exists($str, $this->lang)) - { - return $this->lang[$str]; - } - return $str; - } - - /** - * @param $order_id - * @param $status - * @return OrderHistory - */ - public function setOrderStatus($order_id, $status) - { - $status_id = (int)$this->statuses[$status]; - $history = new OrderHistory(); - $history->id_order = $order_id; - $history->id_order_state = $status_id; - $history->changeIdOrderState($status_id, $order_id); - - if ($this->getConfigValue('MOLLIE_MAIL_WHEN_' . strtoupper($status))) - { - $history->addWithemail(); - } - else - { - $history->add(); - } - - return $history; - } - - /** - * @param $order_id - * @return array - */ - - public function getPaymentBy($column,$id) - { - $paid_payment = Db::getInstance()->getRow( - sprintf( - 'SELECT * FROM `%s` WHERE `%s` = \'%s\' AND bank_status = \'%s\'', - _DB_PREFIX_ . 'mollie_payments', - $column, - $id, - Mollie_API_Object_Payment::STATUS_PAID - ) - ); - - if ($paid_payment) - { - return $paid_payment; - } - - $non_paid_payment = Db::getInstance()->getRow( - sprintf( - 'SELECT * FROM `%s` WHERE `%s` = \'%s\' ORDER BY created_at DESC', - _DB_PREFIX_ . 'mollie_payments', - $column, - $id - ) - ); - - return $non_paid_payment; - } - - /** - * @param array $payscreen_locale_options - * @param array $image_options - * @param array $issuer_options - * @param array $logger_options - * @return string - */ - protected function _getSaveResult(array $payscreen_locale_options = array(), array $image_options = array(), array $issuer_options = array(), array $logger_options = array()) - { - $errors = array(); - if (!empty($_POST['Mollie_Api_Key']) && strpos($_POST['Mollie_Api_Key'], 'live') !== 0 && strpos($_POST['Mollie_Api_Key'], 'test') !== 0) - { - $errors[] = $this->l('The API key needs to start with test or live.'); - } - if (!in_array($_POST['Mollie_Paymentscreen_Locale'], $payscreen_locale_options)) - { - $errors[] = $this->l('Invalid locale setting.'); - } - if (!in_array($_POST['Mollie_Images'], $image_options)) - { - $errors[] = $this->l('Invalid image setting.'); - } - if (!in_array($_POST['Mollie_Issuers'], $issuer_options)) - { - $errors[] = $this->l('Invalid issuer setting.'); - } - if (!isset($_POST['Mollie_Css'])) - { - $_POST['Mollie_Css'] = ''; - } - if (!in_array($_POST['Mollie_Logger'], $logger_options)) - { - $errors[] = $this->l('Invalid debug log setting.'); - } - if (!isset($_POST['Mollie_Errors'])) - { - $_POST['Mollie_Errors'] = FALSE; - } - else - { - $_POST['Mollie_Errors'] = ($_POST['Mollie_Errors'] == 1); - } - foreach ($this->statuses as $name => $val) - { - if (!is_numeric($_POST['Mollie_Status_' . $name])) - { - $errors[] = ucfirst($name) . ' status must be numeric.'; - } - } - - if (empty($errors)) - { - $this->updateConfigValue('MOLLIE_API_KEY', $_POST['Mollie_Api_Key']); - $this->updateConfigValue('MOLLIE_DESCRIPTION', $_POST['Mollie_Description']); - $this->updateConfigValue('MOLLIE_PAYMENTSCREEN_LOCALE', $_POST['Mollie_Paymentscreen_Locale']); - $this->updateConfigValue('MOLLIE_IMAGES', $_POST['Mollie_Images']); - $this->updateConfigValue('MOLLIE_ISSUERS', $_POST['Mollie_Issuers']); - $this->updateConfigValue('MOLLIE_CSS', $_POST['Mollie_Css']); - $this->updateConfigValue('MOLLIE_DISPLAY_ERRORS', (int) $_POST['Mollie_Errors']); - $this->updateConfigValue('MOLLIE_DEBUG_LOG', (int) $_POST['Mollie_Logger']); - - foreach ($this->statuses as $name => $old) - { - $new = (int) $_POST['Mollie_Status_' . $name]; - $this->statuses[$name] = $new; - $this->updateConfigValue('MOLLIE_STATUS_' . strtoupper($name), $new); - - if ($name != Mollie_API_Object_Payment::STATUS_OPEN) - { - $this->updateConfigValue( - 'MOLLIE_MAIL_WHEN_' . strtoupper($name), - !empty($_POST['Mollie_Mail_When_' . $name]) ? TRUE : FALSE - ); - } - } - $result_msg = $this->l('The configuration has been saved!'); - } - else - { - $result_msg = 'The configuration could not be saved:
- ' . implode('
- ', $errors); - } - return $result_msg; - } - - - /** - * @param string $url - * @return string - */ - protected function _getUpdateMessage($url) - { - $update_message = ''; - $update_xml = $this->_getUpdateXML($url); - if ($update_xml === FALSE) - { - $update_message = $this->l('Warning: Could not retrieve update xml file from github.'); - } - else - { - /** @var SimpleXMLElement $tags */ - $tags = new SimpleXMLElement($update_xml); - if (!empty($tags) && isset($tags->entry, $tags->entry[0], $tags->entry[0]->id)) - { - $title = $tags->entry[0]->id; - $latest_version = preg_replace("/[^0-9,.]/", "", substr($title, strrpos($title, '/'))); - if (!version_compare($this->version, $latest_version, '>=')) - { - $update_message = sprintf( - '' . $this->l('You are currently using version %s. We strongly recommend you to upgrade to the new version %s!') . '', - $url, $this->version, $latest_version - ); - } - } - else - { - $update_message = $this->l('Warning: Update xml file from github follows an unexpected format.'); - } - } - - return $update_message; - } - - /** - * @param string $url - * @return string - */ - protected function _getUpdateXML($url) - { - return @file_get_contents($url . '/releases.atom'); - } - - - /** - * @param int $order_id - * @param string $transaction_id - * @return string - */ - protected function _doRefund($order_id, $transaction_id) - { - try - { - $payment = $this->api->payments->get($transaction_id); - $this->api->payments->refund($payment); - } - catch (Mollie_API_Exception $e) - { - return array( - 'status' => 'fail', - 'msg_fail' => $this->lang('The order could not be refunded!'), - 'msg_details' => $this->lang('Reason:') . ' ' . $e->getMessage(), - ); - } - - // Tell status to shop - $this->setOrderStatus($order_id, Mollie_API_Object_Payment::STATUS_REFUNDED); - - // Save status in mollie_payments table - $update_data = array( - 'updated_at' => date("Y-m-d H:i:s"), - 'bank_status' => Mollie_API_Object_Payment::STATUS_REFUNDED, - ); - - Db::getInstance()->update('mollie_payments', $update_data, '`order_id` = ' . (int) $order_id); - - return array( - 'status' => 'success', - 'msg_success' => $this->lang('The order has been refunded!'), - 'msg_details' => $this->lang('Mollie B.V. will transfer the money back to the customer on the next business day.'), - ); - } - - /** - * @return array - */ - protected function _getIssuerList() - { - $issuers = $this->api->issuers->all(); - - $issuer_list = array(); - foreach ($issuers as $issuer) - { - $issuer_list[$issuer->method][$issuer->id] = $issuer->name; - } - return $issuer_list; - } - - protected function _addCSSFile($file = null) - { - if (is_null($file)) - { - $file = $this->getConfigValue('MOLLIE_CSS'); - } - - if (empty($file)) - { - if (strpos(_PS_THEME_DIR_, '/default-bootstrap/') !== FALSE) - { - // Use a modified css file for the new 1.6 default layout - $file = $this->_path . 'views/css/mollie_bootstrap.css'; - } - else - { - // Use default css file - $file = $this->_path . 'views/css/mollie.css'; - } - } - else - { - // Use a custom css file - $file = str_replace('{BASE}', _PS_BASE_URL_, $file); - $file = str_replace('{THEME}', _PS_THEME_DIR_, $file); - $file = str_replace('{CSS}', _PS_CSS_DIR_, $file); - $file = str_replace('{MOBILE}', _THEME_MOBILE_DIR_, $file); - $file = str_replace('{MOBILE_CSS}', _THEME_MOBILE_CSS_DIR_, $file); - $file = str_replace('{OVERRIDE}', _PS_THEME_OVERRIDE_DIR_, $file); - } - $this->context->controller->addCSS($file); - } - - // Hooks - - /** - */ - public function hookDisplayHeader() - { - $this->_addCSSFile($this->getConfigValue('MOLLIE_CSS')); - } - - public function hookDisplayBackOfficeHeader() - { - $this->_addCSSFile($this->getConfigValue('MOLLIE_CSS')); - } - - /** - * @param $params - * @return string - */ - public function hookDisplayAdminOrder($params) - { - $mollie_data = Db::getInstance()->getRow(sprintf( - 'SELECT * FROM `%s` WHERE `order_id` = %s;', - _DB_PREFIX_ . 'mollie_payments', - (int) $params['id_order'] - )); - - // Do not show refund option if it's not a successfully paid Mollie transaction - if ($mollie_data === FALSE || $mollie_data['bank_status'] !== Mollie_API_Object_Payment::STATUS_PAID) - { - return ''; - } - - if (Tools::isSubmit('Mollie_Refund')) - { - $tpl_data = $this->_doRefund($mollie_data['order_id'], $mollie_data['transaction_id']); - } - else - { - $tpl_data = array( - 'status' => 'form', - 'msg_button' => $this->lang['Refund this order'], - 'msg_description' => sprintf($this->lang['Refund order #%d through the Mollie API.'], (int) $mollie_data['order_id']), - ); - } - - $tpl_data['msg_title'] = $this->lang['Mollie refund']; - $tpl_data['img_src'] = $this->_path . 'logo_small.png'; - $this->smarty->assign($tpl_data); - return $this->display(__FILE__, 'mollie_refund.tpl'); - } - - /** - * PaymentOptions (prestahop module) Advanced Checkout option enabled - * @param $params - * @return array|void - */ - public function hookPaymentOptions($params) - { - if (!Currency::exists('EUR', 0)) - { - return; - } - - try { - $methods = $this->api->methods->all(); - } catch (Mollie_API_Exception $e) { - $methods = array(); - - if ($this->getConfigValue('MOLLIE_DEBUG_LOG') == self::DEBUG_LOG_ERRORS) - { - Logger::addLog(__METHOD__ . ' said: ' . $e->getMessage(), Mollie::ERROR); - } - - return; - } - - $payment_options = array(); - foreach($methods as $method) - { - $newOption = new PaymentOption(); - $newOption->setCallToActionText($this->lang($method->description)) - ->setAction($this->context->link->getModuleLink('mollie', 'payment', array('method' => $method->id), true)) - ->setLogo($method->image->normal); - - $payment_options[] = $newOption; - } - - return $payment_options; - } - - public function hookDisplayPaymentTop() - { - $payment = $this->getPaymentBy('cart_id',(int)$this->context->cart->id); - if ($payment && $payment['bank_status'] == Mollie_API_Object_Payment::STATUS_CANCELLED) - { - return '

'.$this->lang('You have cancelled your payment.').'

'; - } - } - - public function hookPaymentReturn() - { - $payment = $this->getPaymentBy('cart_id',(int)Tools::getValue('id_cart')); - if ($payment && $payment['bank_status'] == Mollie_API_Object_Payment::STATUS_PAID) - { - return '

'.$this->lang('Thank you. Your payment has been received.').'

'; - } - } - - public function addCartIdChangePrimaryKey() - { - $sql = sprintf(' - ALTER TABLE `%1$s` DROP PRIMARY KEY; - ALTER TABLE `%1$s` ADD PRIMARY KEY (transaction_id), - ADD COLUMN `cart_id` INT(64), - ADD KEY (cart_id);', - _DB_PREFIX_ . 'mollie_payments'); - - if (!Db::getInstance()->execute($sql)) - { - $this->_errors[] = 'Database error: ' . Db::getInstance()->getMsgError(); - return FALSE; - } - - return TRUE; - } - -} diff --git a/mollie/upgrade/Upgrade-1.0.3.php b/mollie/upgrade/Upgrade-1.0.3.php deleted file mode 100755 index 783deb2fa..000000000 --- a/mollie/upgrade/Upgrade-1.0.3.php +++ /dev/null @@ -1,15 +0,0 @@ - September 03, 2014 - * @copyright Mollie B.V. - * - * Upgrade script to upgrade Mollie to version 1.0.3 - * This function will not get called on new installation - * - * @param Mollie $module - * @return bool - */ -function upgrade_module_1_0_3($module) -{ - return $module->reinstallHooks() && $module->addCartIdChangePrimaryKey(); -} \ No newline at end of file diff --git a/mollie/views/css/mollie.css b/mollie/views/css/mollie.css deleted file mode 100755 index 15fa102db..000000000 --- a/mollie/views/css/mollie.css +++ /dev/null @@ -1,101 +0,0 @@ -.mollie_methods p.payment_module a -{ - padding-left: 1px; - padding-right: 40px; - background: #FBFBFB; -} -.mollie_image -{ - margin-left: 26px; - padding-right: 20px; -} -.mollie_image_big -{ - margin-left: 6px; -} -.mollie_margin -{ - display: block; - float: left; - width: 96px; -} -.mollie_issuers -{ - display: block; - color: #333333; - padding-left: 96px; -} -.mollie_issuers select, .mollie_issuers input -{ - border: 1px solid #D6D4D4; - border-radius: 4px; - background: #FBFBFB; - height: 20px; -} -.mollie_refund -{ - background-color: #EBEDF4; - border: 1px solid #CCCED7; - color: #585A69; - font-size: 1.1em; - margin: 0; - margin-top: 25px; - padding: 1em; - padding-top: 20px; - position: relative; -} -.mollie_refund_message -{ - background: none repeat scroll 0 0 #EBEDF4; - border: 1px solid #CCCED7; - font-weight: 700; - padding: 0.2em 0.5em; - text-align: left; - display: inline; - margin: 0; - position: absolute; - top: -10px; -} -.mollie_refund_message img -{ - margin-right: 10px; -} -.mollie_refund_button -{ - background: -moz-linear-gradient(center top , #F9F9F9, #E3E3E3) repeat scroll 0 0 rgba(0, 0, 0, 0); - border-color: #CCCCCC #BBBBBB #A0A0A0; - border-radius: 3px; - border-style: solid; - border-width: 1px; - color: #000000; - cursor: pointer; - margin: 0; - outline: medium none; - padding: 3px 8px; - text-align: center; - text-shadow: 0 1px 0 #FFFFFF; - vertical-align: middle; - white-space: nowrap; -} -.mollie_refund_button:hover -{ - border: 1px solid #939393; -} -.mollie_refund_fail -{ - font-weight: bold; - color: #e9322d; -} -.mollie_refund_success -{ - font-weight: bold; - color: #46a546; -} -.mollie_refund_details -{ - font-size: small; -} -.mollie_refund_desc -{ - margin-bottom: 10px; -} \ No newline at end of file diff --git a/mollie/views/css/mollie_bootstrap.css b/mollie/views/css/mollie_bootstrap.css deleted file mode 100755 index 033732571..000000000 --- a/mollie/views/css/mollie_bootstrap.css +++ /dev/null @@ -1,129 +0,0 @@ -.mollie_methods -{ - width: 50%; - padding-right: 15px; - margin-top: 15px; -} -.mollie_methods p.payment_module -{ - margin-top: -15px; -} -.mollie_methods p.payment_module a:after -{ - display: block; - content: "\f054"; - font-family: "FontAwesome", Sans-Serif; - position: absolute; - right: 15px; - top: 50%; - font-size: 25px; - height: 22px; - margin-top: -11px; - width: 14px; - color: #777777; -} -.mollie_methods p.payment_module a -{ - padding-left: 1px; - padding-right: 40px; - background: #FBFBFB; -} -.mollie_image -{ - margin-left: 29px; - margin-right: 29px; -} -.mollie_image_big -{ - margin-left: 9px; - margin-right: 9px; -} -.mollie_margin -{ - display: block; - float: left; - width: 99px; -} -.mollie_issuers -{ - display: block; - margin-top: -20px; - margin-bottom: 30px; - padding-top: 20px; - padding-bottom: 20px; - padding-left: 99px; - background-color: #D6D4D4; - color: #333333; -} -.mollie_issuers select, .mollie_issuers input -{ - border: 1px solid #D6D4D4; - border-radius: 4px; - background: #FBFBFB; - height: 20px; -} -.mollie_refund -{ - border: 1px solid #D6D4D4; - border-radius: 4px; - background: #FFFFFF; - color: #333333; - padding: 20px; - margin-bottom: 20px; -} -.mollie_refund_message -{ - font-family: "Ubuntu Condensed", Helvetica, Arial, sans-serif; - font-size: 14px; - color: #555555; - border-bottom: 1px solid #EEEEEE; - text-transform: uppercase; - margin: -20px -16px 15px; - padding: 0 0 0 5px; -} -.mollie_refund_message img -{ - margin-right: 3px; -} -.mollie_refund_button_box -{ - background-color: #FCFDFE; - border: 1px solid #E1EBF5; - border-radius: 3px; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05) inset; - min-height: 20px; - padding: 19px; -} -.mollie_refund_button -{ - background-color: #FFFFFF; - box-shadow: 0 -2px 0 #E6E6E6 inset; - border: 1px solid #CCCCCC; - border-radius: 3px; - padding: 4px 8px; -} -.mollie_refund_button:hover -{ - background-color: #00AFF0; - box-shadow: none; - border: 1px solid #008ABD; - color: #FFFFFF; -} -.mollie_refund_fail -{ - font-weight: bold; - color: #e9322d; -} -.mollie_refund_success -{ - font-weight: bold; - color: #46a546; -} -.mollie_refund_details -{ - font-size: small; -} -.mollie_refund_desc -{ - margin-bottom: 10px; -} \ No newline at end of file diff --git a/mollie/views/templates/hook/mollie_config.tpl b/mollie/views/templates/hook/mollie_config.tpl deleted file mode 100755 index d8a3eb105..000000000 --- a/mollie/views/templates/hook/mollie_config.tpl +++ /dev/null @@ -1,234 +0,0 @@ - - -
-

{$config_title|escape}

-
- {$config_legend|escape} - - {if !empty($update_message)} - - - - {/if} - {if !empty($msg_result)} - - - - {/if} - - - - - - - - - - - - - - - - - - - - - - - - - - - - {foreach $statuses as $i => $name} - - - - - - - - {if $name != Mollie_API_Object_Payment::STATUS_OPEN} - - - - - {/if} - {/foreach} - - - - - - - - - - - - - - - -
- {$update_message} -
- {$msg_result} -
- - -
- -
- - -
- -
- - -
- -
{$title_visual}
- - -
- -
- - -
- -
- - -
- -
{$title_status|ucfirst|sprintf:$lang[$name]}
- - -
- -
- - -
- -
{$title_debug}
- - - - -
- - -
- -
- {$msg_save} - - -
-
-
\ No newline at end of file diff --git a/mollie/views/templates/hook/mollie_methods.tpl b/mollie/views/templates/hook/mollie_methods.tpl deleted file mode 100755 index 65f6e41d0..000000000 --- a/mollie/views/templates/hook/mollie_methods.tpl +++ /dev/null @@ -1,75 +0,0 @@ - - - - -{if $warning != ''} -

{$warning}

-{/if} - -
-{foreach $methods as $method} -

- - {if isset($method->image) && $images !== 'hide'} - {if $images === 'big'} - - {else} - - {/if} - {else} -   - {/if} - {$module->lang($method->description)|escape} - -
- {if isset($issuers[$method->id]) && count($issuers[$method->id])} - - - - - {/if} -

-{/foreach} -
\ No newline at end of file diff --git a/mollie/views/templates/hook/mollie_refund.tpl b/mollie/views/templates/hook/mollie_refund.tpl deleted file mode 100755 index d5c7b332d..000000000 --- a/mollie/views/templates/hook/mollie_refund.tpl +++ /dev/null @@ -1,21 +0,0 @@ -
-
-
- {$msg_title} -
-
- {if $status === 'form'} -
-
{$msg_description}
- -
- {elseif $status === 'fail'} -
{$msg_fail}
-
{$msg_details}
- {elseif $status === 'success'} -
{$msg_success}

-
{$msg_details}
- {/if} -
-
-
\ No newline at end of file diff --git a/release.sh b/release.sh deleted file mode 100755 index 338962b44..000000000 --- a/release.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -git submodule update --init -zip -9 -r mollie-prestashop-x.x.x.zip mollie README.mdown -x mollie/*.git* mollie/*.DS_Store \ No newline at end of file diff --git a/sql/index.php b/sql/index.php new file mode 100644 index 000000000..98e480d2e --- /dev/null +++ b/sql/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2017 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/sql/install.php b/sql/install.php new file mode 100644 index 000000000..823ccf098 --- /dev/null +++ b/sql/install.php @@ -0,0 +1,44 @@ + + * @copyright 2007-2017 PrestaShop SA + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + * International Registered Trademark & Property of PrestaShop SA + */ + +$sql = array(); + +$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'mollie_payments` ( + `transaction_id` VARCHAR(64) NOT NULL PRIMARY KEY, + `cart_id` INT(64), + `order_id` INT(64), + `method` VARCHAR(128) NOT NULL, + `bank_status` VARCHAR(64) NOT NULL, + `created_at` DATETIME NOT NULL, + `updated_at` DATETIME DEFAULT NULL, + INDEX (cart_id) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;'; + +foreach ($sql as $query) { + if (Db::getInstance()->execute($query) == false) { + return false; + } +} diff --git a/sql/uninstall.php b/sql/uninstall.php new file mode 100644 index 000000000..4c32ba192 --- /dev/null +++ b/sql/uninstall.php @@ -0,0 +1,41 @@ + +* @copyright 2007-2017 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/** +* In some cases you should not drop the tables. +* Maybe the merchant will just try to reset the module +* but does not want to loose all of the data associated to the module. +*/ + +$sql = array(); + +$sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'mollie_payments`;'; + +foreach ($sql as $query) { + if (Db::getInstance()->execute($query) == false) { + return false; + } +} diff --git a/mollie/translations/de.php b/translations/de.php old mode 100755 new mode 100644 similarity index 53% rename from mollie/translations/de.php rename to translations/de.php index ae5a50a95..8341441b8 --- a/mollie/translations/de.php +++ b/translations/de.php @@ -13,8 +13,6 @@ $_MODULE['<{mollie}prestashop>mollie_542ba101e183aea6bc8dab5b1ec5ef7f'] = 'Überweisung ausstehend'; $_MODULE['<{mollie}prestashop>mollie_e2b7dec8fa4b498156dfee6e4c84b156'] = 'Diese Zahlungsart ist nicht verfügbar.'; $_MODULE['<{mollie}prestashop>mollie_96d0e2862e0167af0c2fd0c99fe6bc5d'] = 'Klicken Sie hier, um fortzufahren'; -$_MODULE['<{mollie}prestashop>mollie_540d9939d1ca9406e215ee3d78c76813'] = 'Diese Zahlungsart ist nur für Euros erhältlich.'; -$_MODULE['<{mollie}prestashop>mollie_1b2631119333d97dbda37f87e378b1e4'] = 'Bei der Bearbeitung Ihres Auftrags ist ein Fehler aufgetreten:'; $_MODULE['<{mollie}prestashop>mollie_11bab828edcc0a6d5c97cbf84d61e652'] = 'Eine Bestellung mit dieser Kennung existiert nicht.'; $_MODULE['<{mollie}prestashop>mollie_b34487c5f391f47b893ee3c61f8f9ab7'] = 'Wir haben keinen definitiven Zahlungsstatus erhalten. Sie werden informiert, sobald wir eine Bestätigung der Bank/des Händlers erhalten haben.'; $_MODULE['<{mollie}prestashop>mollie_c5ca36ad3232acc442f15016a22735da'] = 'Sie haben Ihre Zahlung annuliert.'; @@ -26,30 +24,31 @@ $_MODULE['<{mollie}prestashop>mollie_ebdf0f490b617d7efa3025d3625cec85'] = 'Willkommen zurück'; $_MODULE['<{mollie}prestashop>mollie_66dac2278292ff24611ef8a85bc94e0d'] = 'Wählen Sie Ihre Bank aus:'; $_MODULE['<{mollie}prestashop>mollie_e0aa021e21dddbd6d8cecec71e9cf564'] = 'OK'; -$_MODULE['<{mollie}prestashop>mollie_82ada3ecfa7c9965b4cee97b53f5e807'] = 'Zurück zur Homepage'; +$_MODULE['<{mollie}prestashop>mollie_b98a07c82f0078a1de7fc219fae480fc'] = 'Andere Zahlungsmethode'; $_MODULE['<{mollie}prestashop>mollie_35895cff7df70dab18783453e2bd241f'] = 'Zahlen mit %s'; $_MODULE['<{mollie}prestashop>mollie_cc16e103e202a48009df202d9525f75f'] = 'Diese Bestellung räckerstatten'; $_MODULE['<{mollie}prestashop>mollie_c5222afef6530f674d3acf82ba2ce9dc'] = 'Mollie Räckerstattung'; $_MODULE['<{mollie}prestashop>mollie_7064b25aa8a732a3db7f230c9867be19'] = 'Bestellung #%d Über die Mollie API räckerstatten.'; +$_MODULE['<{mollie}prestashop>mollie_e12682d2e0650f2783b22d956d2b947a'] = 'Dieser Bestellung wurde zurückerstattet!'; +$_MODULE['<{mollie}prestashop>mollie_9770d1f0124abb0d6a894cd79f8703b5'] = 'Wachten op betaling Mollie'; $_MODULE['<{mollie}prestashop>mollie_f91ab041fe9d6057740394b8b7903a0f'] = 'iDEAL'; -$_MODULE['<{mollie}prestashop>mollie_ec69c6714c5bff48849d579aa48d79fe'] = 'Kreditkarte'; -$_MODULE['<{mollie}prestashop>mollie_46794af42524fa65bce0ff7acdc7b753'] = 'Bancontact/Mister Cash'; +$_MODULE['<{mollie}prestashop>mollie_e7f9e382dc50889098cbe56f2554c77b'] = 'Credit card'; +$_MODULE['<{mollie}prestashop>mollie_870cf6bc77bbadd038aeb8d942c9cb18'] = 'Bancontact'; $_MODULE['<{mollie}prestashop>mollie_8ad65eb3da9995173280649f090218c3'] = 'SOFORT Banking'; $_MODULE['<{mollie}prestashop>mollie_c0db4214f9d7e1b846f4496e03e667d0'] = 'SEPA Direct Debit'; -$_MODULE['<{mollie}prestashop>mollie_d888edf7a058f9334ed26aed28eb9321'] = 'Belfius Direct Net'; +$_MODULE['<{mollie}prestashop>mollie_5aa515ce21e8de1ed7416dce455a151f'] = 'Belfius Pay Button'; $_MODULE['<{mollie}prestashop>mollie_d023ec040f79f1a9b2ac960b43785089'] = 'Bitcoin'; $_MODULE['<{mollie}prestashop>mollie_4aa65ea89e54d83bb2604c2cc89babc3'] = 'PODIUM Cadeaukaart'; +$_MODULE['<{mollie}prestashop>mollie_58c25c4b8b4382e37d89e0ef6bd625cf'] = 'Gift cards'; $_MODULE['<{mollie}prestashop>mollie_431647a0a8b2cd589c9fda9535f90d6d'] = 'Überweisung'; $_MODULE['<{mollie}prestashop>mollie_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; $_MODULE['<{mollie}prestashop>mollie_6abcd8eecb4f2abb6ccfe36ef7046ba0'] = 'paysafecard'; -$_MODULE['<{mollie}prestashop>mollie_22a98bd87df1286e65f5d242d46d99f5'] = 'MiniTix'; -$_MODULE['<{mollie}prestashop>mollie_ca1f78a35cab3b273acbcd0b5a427dd7'] = 'Micropayments'; +$_MODULE['<{mollie}prestashop>mollie_a81bd6195f1abce35fd03a870270100b'] = 'KBC/CBC Payment Button'; $_MODULE['<{mollie}prestashop>mollie_e67bb53936ea4d57c7cd28bf3615368c'] = 'Nicht lokalen Sprachgebrauch Browser senden'; $_MODULE['<{mollie}prestashop>mollie_06d0f2bbc04eda60887f0a077d3ea770'] = 'Senden locale für die Zahlung Bildschirm'; $_MODULE['<{mollie}prestashop>mollie_d861877da56b8b4ceb35c8cbfdf65bb4'] = 'groß'; $_MODULE['<{mollie}prestashop>mollie_fea087517c26fadd409bd4b9dc642555'] = 'normal'; $_MODULE['<{mollie}prestashop>mollie_a88f05b6c963e145a45b58c47cd42a41'] = 'ausblenden'; -$_MODULE['<{mollie}prestashop>mollie_199451198078814ce456d33991f5282c'] = 'Immer sichtbar'; $_MODULE['<{mollie}prestashop>mollie_85a692706bc7597b6e32bc1d354c138f'] = 'Auf Befehl'; $_MODULE['<{mollie}prestashop>mollie_ea9b19c6f2e9ef60b49778ab9396b293'] = 'Eigene Seite'; $_MODULE['<{mollie}prestashop>mollie_d35acbb07d2841712a937d5748e9bdc2'] = 'Zahlungsseite'; @@ -61,27 +60,9 @@ $_MODULE['<{mollie}prestashop>mollie_6311eb29dee3acc14071e0b1efb173f5'] = '%s Status:'; $_MODULE['<{mollie}prestashop>mollie_d438a1d96c6037fccad15d7594737a84'] = 'Visuelle Einstellungen:'; $_MODULE['<{mollie}prestashop>mollie_49259add73e416838e985a6bf4d0e571'] = 'Debug-Information:'; -$_MODULE['<{mollie}prestashop>mollie_b443dabdbefd9f9710276c8cfd0bc64f'] = 'API Schlössel:'; -$_MODULE['<{mollie}prestashop>mollie_d0042a700e9bdf79689d63ee6846dc0e'] = 'Beschreibung:'; -$_MODULE['<{mollie}prestashop>mollie_8d9143dfc520ed7d982d4e545c7bfc5e'] = 'Senden locale für die Zahlung Bildschirm'; -$_MODULE['<{mollie}prestashop>mollie_98cc90541a6b1e54b5352b3099bb5212'] = 'Bilder:'; -$_MODULE['<{mollie}prestashop>mollie_d0fece2050b631394934ccef96b4279b'] = 'Ausstellerliste:'; -$_MODULE['<{mollie}prestashop>mollie_caa578f91ac0075a1b4efe311b25e531'] = 'Css Datei:'; -$_MODULE['<{mollie}prestashop>mollie_7635c710b1b06102235e7a91a303f652'] = 'Fehler anzeigen:'; -$_MODULE['<{mollie}prestashop>mollie_d22c39fc0b11766a6ba91c68495b4e0e'] = 'Log Niveau:'; -$_MODULE['<{mollie}prestashop>mollie_3d20adab19137b17432d70b2b4aefef5'] = 'Einstellungen speichern:'; -$_MODULE['<{mollie}prestashop>mollie_9f4757e0e5dd959e2d51adc95d841f74'] = 'Ihren API Schlössel finden Sie in Ihrem %sMollie Profil%s; er beginnt mit \'test\' oder \'live\''; -$_MODULE['<{mollie}prestashop>mollie_a97d9b80c4861a067d6bf59d8c586800'] = 'Geben Sie hier eine Beschreibung ein. Bitte beachten Sie: Einige Zahlungsarten können eine Zeichenbeschränkung haben, halten Sie die Beschreibung am besten unter 29 Zeichen. Sie können die folgenden Variablen verwenden: {cart.id} {customer.firstname} {customer.lastname} {customer.company}'; -$_MODULE['<{mollie}prestashop>mollie_0b66ed0a3967f6cf9c0a5298b3a01731'] = 'Sollte das Plugin den %sStandort Ihres%s Shops zu schicken? Die Zahlung Bildschirm wird wie Ihre Website in derselben Sprache angezeigt werden. Standard-Mollie wird die Sprache unter Verwendung der Browser-Sprache erkennen.'; -$_MODULE['<{mollie}prestashop>mollie_f7a97136df639501521efb243047e0cf'] = 'Zahlungslogos beim Check-out groß, normal oder nicht anzeigen.'; -$_MODULE['<{mollie}prestashop>mollie_27db39558366d2a9001a0dec69eea4d6'] = 'Einige Zahlungsarten (z.B. iDEAL) haben eine Bankenliste. Diese Einstellung legt fest, wo diese angezeit wird.'; -$_MODULE['<{mollie}prestashop>mollie_20553a05467777c665629953d49ed143'] = 'Für standard Stylesheet freilassen. Sollte Dateipfad enthalten, wenn eingestellt.'; -$_MODULE['<{mollie}prestashop>mollie_4648fe2f09e6fd16b1f9023efc6a4b32'] = 'Hinweis: Sie können {BASE}, {THEME}, {CSS}, {MOBILE}, {MOBILE_CSS} und {OVERRIDE} für einfaches folder mapping verwenden.'; -$_MODULE['<{mollie}prestashop>mollie_37f9a8b20930c1dc7488b15872b6d36b'] = 'Die Aktivierung dieser Funktion zeigt eine Fehlermeldung auf der Titelseite an (wenn nötig). Nur für Debug!'; -$_MODULE['<{mollie}prestashop>mollie_7b1a43ca1db02df70068b12a4b82a7bc'] = 'Empfohlenes Niveau: Fehler. Auf \'alles\' einstellen, um eingehende Webhook requests zu Überwachen. %sView logs%s'; $_MODULE['<{mollie}prestashop>mollie_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; $_MODULE['<{mollie}prestashop>mollie_7c4e7ada50c8572336f872fced4d1852'] = 'Status für %s Zahlungen'; -$_MODULE['<{mollie}prestashop>mollie_5f812d3faa27a924d02c3f4f6781ee29'] = '%s Zahlungen erhalten Status \'%s\''; +$_MODULE['<{mollie}prestashop>mollie_bea3fae02ae079e541199ab6ffc2d1ad'] = '`%s` betalingen krijgen de status `%s`'; $_MODULE['<{mollie}prestashop>mollie_b2a2c5a69af7c04c5adc48261fb5dc13'] = 'E-Mails senden, wenn %s'; $_MODULE['<{mollie}prestashop>mollie_0511c3431d4e32ed4266fe943014d000'] = 'E-Mails senden, wenn Transaktionsstatus in %s geändert wird.'; $_MODULE['<{mollie}prestashop>mollie_1f93fc361bfc627c89a46e1b6c28df2b'] = 'Der API Schlössel beginnt mit \'test\' oder \'live\'.'; @@ -91,7 +72,42 @@ $_MODULE['<{mollie}prestashop>mollie_11a129cc7bad9bd365cfcbe632b2dda9'] = 'Ungültige Debut-Log-Einstellung.'; $_MODULE['<{mollie}prestashop>mollie_6ab1adfed768d989b47c908755fe677f'] = 'Die Konfigurierung wurde gespeichert!'; $_MODULE['<{mollie}prestashop>mollie_048ef1905ff33382d7660a68a6199305'] = 'Warnung: Update xml Datei konnte nicht von github abgerufen werden.'; -$_MODULE['<{mollie}prestashop>mollie_b7f73af7318580996a3889353b282827'] = 'Sie verwenden momentan Version %s. Wir empfehlen Ihnen dringenst, die neue Version %s! zu aktualisieren.'; $_MODULE['<{mollie}prestashop>mollie_711d42f319398490b32cd0e2f0b8ccb8'] = 'Warnung: Update xml Datei von github folgt einem unerwarteten Format.'; $_MODULE['<{mollie}prestashop>mollie_ef8cd60e5277895bcc20dbddda97fcc4'] = 'Mollie Zahlungsarten sind nur verfügbar, wenn Euros aktiviert sind.'; -$_MODULE['<{mollie}prestashop>mollie_cb3b74ced021286f61222ac247b0cbd2'] = 'Mister Cash'; +$_MODULE['<{mollie}prestashop>mollie_48fa0f621f79f451e58f200957da5b52'] = 'Kies uw bank'; +$_MODULE['<{mollie}prestashop>mollie_961f2247a2070bedff9f9cd8d64e2650'] = 'Kiezen'; +$_MODULE['<{mollie}prestashop>mollie_ea4788705e6873b424c65e91c2846b19'] = 'Annuleren'; +$_MODULE['<{mollie}prestashop>payment_484f5a79672cebe198ebdde45a1d672f'] = 'Geschenkverpackung'; +$_MODULE['<{mollie}prestashop>mollie_config_d876ff8da67c3731ae25d8335a4168b4'] = 'API Schlössel'; +$_MODULE['<{mollie}prestashop>mollie_config_9f4757e0e5dd959e2d51adc95d841f74'] = 'Ihren API Schlössel finden Sie in Ihrem %sMollie Profil%s; er beginnt mit \'test\' oder \'live\''; +$_MODULE['<{mollie}prestashop>mollie_config_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Beschreibung'; +$_MODULE['<{mollie}prestashop>mollie_config_a97d9b80c4861a067d6bf59d8c586800'] = 'Geben Sie hier eine Beschreibung ein. Bitte beachten Sie: Einige Zahlungsarten können eine Zeichenbeschränkung haben, halten Sie die Beschreibung am besten unter 29 Zeichen. Sie können die folgenden Variablen verwenden: {cart.id} {customer.firstname} {customer.lastname} {customer.company}'; +$_MODULE['<{mollie}prestashop>mollie_config_8d9143dfc520ed7d982d4e545c7bfc5e'] = 'Senden locale für die Zahlung Bildschirm'; +$_MODULE['<{mollie}prestashop>mollie_config_0b66ed0a3967f6cf9c0a5298b3a01731'] = 'Sollte das Plugin den %sStandort Ihres%s Shops zu schicken? Die Zahlung Bildschirm wird wie Ihre Website in derselben Sprache angezeigt werden. Standard-Mollie wird die Sprache unter Verwendung der Browser-Sprache erkennen.'; +$_MODULE['<{mollie}prestashop>mollie_config_7b3c976ecf21f19689caa1d9e2024124'] = 'Fügen Sie die Bestellung an Mollie-Metadaten hinzu, um eine Sicherungskopie sicherzustellen.'; +$_MODULE['<{mollie}prestashop>mollie_config_1b901e6ebc975d2c2a26ade0b1bf43fe'] = 'Dadurch senden Sie persönliche Daten Ihrer Kunden an Mollie. Überprüfen Sie die lokalen Gesetze, um Ihre Kunden darüber zu informieren.'; +$_MODULE['<{mollie}prestashop>mollie_config_8bfe6d183da9aedb9d813187c08a0983'] = 'Visuelle Einstellungen'; +$_MODULE['<{mollie}prestashop>mollie_config_fff0d600f8a0b5e19e88bfb821dd1157'] = 'Bilder'; +$_MODULE['<{mollie}prestashop>mollie_config_f7a97136df639501521efb243047e0cf'] = 'Zahlungslogos beim Check-out groß, normal oder nicht anzeigen'; +$_MODULE['<{mollie}prestashop>mollie_config_85fb708f31f585607247f8b868efafcc'] = 'Ausstellerliste'; +$_MODULE['<{mollie}prestashop>mollie_config_27db39558366d2a9001a0dec69eea4d6'] = 'Einige Zahlungsarten (z.B. iDEAL) haben eine Bankenliste. Diese Einstellung legt fest, wo diese angezeit wird.'; +$_MODULE['<{mollie}prestashop>mollie_config_1547ffc579d657d13fd5fedf12cbfae5'] = 'Css Datei'; +$_MODULE['<{mollie}prestashop>mollie_config_20553a05467777c665629953d49ed143'] = 'Für standard Stylesheet freilassen. Sollte Dateipfad enthalten, wenn eingestellt.'; +$_MODULE['<{mollie}prestashop>mollie_config_f1b3440d9481590b41220965432a5fa7'] = 'Hinweis: Sie können %s{BASE}%s, %s{THEME}%s, %s{CSS}%s, %s{MOBILE}%s, %s{MOBILE_CSS}%s und %s{OVERRIDE}%s für einfaches folder mapping verwenden.'; +$_MODULE['<{mollie}prestashop>mollie_config_dc6e4b439165a4e104c9f3cbfcfe2797'] = 'Debug-Information'; +$_MODULE['<{mollie}prestashop>mollie_config_500aa80d6aea3cc9701b566c5f92ed91'] = 'Fehler anzeigen'; +$_MODULE['<{mollie}prestashop>mollie_config_37f9a8b20930c1dc7488b15872b6d36b'] = 'Die Aktivierung dieser Funktion zeigt eine Fehlermeldung auf der Titelseite an (wenn nötig). Nur für Debug!'; +$_MODULE['<{mollie}prestashop>mollie_config_e5114c4b69585ba5883d456a74c1cd5d'] = 'Log Niveau'; +$_MODULE['<{mollie}prestashop>mollie_config_7b1a43ca1db02df70068b12a4b82a7bc'] = 'Empfohlenes Niveau: Fehler. Auf \'alles\' einstellen, um eingehende Webhook requests zu Überwachen. %sView logs%s'; +$_MODULE['<{mollie}prestashop>mollie_config_d4dccb8ca2dac4e53c01bd9954755332'] = 'Speichern'; +$_MODULE['<{mollie}prestashop>error_c453a4b8e8d98e82f35b67f433e3b4da'] = 'Zahlung'; +$_MODULE['<{mollie}prestashop>error_1e97d97a923eaddd810e056c828e99ea'] = 'Zahlungsfehler'; +$_MODULE['<{mollie}prestashop>error_a25c753ee3e4be15ec0daa5a40deb7b8'] = 'Bei der Bearbeitung Ihres Auftrags ist ein Fehler aufgetreten'; +$_MODULE['<{mollie}prestashop>error_47e1924c444fafe9fdfce444790f0ba9'] = ' Zurück zu Ihrem Einkaufswagen'; +$_MODULE['<{mollie}prestashop>mollie_return_ebdf0f490b617d7efa3025d3625cec85'] = 'Willkommen zurück'; +$_MODULE['<{mollie}prestashop>mollie_return_300225ee958b6350abc51805dab83c24'] = 'Einkauf fortsetzen'; +$_MODULE['<{mollie}prestashop>new_release_b7f73af7318580996a3889353b282827'] = 'Sie verwenden momentan Version %s. Wir empfehlen Ihnen dringenst, die neue Version %s! zu aktualisieren.'; +$_MODULE['<{mollie}prestashop>refund_729a51874fe901b092899e9e8b31c97a'] = 'Sind Sie sicher?'; +$_MODULE['<{mollie}prestashop>refund_ccaf4ee393d094ecde7f21b15fdf8f1f'] = 'Möchten Sie diese Bestellung wirklich erstatten?'; +$_MODULE['<{mollie}prestashop>refund_76f0ed934de85cc7131910b32ede7714'] = 'Zurückzahlen'; +$_MODULE['<{mollie}prestashop>refund_ea4788705e6873b424c65e91c2846b19'] = 'Abbrechen'; diff --git a/mollie/translations/en.php b/translations/en.php old mode 100755 new mode 100644 similarity index 53% rename from mollie/translations/en.php rename to translations/en.php index 8102e9e3c..19afd4c7b --- a/mollie/translations/en.php +++ b/translations/en.php @@ -13,8 +13,6 @@ $_MODULE['<{mollie}prestashop>mollie_542ba101e183aea6bc8dab5b1ec5ef7f'] = 'bankwire pending'; $_MODULE['<{mollie}prestashop>mollie_e2b7dec8fa4b498156dfee6e4c84b156'] = 'This payment method is not available.'; $_MODULE['<{mollie}prestashop>mollie_96d0e2862e0167af0c2fd0c99fe6bc5d'] = 'Click here to continue'; -$_MODULE['<{mollie}prestashop>mollie_540d9939d1ca9406e215ee3d78c76813'] = 'This payment method is only available for Euros.'; -$_MODULE['<{mollie}prestashop>mollie_1b2631119333d97dbda37f87e378b1e4'] = 'There was an error while processing your request:'; $_MODULE['<{mollie}prestashop>mollie_11bab828edcc0a6d5c97cbf84d61e652'] = 'The order with this id does not exist.'; $_MODULE['<{mollie}prestashop>mollie_b34487c5f391f47b893ee3c61f8f9ab7'] = 'We have not received a definite payment status. You will be notified as soon as we receive a confirmation of the bank/merchant.'; $_MODULE['<{mollie}prestashop>mollie_c5ca36ad3232acc442f15016a22735da'] = 'You have cancelled your payment.'; @@ -26,30 +24,31 @@ $_MODULE['<{mollie}prestashop>mollie_ebdf0f490b617d7efa3025d3625cec85'] = 'Welcome back'; $_MODULE['<{mollie}prestashop>mollie_66dac2278292ff24611ef8a85bc94e0d'] = 'Select your bank:'; $_MODULE['<{mollie}prestashop>mollie_e0aa021e21dddbd6d8cecec71e9cf564'] = 'OK'; -$_MODULE['<{mollie}prestashop>mollie_82ada3ecfa7c9965b4cee97b53f5e807'] = 'Return to the homepage'; +$_MODULE['<{mollie}prestashop>mollie_b98a07c82f0078a1de7fc219fae480fc'] = 'Different payment method'; $_MODULE['<{mollie}prestashop>mollie_35895cff7df70dab18783453e2bd241f'] = 'Pay with %s'; $_MODULE['<{mollie}prestashop>mollie_cc16e103e202a48009df202d9525f75f'] = 'Refund this order'; $_MODULE['<{mollie}prestashop>mollie_c5222afef6530f674d3acf82ba2ce9dc'] = 'Mollie refund'; $_MODULE['<{mollie}prestashop>mollie_7064b25aa8a732a3db7f230c9867be19'] = 'Refund order #%d through the Mollie API.'; +$_MODULE['<{mollie}prestashop>mollie_e12682d2e0650f2783b22d956d2b947a'] = 'The order has been refunded!'; +$_MODULE['<{mollie}prestashop>mollie_9770d1f0124abb0d6a894cd79f8703b5'] = 'Awaiting Mollie payment'; $_MODULE['<{mollie}prestashop>mollie_f91ab041fe9d6057740394b8b7903a0f'] = 'iDEAL'; -$_MODULE['<{mollie}prestashop>mollie_ec69c6714c5bff48849d579aa48d79fe'] = 'Creditcard'; -$_MODULE['<{mollie}prestashop>mollie_46794af42524fa65bce0ff7acdc7b753'] = 'Bancontact/Mister Cash'; +$_MODULE['<{mollie}prestashop>mollie_e7f9e382dc50889098cbe56f2554c77b'] = 'Credit card'; +$_MODULE['<{mollie}prestashop>mollie_870cf6bc77bbadd038aeb8d942c9cb18'] = 'Bancontact'; $_MODULE['<{mollie}prestashop>mollie_8ad65eb3da9995173280649f090218c3'] = 'SOFORT Banking'; $_MODULE['<{mollie}prestashop>mollie_c0db4214f9d7e1b846f4496e03e667d0'] = 'SEPA Direct Debit'; -$_MODULE['<{mollie}prestashop>mollie_d888edf7a058f9334ed26aed28eb9321'] = 'Belfius Direct Net'; +$_MODULE['<{mollie}prestashop>mollie_5aa515ce21e8de1ed7416dce455a151f'] = 'Belfius Pay Button'; $_MODULE['<{mollie}prestashop>mollie_d023ec040f79f1a9b2ac960b43785089'] = 'Bitcoin'; -$_MODULE['<{mollie}prestashop>mollie_4aa65ea89e54d83bb2604c2cc89babc3'] = 'PODIUM Cadeaukaart'; +$_MODULE['<{mollie}prestashop>mollie_4aa65ea89e54d83bb2604c2cc89babc3'] = 'PODIUM Gift card'; +$_MODULE['<{mollie}prestashop>mollie_58c25c4b8b4382e37d89e0ef6bd625cf'] = 'Gift cards'; $_MODULE['<{mollie}prestashop>mollie_431647a0a8b2cd589c9fda9535f90d6d'] = 'Bank transfer'; $_MODULE['<{mollie}prestashop>mollie_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; $_MODULE['<{mollie}prestashop>mollie_6abcd8eecb4f2abb6ccfe36ef7046ba0'] = 'paysafecard'; -$_MODULE['<{mollie}prestashop>mollie_22a98bd87df1286e65f5d242d46d99f5'] = 'MiniTix'; -$_MODULE['<{mollie}prestashop>mollie_ca1f78a35cab3b273acbcd0b5a427dd7'] = 'Micropayments'; +$_MODULE['<{mollie}prestashop>mollie_a81bd6195f1abce35fd03a870270100b'] = 'KBC/CBC Payment Button'; $_MODULE['<{mollie}prestashop>mollie_e67bb53936ea4d57c7cd28bf3615368c'] = 'Do not send locale use browser language'; $_MODULE['<{mollie}prestashop>mollie_06d0f2bbc04eda60887f0a077d3ea770'] = 'Send locale for payment screen'; $_MODULE['<{mollie}prestashop>mollie_d861877da56b8b4ceb35c8cbfdf65bb4'] = 'big'; $_MODULE['<{mollie}prestashop>mollie_fea087517c26fadd409bd4b9dc642555'] = 'normal'; $_MODULE['<{mollie}prestashop>mollie_a88f05b6c963e145a45b58c47cd42a41'] = 'hide'; -$_MODULE['<{mollie}prestashop>mollie_199451198078814ce456d33991f5282c'] = 'Always visible'; $_MODULE['<{mollie}prestashop>mollie_85a692706bc7597b6e32bc1d354c138f'] = 'On click'; $_MODULE['<{mollie}prestashop>mollie_ea9b19c6f2e9ef60b49778ab9396b293'] = 'Own page'; $_MODULE['<{mollie}prestashop>mollie_d35acbb07d2841712a937d5748e9bdc2'] = 'Payment page'; @@ -61,27 +60,9 @@ $_MODULE['<{mollie}prestashop>mollie_6311eb29dee3acc14071e0b1efb173f5'] = '%s statuses:'; $_MODULE['<{mollie}prestashop>mollie_d438a1d96c6037fccad15d7594737a84'] = 'Visual settings:'; $_MODULE['<{mollie}prestashop>mollie_49259add73e416838e985a6bf4d0e571'] = 'Debug info:'; -$_MODULE['<{mollie}prestashop>mollie_b443dabdbefd9f9710276c8cfd0bc64f'] = 'API key:'; -$_MODULE['<{mollie}prestashop>mollie_d0042a700e9bdf79689d63ee6846dc0e'] = 'Description:'; -$_MODULE['<{mollie}prestashop>mollie_8d9143dfc520ed7d982d4e545c7bfc5e'] = 'Send locale for payment screen'; -$_MODULE['<{mollie}prestashop>mollie_98cc90541a6b1e54b5352b3099bb5212'] = 'Images:'; -$_MODULE['<{mollie}prestashop>mollie_d0fece2050b631394934ccef96b4279b'] = 'Issuer list:'; -$_MODULE['<{mollie}prestashop>mollie_caa578f91ac0075a1b4efe311b25e531'] = 'Css file:'; -$_MODULE['<{mollie}prestashop>mollie_7635c710b1b06102235e7a91a303f652'] = 'Display errors:'; -$_MODULE['<{mollie}prestashop>mollie_d22c39fc0b11766a6ba91c68495b4e0e'] = 'Log level:'; -$_MODULE['<{mollie}prestashop>mollie_3d20adab19137b17432d70b2b4aefef5'] = 'Save settings:'; -$_MODULE['<{mollie}prestashop>mollie_9f4757e0e5dd959e2d51adc95d841f74'] = 'You can find your API key in your %sMollie Profile%s; it starts with test or live.'; -$_MODULE['<{mollie}prestashop>mollie_a97d9b80c4861a067d6bf59d8c586800'] = 'Enter a description here. Note: Payment methods may have a character limit, best keep the description under 29 characters. You can use the following variables: {cart.id} {customer.firstname} {customer.lastname} {customer.company}'; -$_MODULE['<{mollie}prestashop>mollie_0b66ed0a3967f6cf9c0a5298b3a01731'] = 'Should the plugin send the location of your shop? The payment screen will be displayed in the same language as your website. By default Mollie will detect the language by using the browser language.'; -$_MODULE['<{mollie}prestashop>mollie_f7a97136df639501521efb243047e0cf'] = 'Show big, normal or no payment method logos on checkout.'; -$_MODULE['<{mollie}prestashop>mollie_27db39558366d2a9001a0dec69eea4d6'] = 'Some payment methods (eg. iDEAL) have an issuer list. This setting specifies where it is shown.'; -$_MODULE['<{mollie}prestashop>mollie_20553a05467777c665629953d49ed143'] = 'Leave empty for default stylesheet. Should include file path when set.'; -$_MODULE['<{mollie}prestashop>mollie_4648fe2f09e6fd16b1f9023efc6a4b32'] = 'Hint: You can use {BASE}, {THEME}, {CSS}, {MOBILE}, {MOBILE_CSS} and {OVERRIDE} for easy folder mapping.'; -$_MODULE['<{mollie}prestashop>mollie_37f9a8b20930c1dc7488b15872b6d36b'] = 'Enabling this feature will display error messages (if any) on the front page. Use for debug purposes only!'; -$_MODULE['<{mollie}prestashop>mollie_7b1a43ca1db02df70068b12a4b82a7bc'] = 'Recommended level: Errors. Set to Everything to monitor incoming webhook requests. %sView logs%s'; $_MODULE['<{mollie}prestashop>mollie_c9cc8cce247e49bae79f15173ce97354'] = 'Save'; $_MODULE['<{mollie}prestashop>mollie_7c4e7ada50c8572336f872fced4d1852'] = 'Status for %s payments'; -$_MODULE['<{mollie}prestashop>mollie_5f812d3faa27a924d02c3f4f6781ee29'] = '%s payments get status \"%s\"'; +$_MODULE['<{mollie}prestashop>mollie_bea3fae02ae079e541199ab6ffc2d1ad'] = '`%s` payments get status `%s`'; $_MODULE['<{mollie}prestashop>mollie_b2a2c5a69af7c04c5adc48261fb5dc13'] = 'Send mails when %s'; $_MODULE['<{mollie}prestashop>mollie_0511c3431d4e32ed4266fe943014d000'] = 'Send mails when transaction status becomes %s?'; $_MODULE['<{mollie}prestashop>mollie_1f93fc361bfc627c89a46e1b6c28df2b'] = 'The API key needs to start with test or live.'; @@ -91,7 +72,42 @@ $_MODULE['<{mollie}prestashop>mollie_11a129cc7bad9bd365cfcbe632b2dda9'] = 'Invalid debug log setting.'; $_MODULE['<{mollie}prestashop>mollie_6ab1adfed768d989b47c908755fe677f'] = 'The configuration has been saved!'; $_MODULE['<{mollie}prestashop>mollie_048ef1905ff33382d7660a68a6199305'] = 'Warning: Could not retrieve update xml file from github.'; -$_MODULE['<{mollie}prestashop>mollie_b7f73af7318580996a3889353b282827'] = 'You are currently using version %s. We strongly recommend you to upgrade to the new version %s!'; $_MODULE['<{mollie}prestashop>mollie_711d42f319398490b32cd0e2f0b8ccb8'] = 'Warning: Update xml file from github follows an unexpected format.'; $_MODULE['<{mollie}prestashop>mollie_ef8cd60e5277895bcc20dbddda97fcc4'] = 'Mollie Payment Methods are only available when Euros are activated.'; -$_MODULE['<{mollie}prestashop>mollie_cb3b74ced021286f61222ac247b0cbd2'] = 'Mister Cash'; +$_MODULE['<{mollie}prestashop>mollie_48fa0f621f79f451e58f200957da5b52'] = 'Choose your bank'; +$_MODULE['<{mollie}prestashop>mollie_961f2247a2070bedff9f9cd8d64e2650'] = 'Choose'; +$_MODULE['<{mollie}prestashop>mollie_ea4788705e6873b424c65e91c2846b19'] = 'Cancel'; +$_MODULE['<{mollie}prestashop>payment_484f5a79672cebe198ebdde45a1d672f'] = 'Gift wrapping'; +$_MODULE['<{mollie}prestashop>mollie_config_d876ff8da67c3731ae25d8335a4168b4'] = 'API Key'; +$_MODULE['<{mollie}prestashop>mollie_config_9f4757e0e5dd959e2d51adc95d841f74'] = 'You can find your API key in your %sMollie Profile%s; it starts with test or live. '; +$_MODULE['<{mollie}prestashop>mollie_config_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description'; +$_MODULE['<{mollie}prestashop>mollie_config_a97d9b80c4861a067d6bf59d8c586800'] = 'Enter a description here. Note: Payment methods may have a character limit, best keep the description under 29 characters. '; +$_MODULE['<{mollie}prestashop>mollie_config_8d9143dfc520ed7d982d4e545c7bfc5e'] = 'Send locale for payment screen '; +$_MODULE['<{mollie}prestashop>mollie_config_0b66ed0a3967f6cf9c0a5298b3a01731'] = 'Should the plugin send the current webshop %slocale%s to Mollie. Mollie payment screens will be in the same language as your webshop. Mollie can also detect the language based on the user\'s browser language. '; +$_MODULE['<{mollie}prestashop>mollie_config_7b3c976ecf21f19689caa1d9e2024124'] = 'Send customer credentials to Mollie.'; +$_MODULE['<{mollie}prestashop>mollie_config_1b901e6ebc975d2c2a26ade0b1bf43fe'] = 'By enabling this option, the module will send your customer\'s data to Mollie. Please double-check if this complies with your local laws, policies and/or regulations.'; +$_MODULE['<{mollie}prestashop>mollie_config_8bfe6d183da9aedb9d813187c08a0983'] = 'Visual settings'; +$_MODULE['<{mollie}prestashop>mollie_config_fff0d600f8a0b5e19e88bfb821dd1157'] = 'Images'; +$_MODULE['<{mollie}prestashop>mollie_config_f7a97136df639501521efb243047e0cf'] = 'Show big, normal or no payment method logos on checkout.'; +$_MODULE['<{mollie}prestashop>mollie_config_85fb708f31f585607247f8b868efafcc'] = 'Issuer list'; +$_MODULE['<{mollie}prestashop>mollie_config_27db39558366d2a9001a0dec69eea4d6'] = 'Some payment methods (eg. iDEAL) have an issuer list. This setting specifies where it is shown.'; +$_MODULE['<{mollie}prestashop>mollie_config_1547ffc579d657d13fd5fedf12cbfae5'] = 'CSS file'; +$_MODULE['<{mollie}prestashop>mollie_config_20553a05467777c665629953d49ed143'] = 'Leave empty for default stylesheet. Should include file path when set.'; +$_MODULE['<{mollie}prestashop>mollie_config_f1b3440d9481590b41220965432a5fa7'] = 'Hint: You can use %s{BASE}%s, %s{THEME}%s, %s{CSS}%s, %s{MOBILE}%s, %s{MOBILE_CSS}%s and %s{OVERRIDE}%s for easy folder mapping.'; +$_MODULE['<{mollie}prestashop>mollie_config_dc6e4b439165a4e104c9f3cbfcfe2797'] = 'Debug level'; +$_MODULE['<{mollie}prestashop>mollie_config_500aa80d6aea3cc9701b566c5f92ed91'] = 'Display errors'; +$_MODULE['<{mollie}prestashop>mollie_config_37f9a8b20930c1dc7488b15872b6d36b'] = 'Enabling this feature will display error messages (if any) on the front page. Use for debug purposes only!'; +$_MODULE['<{mollie}prestashop>mollie_config_e5114c4b69585ba5883d456a74c1cd5d'] = 'Log level'; +$_MODULE['<{mollie}prestashop>mollie_config_7b1a43ca1db02df70068b12a4b82a7bc'] = 'Recommended level: Errors. Set to Everything to monitor incoming webhook requests. %sView logs%s'; +$_MODULE['<{mollie}prestashop>mollie_config_d4dccb8ca2dac4e53c01bd9954755332'] = 'Save settings'; +$_MODULE['<{mollie}prestashop>error_c453a4b8e8d98e82f35b67f433e3b4da'] = 'Payment'; +$_MODULE['<{mollie}prestashop>error_1e97d97a923eaddd810e056c828e99ea'] = 'Payment error'; +$_MODULE['<{mollie}prestashop>error_a25c753ee3e4be15ec0daa5a40deb7b8'] = 'An error occurred'; +$_MODULE['<{mollie}prestashop>error_47e1924c444fafe9fdfce444790f0ba9'] = 'Back to your shopping cart'; +$_MODULE['<{mollie}prestashop>mollie_return_ebdf0f490b617d7efa3025d3625cec85'] = 'Welcome back'; +$_MODULE['<{mollie}prestashop>mollie_return_300225ee958b6350abc51805dab83c24'] = 'Continue shopping'; +$_MODULE['<{mollie}prestashop>new_release_b7f73af7318580996a3889353b282827'] = 'You are currently using version %s. We strongly recommend you to upgrade to the new version %s!'; +$_MODULE['<{mollie}prestashop>refund_729a51874fe901b092899e9e8b31c97a'] = 'Are you sure?'; +$_MODULE['<{mollie}prestashop>refund_ccaf4ee393d094ecde7f21b15fdf8f1f'] = 'Are you sure you want to refund this order?'; +$_MODULE['<{mollie}prestashop>refund_76f0ed934de85cc7131910b32ede7714'] = 'Refund'; +$_MODULE['<{mollie}prestashop>refund_ea4788705e6873b424c65e91c2846b19'] = 'Cancel'; diff --git a/mollie/translations/fr.php b/translations/fr.php old mode 100755 new mode 100644 similarity index 53% rename from mollie/translations/fr.php rename to translations/fr.php index b45ca7ff8..7a4c45966 --- a/mollie/translations/fr.php +++ b/translations/fr.php @@ -13,8 +13,6 @@ $_MODULE['<{mollie}prestashop>mollie_542ba101e183aea6bc8dab5b1ec5ef7f'] = 'en attendant'; $_MODULE['<{mollie}prestashop>mollie_e2b7dec8fa4b498156dfee6e4c84b156'] = 'Ce methode de paiement n\'est pas disponible.'; $_MODULE['<{mollie}prestashop>mollie_96d0e2862e0167af0c2fd0c99fe6bc5d'] = 'Cliquez ici pour continuer'; -$_MODULE['<{mollie}prestashop>mollie_540d9939d1ca9406e215ee3d78c76813'] = 'Ce methode de paiement n\'est seulement disponible pour les Euros.'; -$_MODULE['<{mollie}prestashop>mollie_1b2631119333d97dbda37f87e378b1e4'] = 'Il y avait un erreur lors du traitement de votre demande:'; $_MODULE['<{mollie}prestashop>mollie_11bab828edcc0a6d5c97cbf84d61e652'] = 'La commande avec cette id n\'existe pas.'; $_MODULE['<{mollie}prestashop>mollie_b34487c5f391f47b893ee3c61f8f9ab7'] = 'Nous n\'avons pas encore reçu un statut de paiement définitif. Vous serez informé dès que nous recevrons une confirmation de la banque.'; $_MODULE['<{mollie}prestashop>mollie_c5ca36ad3232acc442f15016a22735da'] = 'Vous avez annulé votre paiement.'; @@ -26,30 +24,31 @@ $_MODULE['<{mollie}prestashop>mollie_ebdf0f490b617d7efa3025d3625cec85'] = 'Bienvenu'; $_MODULE['<{mollie}prestashop>mollie_66dac2278292ff24611ef8a85bc94e0d'] = 'Choisir une banque'; $_MODULE['<{mollie}prestashop>mollie_e0aa021e21dddbd6d8cecec71e9cf564'] = 'OK'; -$_MODULE['<{mollie}prestashop>mollie_82ada3ecfa7c9965b4cee97b53f5e807'] = 'Retour a la page d\'accuil'; +$_MODULE['<{mollie}prestashop>mollie_b98a07c82f0078a1de7fc219fae480fc'] = 'Autre méthode de paiement'; $_MODULE['<{mollie}prestashop>mollie_35895cff7df70dab18783453e2bd241f'] = 'Payer avec %s'; $_MODULE['<{mollie}prestashop>mollie_cc16e103e202a48009df202d9525f75f'] = 'Rembourser cette commande'; $_MODULE['<{mollie}prestashop>mollie_c5222afef6530f674d3acf82ba2ce9dc'] = 'Remboursement Mollie'; $_MODULE['<{mollie}prestashop>mollie_7064b25aa8a732a3db7f230c9867be19'] = 'Rembourse la commande #%d via l\'API Mollie.'; +$_MODULE['<{mollie}prestashop>mollie_e12682d2e0650f2783b22d956d2b947a'] = 'Cette commande a été remboursée!'; +$_MODULE['<{mollie}prestashop>mollie_9770d1f0124abb0d6a894cd79f8703b5'] = 'Wachten op betaling Mollie'; $_MODULE['<{mollie}prestashop>mollie_f91ab041fe9d6057740394b8b7903a0f'] = 'iDEAL'; -$_MODULE['<{mollie}prestashop>mollie_ec69c6714c5bff48849d579aa48d79fe'] = 'Carte de credit'; -$_MODULE['<{mollie}prestashop>mollie_46794af42524fa65bce0ff7acdc7b753'] = 'Bancontact/Mister Cash'; +$_MODULE['<{mollie}prestashop>mollie_e7f9e382dc50889098cbe56f2554c77b'] = 'Carte de crédit'; +$_MODULE['<{mollie}prestashop>mollie_870cf6bc77bbadd038aeb8d942c9cb18'] = 'Bancontact'; $_MODULE['<{mollie}prestashop>mollie_8ad65eb3da9995173280649f090218c3'] = 'SOFORT Banking'; $_MODULE['<{mollie}prestashop>mollie_c0db4214f9d7e1b846f4496e03e667d0'] = 'SEPA Direct Debit'; -$_MODULE['<{mollie}prestashop>mollie_d888edf7a058f9334ed26aed28eb9321'] = 'Belfius Direct Net'; +$_MODULE['<{mollie}prestashop>mollie_5aa515ce21e8de1ed7416dce455a151f'] = 'Belfius Pay Button'; $_MODULE['<{mollie}prestashop>mollie_d023ec040f79f1a9b2ac960b43785089'] = 'Bitcoin'; -$_MODULE['<{mollie}prestashop>mollie_4aa65ea89e54d83bb2604c2cc89babc3'] = 'PODIUM Cadeaukaart'; +$_MODULE['<{mollie}prestashop>mollie_4aa65ea89e54d83bb2604c2cc89babc3'] = 'PODIUM Cartes-cadeaux'; +$_MODULE['<{mollie}prestashop>mollie_58c25c4b8b4382e37d89e0ef6bd625cf'] = 'Cartes-cadeaux'; $_MODULE['<{mollie}prestashop>mollie_431647a0a8b2cd589c9fda9535f90d6d'] = 'Virement bancaire'; $_MODULE['<{mollie}prestashop>mollie_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; $_MODULE['<{mollie}prestashop>mollie_6abcd8eecb4f2abb6ccfe36ef7046ba0'] = 'paysafecard'; -$_MODULE['<{mollie}prestashop>mollie_22a98bd87df1286e65f5d242d46d99f5'] = 'MiniTix'; -$_MODULE['<{mollie}prestashop>mollie_ca1f78a35cab3b273acbcd0b5a427dd7'] = 'Micropaiements'; +$_MODULE['<{mollie}prestashop>mollie_a81bd6195f1abce35fd03a870270100b'] = 'KBC/CBC Payment Button'; $_MODULE['<{mollie}prestashop>mollie_e67bb53936ea4d57c7cd28bf3615368c'] = 'Ne pas envoyer la langue utilisation du navigateur local'; $_MODULE['<{mollie}prestashop>mollie_06d0f2bbc04eda60887f0a077d3ea770'] = 'Envoyer boutique locale'; $_MODULE['<{mollie}prestashop>mollie_d861877da56b8b4ceb35c8cbfdf65bb4'] = 'grand'; $_MODULE['<{mollie}prestashop>mollie_fea087517c26fadd409bd4b9dc642555'] = 'ordinaire'; $_MODULE['<{mollie}prestashop>mollie_a88f05b6c963e145a45b58c47cd42a41'] = 'aucune'; -$_MODULE['<{mollie}prestashop>mollie_199451198078814ce456d33991f5282c'] = 'Toujours visible'; $_MODULE['<{mollie}prestashop>mollie_85a692706bc7597b6e32bc1d354c138f'] = 'Visible après avoir sélectionné le mode de paiement'; $_MODULE['<{mollie}prestashop>mollie_ea9b19c6f2e9ef60b49778ab9396b293'] = 'Afficher sur une feuille séparée'; $_MODULE['<{mollie}prestashop>mollie_d35acbb07d2841712a937d5748e9bdc2'] = 'Affichage sur l\'écran de paiement Mollie'; @@ -61,27 +60,9 @@ $_MODULE['<{mollie}prestashop>mollie_6311eb29dee3acc14071e0b1efb173f5'] = 'Statuts %s:'; $_MODULE['<{mollie}prestashop>mollie_d438a1d96c6037fccad15d7594737a84'] = 'Paramètres visuels:'; $_MODULE['<{mollie}prestashop>mollie_49259add73e416838e985a6bf4d0e571'] = 'Infos de debug:'; -$_MODULE['<{mollie}prestashop>mollie_b443dabdbefd9f9710276c8cfd0bc64f'] = 'Clé API'; -$_MODULE['<{mollie}prestashop>mollie_d0042a700e9bdf79689d63ee6846dc0e'] = 'Description:'; -$_MODULE['<{mollie}prestashop>mollie_8d9143dfc520ed7d982d4e545c7bfc5e'] = 'Envoyer locale pour l\'écran de paiement'; -$_MODULE['<{mollie}prestashop>mollie_98cc90541a6b1e54b5352b3099bb5212'] = 'Images:'; -$_MODULE['<{mollie}prestashop>mollie_d0fece2050b631394934ccef96b4279b'] = 'Liste de banques:'; -$_MODULE['<{mollie}prestashop>mollie_caa578f91ac0075a1b4efe311b25e531'] = 'Fichier css:'; -$_MODULE['<{mollie}prestashop>mollie_7635c710b1b06102235e7a91a303f652'] = 'Montrer les erreurs:'; -$_MODULE['<{mollie}prestashop>mollie_d22c39fc0b11766a6ba91c68495b4e0e'] = 'Niveau d\'accréditation:'; -$_MODULE['<{mollie}prestashop>mollie_3d20adab19137b17432d70b2b4aefef5'] = 'Sauvgarder les paramètres:'; -$_MODULE['<{mollie}prestashop>mollie_9f4757e0e5dd959e2d51adc95d841f74'] = 'Vous trouvez votre clé API dans votre %sprofil Mollie% s, il commence par test ou par live.'; -$_MODULE['<{mollie}prestashop>mollie_a97d9b80c4861a067d6bf59d8c586800'] = 'Entrez une description ici. Remarque: les méthodes de paiement peuvent avoir une limite de caractères, mieux garder la description sous les 29 caractères. Vous pouvez utiliser les variables suivantes: {cart.id} {customer.firstname} {customer.lastname} {customer.company}'; -$_MODULE['<{mollie}prestashop>mollie_0b66ed0a3967f6cf9c0a5298b3a01731'] = 'Si le plugin envoyer %slocale%s de votre boutique ? L\'écran de paiement sera affiché comme votre site web dans la même langue. Standard Mollie détecte la langue en utilisant la langue du navigateur.'; -$_MODULE['<{mollie}prestashop>mollie_f7a97136df639501521efb243047e0cf'] = 'Montrer des grandes, normales ou aucune images a la caisse.'; -$_MODULE['<{mollie}prestashop>mollie_27db39558366d2a9001a0dec69eea4d6'] = 'Certaines méthodes de paiement (par exemple iDEAL) ont une liste de banques. Ce paramètre indique où il est représenté.'; -$_MODULE['<{mollie}prestashop>mollie_20553a05467777c665629953d49ed143'] = 'Laissez vide pour le style défaut. Sinon, incluez le chemin du fichier.'; -$_MODULE['<{mollie}prestashop>mollie_4648fe2f09e6fd16b1f9023efc6a4b32'] = 'Astuce: Vous pouvez utiliser {BASE}, {THEME}, {CSS}, {MOBILE}, {MOBILE_CSS} et {OVERRIDE} pour accès facile aux dossiers.'; -$_MODULE['<{mollie}prestashop>mollie_37f9a8b20930c1dc7488b15872b6d36b'] = 'L\'activation de cette fonction affiche des messages d\'erreur (le cas échéant) sur les pages publics. Utilisez uniquement à des fins de débogage!'; -$_MODULE['<{mollie}prestashop>mollie_7b1a43ca1db02df70068b12a4b82a7bc'] = 'Niveau recommandé: Erreurs. Choisissez Tout pour surveiller l\'activité du webhook.'; $_MODULE['<{mollie}prestashop>mollie_c9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder'; $_MODULE['<{mollie}prestashop>mollie_7c4e7ada50c8572336f872fced4d1852'] = 'Statut pour les paiaments %ss:'; -$_MODULE['<{mollie}prestashop>mollie_5f812d3faa27a924d02c3f4f6781ee29'] = 'Les paiements %s auront le statut \"%s\"'; +$_MODULE['<{mollie}prestashop>mollie_bea3fae02ae079e541199ab6ffc2d1ad'] = '`%s` betalingen krijgen de status `%s`'; $_MODULE['<{mollie}prestashop>mollie_b2a2c5a69af7c04c5adc48261fb5dc13'] = 'Envoier un mail pour %s'; $_MODULE['<{mollie}prestashop>mollie_0511c3431d4e32ed4266fe943014d000'] = 'Envoier un mail quand le statut devient %s'; $_MODULE['<{mollie}prestashop>mollie_1f93fc361bfc627c89a46e1b6c28df2b'] = 'Les clés API commencent par test ou live.'; @@ -91,7 +72,42 @@ $_MODULE['<{mollie}prestashop>mollie_11a129cc7bad9bd365cfcbe632b2dda9'] = 'Réglage accreditage non valide.'; $_MODULE['<{mollie}prestashop>mollie_6ab1adfed768d989b47c908755fe677f'] = 'La configuration a été sauvegardé!'; $_MODULE['<{mollie}prestashop>mollie_048ef1905ff33382d7660a68a6199305'] = 'Avertissement: Impossible de récupérer le fichier xml de mise à jour de github.'; -$_MODULE['<{mollie}prestashop>mollie_b7f73af7318580996a3889353b282827'] = 'Vous utilisez actuellement la version %s. Nous vous recommandons fortement de mettre à niveau vers la nouvelle version %s!'; $_MODULE['<{mollie}prestashop>mollie_711d42f319398490b32cd0e2f0b8ccb8'] = 'Avertissement: fichier de mise à jour de xml de github suit un format inattendu.'; $_MODULE['<{mollie}prestashop>mollie_ef8cd60e5277895bcc20dbddda97fcc4'] = 'Modes de paiement Mollie sont disponibles uniquement lorsque Euros sont activés.'; -$_MODULE['<{mollie}prestashop>mollie_cb3b74ced021286f61222ac247b0cbd2'] = 'Mister Cash'; +$_MODULE['<{mollie}prestashop>mollie_48fa0f621f79f451e58f200957da5b52'] = 'Choisir une banque'; +$_MODULE['<{mollie}prestashop>mollie_961f2247a2070bedff9f9cd8d64e2650'] = 'Continuer'; +$_MODULE['<{mollie}prestashop>mollie_ea4788705e6873b424c65e91c2846b19'] = 'Annuler'; +$_MODULE['<{mollie}prestashop>payment_484f5a79672cebe198ebdde45a1d672f'] = 'Emballage cadeau'; +$_MODULE['<{mollie}prestashop>mollie_config_d876ff8da67c3731ae25d8335a4168b4'] = 'Clé API'; +$_MODULE['<{mollie}prestashop>mollie_config_9f4757e0e5dd959e2d51adc95d841f74'] = 'Vous trouvez votre clé API dans votre %sprofil Mollie% s, il commence par test ou par live.'; +$_MODULE['<{mollie}prestashop>mollie_config_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description'; +$_MODULE['<{mollie}prestashop>mollie_config_a97d9b80c4861a067d6bf59d8c586800'] = 'Entrez une description ici. Remarque: les méthodes de paiement peuvent avoir une limite de caractères, mieux garder la description sous les 29 caractères. Vous pouvez utiliser les variables suivantes: {cart.id} {customer.firstname} {customer.lastname} {customer.company}'; +$_MODULE['<{mollie}prestashop>mollie_config_8d9143dfc520ed7d982d4e545c7bfc5e'] = 'Envoyer locale pour l\'écran de paiement'; +$_MODULE['<{mollie}prestashop>mollie_config_0b66ed0a3967f6cf9c0a5298b3a01731'] = 'Si le plugin envoyer %slocale%s de votre boutique ? L\'écran de paiement sera affiché comme votre site web dans la même langue. Standard Mollie détecte la langue en utilisant la langue du navigateur.'; +$_MODULE['<{mollie}prestashop>mollie_config_7b3c976ecf21f19689caa1d9e2024124'] = 'Ajoutez la commande aux métadonnées de Mollie pour assurer une sauvegarde.'; +$_MODULE['<{mollie}prestashop>mollie_config_1b901e6ebc975d2c2a26ade0b1bf43fe'] = 'En activant ceci, vous envoyez des données personnelles de vos clients à Mollie. Vérifiez la législation locale pour informer vos clients à ce sujet.'; +$_MODULE['<{mollie}prestashop>mollie_config_8bfe6d183da9aedb9d813187c08a0983'] = 'Paramètres visuels'; +$_MODULE['<{mollie}prestashop>mollie_config_fff0d600f8a0b5e19e88bfb821dd1157'] = 'Images'; +$_MODULE['<{mollie}prestashop>mollie_config_f7a97136df639501521efb243047e0cf'] = 'Montrer des grandes, normales ou aucune images a la caisse.'; +$_MODULE['<{mollie}prestashop>mollie_config_85fb708f31f585607247f8b868efafcc'] = 'Liste de banques'; +$_MODULE['<{mollie}prestashop>mollie_config_27db39558366d2a9001a0dec69eea4d6'] = 'Certaines méthodes de paiement (par exemple iDEAL) ont une liste de banques. Ce paramètre indique où il est représenté.'; +$_MODULE['<{mollie}prestashop>mollie_config_1547ffc579d657d13fd5fedf12cbfae5'] = 'Fichier css'; +$_MODULE['<{mollie}prestashop>mollie_config_20553a05467777c665629953d49ed143'] = 'Laissez vide pour le style défaut. Sinon, incluez le chemin du fichier.'; +$_MODULE['<{mollie}prestashop>mollie_config_f1b3440d9481590b41220965432a5fa7'] = 'Astuce: Vous pouvez utiliser %s{BASE}%s, %s{THEME}%s, %s{CSS}%s, %s{MOBILE}%s, %s{MOBILE_CSS}%s et %s{OVERRIDE}%s pour accès facile aux dossiers.'; +$_MODULE['<{mollie}prestashop>mollie_config_dc6e4b439165a4e104c9f3cbfcfe2797'] = 'Infos de debug'; +$_MODULE['<{mollie}prestashop>mollie_config_500aa80d6aea3cc9701b566c5f92ed91'] = 'Montrer les erreurs'; +$_MODULE['<{mollie}prestashop>mollie_config_37f9a8b20930c1dc7488b15872b6d36b'] = 'L\'activation de cette fonction affiche des messages d\'erreur (le cas échéant) sur les pages publics. Utilisez uniquement à des fins de débogage!'; +$_MODULE['<{mollie}prestashop>mollie_config_e5114c4b69585ba5883d456a74c1cd5d'] = 'Niveau d\'accréditation'; +$_MODULE['<{mollie}prestashop>mollie_config_7b1a43ca1db02df70068b12a4b82a7bc'] = 'Niveau recommandé: Erreurs. Choisissez Tout pour surveiller l\'activité du webhook. %sView logs%s'; +$_MODULE['<{mollie}prestashop>mollie_config_d4dccb8ca2dac4e53c01bd9954755332'] = 'Sauvegarder'; +$_MODULE['<{mollie}prestashop>error_c453a4b8e8d98e82f35b67f433e3b4da'] = 'Betaling'; +$_MODULE['<{mollie}prestashop>error_1e97d97a923eaddd810e056c828e99ea'] = 'Erreur de paiement'; +$_MODULE['<{mollie}prestashop>error_a25c753ee3e4be15ec0daa5a40deb7b8'] = 'Une erreur est survenue'; +$_MODULE['<{mollie}prestashop>error_47e1924c444fafe9fdfce444790f0ba9'] = 'Retour à votre panier'; +$_MODULE['<{mollie}prestashop>mollie_return_ebdf0f490b617d7efa3025d3625cec85'] = 'Bienvenu'; +$_MODULE['<{mollie}prestashop>mollie_return_300225ee958b6350abc51805dab83c24'] = 'Cliquez ici pour continuer'; +$_MODULE['<{mollie}prestashop>new_release_b7f73af7318580996a3889353b282827'] = 'Vous utilisez actuellement la version %s. Nous vous recommandons fortement de mettre à niveau vers la nouvelle version %s!'; +$_MODULE['<{mollie}prestashop>refund_729a51874fe901b092899e9e8b31c97a'] = 'Êtes-vous sûr?'; +$_MODULE['<{mollie}prestashop>refund_ccaf4ee393d094ecde7f21b15fdf8f1f'] = 'Êtes-vous sûr de vouloir rembourser cette commande?'; +$_MODULE['<{mollie}prestashop>refund_76f0ed934de85cc7131910b32ede7714'] = 'Rembourser'; +$_MODULE['<{mollie}prestashop>refund_ea4788705e6873b424c65e91c2846b19'] = 'Annuler'; diff --git a/translations/index.php b/translations/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/translations/index.php @@ -0,0 +1,11 @@ +mollie_542ba101e183aea6bc8dab5b1ec5ef7f'] = 'open'; $_MODULE['<{mollie}prestashop>mollie_e2b7dec8fa4b498156dfee6e4c84b156'] = 'Deze betaalmethode is niet beschikbaar'; $_MODULE['<{mollie}prestashop>mollie_96d0e2862e0167af0c2fd0c99fe6bc5d'] = 'Klik hier om verder te gaan'; -$_MODULE['<{mollie}prestashop>mollie_540d9939d1ca9406e215ee3d78c76813'] = 'Deze betaalmethode is alleen beschikbaar in Euros'; -$_MODULE['<{mollie}prestashop>mollie_1b2631119333d97dbda37f87e378b1e4'] = 'Er is een fout opgetreden:'; +$_MODULE['<{mollie}prestashop>mollie_540d9939d1ca9406e215ee3d78c76813'] = 'Deze betaalmethode is alleen beschikbaar voor euro\'s.'; +$_MODULE['<{mollie}prestashop>mollie_1b2631119333d97dbda37f87e378b1e4'] = 'Er is een probleem opgetreden bij het verwerken van dit betaalverzoek:'; $_MODULE['<{mollie}prestashop>mollie_11bab828edcc0a6d5c97cbf84d61e652'] = 'De bestelling met dit id kon niet gevonden worden.'; $_MODULE['<{mollie}prestashop>mollie_b34487c5f391f47b893ee3c61f8f9ab7'] = 'Er is nog geen definitieve betaalstatus bekend. U wordt op de hoogte gesteld zodra de bank de status doorgeeft.'; -$_MODULE['<{mollie}prestashop>mollie_c5ca36ad3232acc442f15016a22735da'] = 'Uw betaling is geannuleerd.'; $_MODULE['<{mollie}prestashop>mollie_57bc999b3b730ead92ac7243fe254a2a'] = 'Helaas is uw betaling verlopen.'; $_MODULE['<{mollie}prestashop>mollie_3602f6d5ece34fdbd4ffe0a47f1a2ba4'] = 'Dank u wel, uw betaling is ontvangen.'; $_MODULE['<{mollie}prestashop>mollie_7352a401b3c23b2966c68bc9ab97fa06'] = 'De transactie heeft een onverwachte status.'; @@ -26,30 +25,32 @@ $_MODULE['<{mollie}prestashop>mollie_ebdf0f490b617d7efa3025d3625cec85'] = 'Welkom terug'; $_MODULE['<{mollie}prestashop>mollie_66dac2278292ff24611ef8a85bc94e0d'] = 'Kies uw bank:'; $_MODULE['<{mollie}prestashop>mollie_e0aa021e21dddbd6d8cecec71e9cf564'] = 'Oke'; -$_MODULE['<{mollie}prestashop>mollie_82ada3ecfa7c9965b4cee97b53f5e807'] = 'Terug naar de homepage'; +$_MODULE['<{mollie}prestashop>mollie_b98a07c82f0078a1de7fc219fae480fc'] = 'Andere betaalmethode'; $_MODULE['<{mollie}prestashop>mollie_35895cff7df70dab18783453e2bd241f'] = 'Betalen via %s'; $_MODULE['<{mollie}prestashop>mollie_cc16e103e202a48009df202d9525f75f'] = 'Bestelling terugbetalen'; $_MODULE['<{mollie}prestashop>mollie_c5222afef6530f674d3acf82ba2ce9dc'] = 'Mollie Terugbetalingen'; -$_MODULE['<{mollie}prestashop>mollie_7064b25aa8a732a3db7f230c9867be19'] = 'Betaal bestelling #%d terug via de Mollie API'; +$_MODULE['<{mollie}prestashop>mollie_7064b25aa8a732a3db7f230c9867be19'] = 'Betaal bestelling #%d volledig terugbetalen via de Mollie API'; +$_MODULE['<{mollie}prestashop>mollie_e12682d2e0650f2783b22d956d2b947a'] = 'Deze bestelling is terugbetaald!'; +$_MODULE['<{mollie}prestashop>mollie_95be87afb2734075cf345b633e1384ec'] = 'Mollie B.V. boekt het bedrag de volgende werkdag terug naar uw klant.'; +$_MODULE['<{mollie}prestashop>mollie_9770d1f0124abb0d6a894cd79f8703b5'] = 'Wachten op betaling Mollie'; $_MODULE['<{mollie}prestashop>mollie_f91ab041fe9d6057740394b8b7903a0f'] = 'iDEAL'; -$_MODULE['<{mollie}prestashop>mollie_ec69c6714c5bff48849d579aa48d79fe'] = 'Creditcard'; -$_MODULE['<{mollie}prestashop>mollie_46794af42524fa65bce0ff7acdc7b753'] = 'Bancontact/Mister Cash'; +$_MODULE['<{mollie}prestashop>mollie_e7f9e382dc50889098cbe56f2554c77b'] = 'Credit card'; +$_MODULE['<{mollie}prestashop>mollie_870cf6bc77bbadd038aeb8d942c9cb18'] = 'Bancontact'; $_MODULE['<{mollie}prestashop>mollie_8ad65eb3da9995173280649f090218c3'] = 'SOFORT Banking'; $_MODULE['<{mollie}prestashop>mollie_c0db4214f9d7e1b846f4496e03e667d0'] = 'SEPA Direct Debit'; -$_MODULE['<{mollie}prestashop>mollie_d888edf7a058f9334ed26aed28eb9321'] = 'Belfius Direct Net'; +$_MODULE['<{mollie}prestashop>mollie_5aa515ce21e8de1ed7416dce455a151f'] = 'Belfius Pay Button'; $_MODULE['<{mollie}prestashop>mollie_d023ec040f79f1a9b2ac960b43785089'] = 'Bitcoin'; $_MODULE['<{mollie}prestashop>mollie_4aa65ea89e54d83bb2604c2cc89babc3'] = 'PODIUM Cadeaukaart'; +$_MODULE['<{mollie}prestashop>mollie_58c25c4b8b4382e37d89e0ef6bd625cf'] = 'Gift cards'; $_MODULE['<{mollie}prestashop>mollie_431647a0a8b2cd589c9fda9535f90d6d'] = 'Overboeking'; $_MODULE['<{mollie}prestashop>mollie_ad69e733ebae8d264bccaa38d68830e8'] = 'PayPal'; $_MODULE['<{mollie}prestashop>mollie_6abcd8eecb4f2abb6ccfe36ef7046ba0'] = 'paysafecard'; -$_MODULE['<{mollie}prestashop>mollie_22a98bd87df1286e65f5d242d46d99f5'] = 'MiniTix'; -$_MODULE['<{mollie}prestashop>mollie_ca1f78a35cab3b273acbcd0b5a427dd7'] = 'Micropayments'; +$_MODULE['<{mollie}prestashop>mollie_a81bd6195f1abce35fd03a870270100b'] = 'KBC/CBC Payment Button'; $_MODULE['<{mollie}prestashop>mollie_e67bb53936ea4d57c7cd28bf3615368c'] = 'Stuur geen locale, gebruik browser taal'; $_MODULE['<{mollie}prestashop>mollie_06d0f2bbc04eda60887f0a077d3ea770'] = 'Stuur webwinkel locale'; $_MODULE['<{mollie}prestashop>mollie_d861877da56b8b4ceb35c8cbfdf65bb4'] = 'groot'; $_MODULE['<{mollie}prestashop>mollie_fea087517c26fadd409bd4b9dc642555'] = 'normaal'; $_MODULE['<{mollie}prestashop>mollie_a88f05b6c963e145a45b58c47cd42a41'] = 'geen'; -$_MODULE['<{mollie}prestashop>mollie_199451198078814ce456d33991f5282c'] = 'Altijd zichtbaar'; $_MODULE['<{mollie}prestashop>mollie_85a692706bc7597b6e32bc1d354c138f'] = 'Zichtbaar na klikken betaalmethode'; $_MODULE['<{mollie}prestashop>mollie_ea9b19c6f2e9ef60b49778ab9396b293'] = 'Tonen op aparte pagina'; $_MODULE['<{mollie}prestashop>mollie_d35acbb07d2841712a937d5748e9bdc2'] = 'Tonen op Mollie betaalpagina'; @@ -61,27 +62,9 @@ $_MODULE['<{mollie}prestashop>mollie_6311eb29dee3acc14071e0b1efb173f5'] = 'Status \"%s\":'; $_MODULE['<{mollie}prestashop>mollie_d438a1d96c6037fccad15d7594737a84'] = 'Visuele instellingen:'; $_MODULE['<{mollie}prestashop>mollie_49259add73e416838e985a6bf4d0e571'] = 'Debug informatie:'; -$_MODULE['<{mollie}prestashop>mollie_b443dabdbefd9f9710276c8cfd0bc64f'] = 'API Sleutel:'; -$_MODULE['<{mollie}prestashop>mollie_d0042a700e9bdf79689d63ee6846dc0e'] = 'Omschrijving:'; -$_MODULE['<{mollie}prestashop>mollie_8d9143dfc520ed7d982d4e545c7bfc5e'] = 'Stuur locale voor betaalscherm'; -$_MODULE['<{mollie}prestashop>mollie_98cc90541a6b1e54b5352b3099bb5212'] = 'Afbeeldingen:'; -$_MODULE['<{mollie}prestashop>mollie_d0fece2050b631394934ccef96b4279b'] = 'Bankenlijst:'; -$_MODULE['<{mollie}prestashop>mollie_caa578f91ac0075a1b4efe311b25e531'] = 'Css bestand:'; -$_MODULE['<{mollie}prestashop>mollie_7635c710b1b06102235e7a91a303f652'] = 'Foutmeldingen weergeven:'; -$_MODULE['<{mollie}prestashop>mollie_d22c39fc0b11766a6ba91c68495b4e0e'] = 'Log niveau:'; -$_MODULE['<{mollie}prestashop>mollie_3d20adab19137b17432d70b2b4aefef5'] = 'Instellingen opslaan:'; -$_MODULE['<{mollie}prestashop>mollie_9f4757e0e5dd959e2d51adc95d841f74'] = 'U vindt uw API Sleutel in uw %sMollie Profiel%s; de sleutel begint met test_ of live_.'; -$_MODULE['<{mollie}prestashop>mollie_a97d9b80c4861a067d6bf59d8c586800'] = 'Vul hier een omschrijving in. Sommige betaalmethoden kunnen een karakterlimiet hebben; het is verstandig om 29 tekens of minder te gebruiken. U kunt hier de volgende variablen gebruiken: {cart.id} {customer.firstname} {customer.lastname} {customer.company}'; -$_MODULE['<{mollie}prestashop>mollie_0b66ed0a3967f6cf9c0a5298b3a01731'] = 'Moet de plugin de %slocale%s van uw webshop sturen? Het betaalscherm zal dan in dezelfde taal als uw website worden weergegeven. Standaard zal Mollie de taal detecteren aan de hand van de browser taal.'; -$_MODULE['<{mollie}prestashop>mollie_f7a97136df639501521efb243047e0cf'] = 'Geef grote, normale of geen afbeeldingen weer bij het afrekenen.'; -$_MODULE['<{mollie}prestashop>mollie_27db39558366d2a9001a0dec69eea4d6'] = 'Sommige betaalmethoden (zoals iDEAL) hebben een bankenlijst. Deze instelling bepaalt waar die lijst zichtbaar is.'; -$_MODULE['<{mollie}prestashop>mollie_20553a05467777c665629953d49ed143'] = 'Laat leeg voor standaard vormgeving.'; -$_MODULE['<{mollie}prestashop>mollie_4648fe2f09e6fd16b1f9023efc6a4b32'] = 'Hint: Gebruik {BASE}, {THEME}, {CSS}, {MOBILE}, {MOBILE_CSS} of {OVERRIDE} voor de standaard bestandsmappen.'; -$_MODULE['<{mollie}prestashop>mollie_37f9a8b20930c1dc7488b15872b6d36b'] = 'Door deze optie aan te zetten worden foutmeldingen op de voorpagina weergegeven. Alleen voor debug!'; -$_MODULE['<{mollie}prestashop>mollie_7b1a43ca1db02df70068b12a4b82a7bc'] = 'Aangeraden niveau: Errors. Zet op alles om de webhook requests te monitoren. %sBekijk logs%s'; $_MODULE['<{mollie}prestashop>mollie_c9cc8cce247e49bae79f15173ce97354'] = 'Opslaan'; $_MODULE['<{mollie}prestashop>mollie_7c4e7ada50c8572336f872fced4d1852'] = 'Status voor betaling %s'; -$_MODULE['<{mollie}prestashop>mollie_5f812d3faa27a924d02c3f4f6781ee29'] = 'Betalingen die %s zijn, krijgen de status: \"%s\"'; +$_MODULE['<{mollie}prestashop>mollie_bea3fae02ae079e541199ab6ffc2d1ad'] = '`%s` betalingen krijgen de status `%s`'; $_MODULE['<{mollie}prestashop>mollie_b2a2c5a69af7c04c5adc48261fb5dc13'] = 'Verzend mail bij %s'; $_MODULE['<{mollie}prestashop>mollie_0511c3431d4e32ed4266fe943014d000'] = 'Verstuur een email als de status in %s verandert?'; $_MODULE['<{mollie}prestashop>mollie_1f93fc361bfc627c89a46e1b6c28df2b'] = 'De API Sleutel dient met test_ of live_ te beginnen.'; @@ -91,7 +74,42 @@ $_MODULE['<{mollie}prestashop>mollie_11a129cc7bad9bd365cfcbe632b2dda9'] = 'Ongeldige debug log instelling.'; $_MODULE['<{mollie}prestashop>mollie_6ab1adfed768d989b47c908755fe677f'] = 'De configuratie is opgeslagen!'; $_MODULE['<{mollie}prestashop>mollie_048ef1905ff33382d7660a68a6199305'] = 'Waarschuwing: Kon de update XML van github niet ophalen.'; -$_MODULE['<{mollie}prestashop>mollie_b7f73af7318580996a3889353b282827'] = 'U gebruikt momenteel versie %s. Wij raden u ten zeerste aan te upgraden naar de nieuwe versie, %s!'; $_MODULE['<{mollie}prestashop>mollie_711d42f319398490b32cd0e2f0b8ccb8'] = 'Waarschuwing: Het update xml bestand van github volgt een onverwacht formaat.'; $_MODULE['<{mollie}prestashop>mollie_ef8cd60e5277895bcc20dbddda97fcc4'] = 'Mollie betaalmethoden zijn alleen beschikbaar wanneer Euros zijn ingeschakeld.'; -$_MODULE['<{mollie}prestashop>mollie_cb3b74ced021286f61222ac247b0cbd2'] = 'Mister Cash'; +$_MODULE['<{mollie}prestashop>mollie_48fa0f621f79f451e58f200957da5b52'] = 'Kies uw bank'; +$_MODULE['<{mollie}prestashop>mollie_961f2247a2070bedff9f9cd8d64e2650'] = 'Kiezen'; +$_MODULE['<{mollie}prestashop>mollie_ea4788705e6873b424c65e91c2846b19'] = 'Annuleren'; +$_MODULE['<{mollie}prestashop>payment_484f5a79672cebe198ebdde45a1d672f'] = 'Cadeauverpakking'; +$_MODULE['<{mollie}prestashop>mollie_config_d876ff8da67c3731ae25d8335a4168b4'] = 'Api sleutel'; +$_MODULE['<{mollie}prestashop>mollie_config_9f4757e0e5dd959e2d51adc95d841f74'] = 'U vindt uw API Sleutel in uw %sMollie Profiel%s; de sleutel begint met test_ of live_.'; +$_MODULE['<{mollie}prestashop>mollie_config_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Omschrijving'; +$_MODULE['<{mollie}prestashop>mollie_config_a97d9b80c4861a067d6bf59d8c586800'] = 'Vul hier een omschrijving in. Sommige betaalmethoden kunnen een karakterlimiet hebben; het is verstandig om 29 tekens of minder te gebruiken. U kunt hier de volgende variablen gebruiken: {cart.id} {customer.firstname} {customer.lastname} {customer.company}'; +$_MODULE['<{mollie}prestashop>mollie_config_8d9143dfc520ed7d982d4e545c7bfc5e'] = 'Stuur locale voor betaalscherm'; +$_MODULE['<{mollie}prestashop>mollie_config_0b66ed0a3967f6cf9c0a5298b3a01731'] = 'Moet de plugin de %slocale%s van uw webshop sturen? Het betaalscherm zal dan in dezelfde taal als uw website worden weergegeven. Standaard zal Mollie de taal detecteren aan de hand van de browser taal.'; +$_MODULE['<{mollie}prestashop>mollie_config_7b3c976ecf21f19689caa1d9e2024124'] = 'Voeg de bestelling toe aan de metadata van Mollie toe om verzekerd te zijn van een backup.'; +$_MODULE['<{mollie}prestashop>mollie_config_1b901e6ebc975d2c2a26ade0b1bf43fe'] = 'Door dit in te schakelen zend u persoonsgegevens van uw klanten naar Mollie. Controleer de lokale wetgeving of u uw klanten hierover moet informeren.'; +$_MODULE['<{mollie}prestashop>mollie_config_8bfe6d183da9aedb9d813187c08a0983'] = 'Visuele instellingen'; +$_MODULE['<{mollie}prestashop>mollie_config_fff0d600f8a0b5e19e88bfb821dd1157'] = 'Afbeeldingen'; +$_MODULE['<{mollie}prestashop>mollie_config_f7a97136df639501521efb243047e0cf'] = 'Laat grote, normale of geen logo zien van betaalmethodes op de afrekenpagina'; +$_MODULE['<{mollie}prestashop>mollie_config_85fb708f31f585607247f8b868efafcc'] = 'Bankenlijst'; +$_MODULE['<{mollie}prestashop>mollie_config_27db39558366d2a9001a0dec69eea4d6'] = 'Sommige betaalmethoden (zoals iDEAL) hebben een bankenlijst. Deze instelling bepaalt waar die lijst zichtbaar is.'; +$_MODULE['<{mollie}prestashop>mollie_config_1547ffc579d657d13fd5fedf12cbfae5'] = 'Css bestand'; +$_MODULE['<{mollie}prestashop>mollie_config_20553a05467777c665629953d49ed143'] = 'Laat leeg voor standaard vormgeving.'; +$_MODULE['<{mollie}prestashop>mollie_config_f1b3440d9481590b41220965432a5fa7'] = 'Hint: Gebruik %s{BASE}%s, %s{THEME}%s, %s{CSS}%s, %s{MOBILE}%s, %s{MOBILE_CSS}%s en %s{OVERRIDE}%s voor de standaard bestandsmappen.'; +$_MODULE['<{mollie}prestashop>mollie_config_dc6e4b439165a4e104c9f3cbfcfe2797'] = 'Debug informatie'; +$_MODULE['<{mollie}prestashop>mollie_config_500aa80d6aea3cc9701b566c5f92ed91'] = 'Foutmeldingen weergeven'; +$_MODULE['<{mollie}prestashop>mollie_config_37f9a8b20930c1dc7488b15872b6d36b'] = 'Door deze optie aan te zetten worden foutmeldingen op de voorpagina weergegeven. Alleen voor debug!'; +$_MODULE['<{mollie}prestashop>mollie_config_e5114c4b69585ba5883d456a74c1cd5d'] = 'Log niveau'; +$_MODULE['<{mollie}prestashop>mollie_config_7b1a43ca1db02df70068b12a4b82a7bc'] = 'Aangeraden niveau: Errors. Zet op alles om de webhook requests te monitoren. %sBekijk logs%s'; +$_MODULE['<{mollie}prestashop>mollie_config_d4dccb8ca2dac4e53c01bd9954755332'] = 'Opslaan'; +$_MODULE['<{mollie}prestashop>new_release_b7f73af7318580996a3889353b282827'] = 'U gebruikt momenteel versie %s. Wij raden u met klem aan om te upgraden naar versie %s!'; +$_MODULE['<{mollie}prestashop>error_c453a4b8e8d98e82f35b67f433e3b4da'] = 'Betaling'; +$_MODULE['<{mollie}prestashop>error_1e97d97a923eaddd810e056c828e99ea'] = 'Betalingsfout'; +$_MODULE['<{mollie}prestashop>error_a25c753ee3e4be15ec0daa5a40deb7b8'] = 'Er is een fout opgetreden'; +$_MODULE['<{mollie}prestashop>error_47e1924c444fafe9fdfce444790f0ba9'] = 'Terug naar uw winkelwagen'; +$_MODULE['<{mollie}prestashop>mollie_return_ebdf0f490b617d7efa3025d3625cec85'] = 'Welkom terug'; +$_MODULE['<{mollie}prestashop>mollie_return_300225ee958b6350abc51805dab83c24'] = 'Doorgaan met winkelen'; +$_MODULE['<{mollie}prestashop>refund_729a51874fe901b092899e9e8b31c97a'] = 'Weet u dit zeker?'; +$_MODULE['<{mollie}prestashop>refund_ccaf4ee393d094ecde7f21b15fdf8f1f'] = 'Weet u zeker dat u deze order wilt terugbetalen?'; +$_MODULE['<{mollie}prestashop>refund_76f0ed934de85cc7131910b32ede7714'] = 'Terugbetalen'; +$_MODULE['<{mollie}prestashop>refund_ea4788705e6873b424c65e91c2846b19'] = 'Annuleren'; diff --git a/upgrade/Upgrade-1.0.3.php b/upgrade/Upgrade-1.0.3.php new file mode 100644 index 000000000..39c6cbe21 --- /dev/null +++ b/upgrade/Upgrade-1.0.3.php @@ -0,0 +1,47 @@ + + * @copyright Mollie B.V. + * @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php + * @category Mollie + * @package Mollie + * @link https://www.mollie.nl + */ + +if (!defined('_PS_VERSION_')) { + exit; +} + +/** + * @param $module + * + * @return bool + */ +function upgrade_module_1_0_3($module) +{ + return $module->reinstallHooks() && $module->addCartIdChangePrimaryKey(); +} diff --git a/upgrade/Upgrade-2.0.0.php b/upgrade/Upgrade-2.0.0.php new file mode 100644 index 000000000..072f05240 --- /dev/null +++ b/upgrade/Upgrade-2.0.0.php @@ -0,0 +1,51 @@ + + * @copyright Mollie B.V. + * @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php + * @category Mollie + * @package Mollie + * @link https://www.mollie.nl + */ + +if (!defined('_PS_VERSION_')) { + exit; +} + +/** + * @return bool + * + * @throws PrestaShopDatabaseException + * @throws PrestaShopException + */ +function upgrade_module_2_0_0() +{ + Configuration::deleteByName('MOLLIE_VERSION'); + Configuration::updateValue('MOLLIE_ISSUERS', 'payment-page'); + + return true; +} diff --git a/upgrade/index.php b/upgrade/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/upgrade/index.php @@ -0,0 +1,11 @@ +KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0003ENkl>zev6HWSXyY|z{24$Gw00iPOzA!eh?WyjNfmN`vCbIQw64n z>C3Z!&&n~+N#uvRxPN8if~_m6^;j1yrfF-I;s|pS-xY4F+*QAFO9!l-@>VAkFwn*9 zI7x%;8y0rhEz#RXp@Yi`%ZKcgVoq@+@&UOJ80;h)*efx!Nx8;(nX#UzxPBJT>Iw6c zjCRxC&dF2r4q7s#s5L%kdu!rspx*o`wMN9LXg&O$XDlZiJ#bNp_Mnn*{1~m4lh12LJ$pqQVO;0KixS|1aZUfow?8x>HSI9~;Hlfn$Y^NTID0s|+c>+>Day#uxwtu7**aJPfX{Tg zwzZD-I+@rB>QGwwJv?67S&I~hPD}a|oFs;cjUJa+={$B2xC zer3w}BF6U`?p{ns^<;;W?x=~aW+Z8-N66?irI;rENA zX&(Fu>H5*Ru*4}DjK|;t5aU$6p?AM}iUynpii)y7X~S*-(0oSmaey{eL>o7C_zls9 zbc!(={2f}GM~sj%4x9v#^o^9x2PEat;OWUs+CUa2VBY)s)gqwr3@~R7S{Vi4>8B}v zXn;{XJtkEP&^ADfUkTvc z2e>ughq3~get`L}r%!!=cPRjg+`gXZKlXCsRW=Z*luFSC24UG?Bb;Zh*m`=LG%N#( zotBMjXf(3WH{=&F}X=93?<$3bSs**^u2FO~U);n;y#YQ$ey5aZl z<)x)5r61Bp7Cm|a*VgT3ZF*M@XMv)ZCr5u;{xSsfm;}pXp8jd?J5%FM+29&LY50ARn#`TH0P4hGyNWMR?}$K8q26TPeo60)XiY22P!x zDv2%}0ChSwxjy5dn@AqcE<6oK!ypv}5(JoCajrRsl?Pkte`c|4Htp6*7 z&75mY62jM}X%iObLde;!TTdwFLUe9{lkuIUIT#mH>KD!<3;OBzXsd@&bK=#Gl(1pW|a8t7vr5~JM)vcLgi|v#s_CV9>3yw9>xMtJG3Bwce) zwg0kc_1Gy-bnAd{94i)#-aCpf-usMuJ_g~6o|*zkF6=ZA6F!+ zo`4K%p=fMw93(xEPstC{u9Y_YkM z4*xYpl@ABKJwZvBXE6T{rf>bf{k_3X%>2KcYx>S^u(9<@2dDJhwEqFHTHK)Gtve(JYbQL<*E|7o_JSWt$8xf(fO% zl$ec~<*lOz?xnA4|JI%>z$+kA6@wm?a~9j@QDry1@NRV~*h$W4F@Q1VbYC}G2zKDv5N>_hh|Cj!W6n=!*^GTjn z#42JEF<)nH=wrxHTUc9fsaUyWm~XIC+w2r-C~T0YuWM*hC0CYS#yHVb)>QDIpg}E8 ztt4Z@y5sA=+V0w-I*PB$Q&=oRO&$5jzqxE!^CwiYyCmu!71Lw+DE;tKWx*r5u@_fN=H;7+P4d5Ds}{RYs&J*Pp&MQUW?-d0hE>Tk3OG zgA}P$)Z4PR%iqiBZGLSGEEm za`<@?zxVL0jQjkH^B0LPPzdYi>cSPzl=#`ii#hE?rv)4N8YMb8tql6c_0#ng9h9ks zIoZkuoE%!_FSifE|EB-NU-TnS=K5vg0?Qs~KMXA(E8={}0Zo)td9NlEzb8e^R!H`l zasQDwVG03qUdH70+l%g zG=nVFi_Vcp42pan5*rikDqT#k8dqz*VZCDI)mv&AT6z7`=~EpSO#*heeN}YnJ%eX> zwbJ=(I)*HhY}l37mU>pL{U3US6H7AK`?ve5dS;>p({?j&wjZ`XT!^jB3scs62GL(Z zmf8tdin_vP@D@q$v4_3HDiy8&Sj*-(u3oaOmsB2zWb#$D4>tYY^Y(iUn*AoeF5Yrz zz~=1awu!nvm%)6E#d%mdl{o2#kL4sYnFJLCo}}mX|KVB#mLOb=s=#^2UdY}04#0JXuQhtV(D2-3l z0H$=H(``Gw{&qCZdVlb9dO~_YAm`bv`OKGEztz_R^L9keyN$#i3nQ{OpH@YhMFx!b z>pk`>XOr@$n19OK+*gvwH ziSZ0!u{q>{uk*>zlcRaExj;AOtAXC8-`>nSWzFi%W`~m7Qom*9!p9|yu4kuqXM^n8 zyt595XXQ_@LPG|xV~(PTWbQ?!MD>Odgl%RBi3EX+Z?eE^R-jLm#c_Q^C zf4U%+8=JFlN7_RL7jYDEaW|M4$p@FOd7sUI@h07C1uazo@MQ!5cnAQT-GI+^0Py4n zfDLm1fF=U~xpS=9PdNafo>qJzrQts5;^|jU zh0vuQ;GoReS>DRXnscLvJfP-z8}%8uK_@`u%YGm?=S*HLk}fi?p zpcEPvHw9n-0!T_?gDs{9*bon)fh`*3fA#+xy6fK!{a>d35ed}71b{7V=Zr;$E9c9S znIj=~Mof*3-Xq^K5&)R;WT9oCV5DFWKKmXNn6UJu`<2*0%?QRVU!MSOTE-M{`gn;I zo^B7Z0WDi}bSTiaiEb#-?Mm8Zr}X|}fMh4YW~q9Q=asm!TWwD3zJ2VlZ<>)e=@98e z76#BHpuC@7Y&;dcJFC7gFWc4FXEp5;*M7#=9S*svagH-SS)rg*#cpip+yQ`QrZlc& z;(@xz*h|g)eheHiAJ|KG2{iqlEsnnqhlAM66RwVaY(Kk-M(OR}y$A|FkUADDyYl1g z3G)X);Q$7MF^}0e2h#;CI*|X6qov)2Vno4Si{N098Tu_)YmJH+0~Q3wKUc-zVgFC zC%*i*HUN*XQ0+o~7{q-saGd9tsT#x&Aa_-UPMzP_n zdn=+6YIg7T;KP+^woq47O52wTt;gqb37a3)oK)jswU1G(eQHz)lR zQ$~Y$p7BDPV^4R(@)RiyP~3=-Pa`bIBX-<1bSS^EUx%OPq9TUcdhu8UepM6*hKao6Jhe{9_x&vpUfAq{aQw~4(`vG;_0XeN?DDv zeDtNd>foyj*^-|etd(lqSleaJ@@CFbkMl2Fb7}Q}jaH6W2(y9$;a6gun;fk$G`uSR0NU2c&N^gBpPzNvby}V2^7beYd4`& zaJw0Uz(#gXNU_+D(Ly=1?2&9RoG|=o4`EfsX;^V6(a}cBMG(JybHN*qoVaAPJpUbk zBES1x!kA0Fa$Ay$4NqvzcldsFfrODnLR}#>J0Yfr%?*Z2%#NCE(8s~N&l%eJRSp7^ zi!&&Dh07eYMh~KvLaB2zd+r7E&Cb9+Nx$-gA6RZUYc4q7{}|g|o@SqnMVnrWXvb%w zqJ?($#OfX4skLWrv?{RhkP<5S=NQ|00}nSx9t>qCEQn6HBN=ilTF5b#geDjMHHW=m z?$EV`bMi}i|5a^>fF3d7u!hhB>e5=&u?? zR_eB{-OF&++ayeWv;{{KqC+9~SD!AJb2;qQ_^l#gOxRvGs&hdgp^8S=2Z-^Pkdg5Z zIBP?2Y;%c;<`K?J(3A<6uBm=jd(lHqUkXjS8i;v5L5GfA0-^)K6`RZECe;C>^(fJf zHEMe$1&Nm=xAyfUZPJjLa||S;kty5U^Wj+F38&#Ku$^>41X5{oqGmc9Yu9d7ayyF{ zRK;)YO<8>u{)bss5})>M&J;;;%@o_ z>#Zt?i**AHmGIltX~s`{Rg3#P2(@u?345jYW-F-5c9dv=V%Tqw`vR^7=S0hAjc%b& zvSj$tvQ=}u^}2J!#=Lw2U?EQx%X^u-&BQKQgK8Hjh1n(#vKS+V6sN`9E&b+ZnQrW= z33g269Rr??tfEBO3A74lOD&E%RbjOp$KzNn1KiEHhZBgyE#zANXiyIa7{@Fu zqgf2?!M~=9*Q#VpXtW4=I%tSXUr5YZj$X8?RQlV!&f$Apy9`xvmk*dfT%joM>Nkxu z&3CS~bzELX`u#g^h#1=sxHu`#u6=h5UgyDBtU50R2}jdZ7o1{MN-`9+HzpNf+bg;L zsl;RIv8@BRm>yGc1|b+rTZ~WjhzcST+Qd1C;;RU6Cd?{RVo$#OF{Hddxm=eL-^Q;h4Ow7xQ!q$d7Cwib_imm0)gaPgPWH zee0?T@HTdPbx!iw69v9~5^;nPM^cjM@5cJ8xHZyPSC`o4ZMr&5E^>hPUEF1CYr(SD z_ga-8PRqusA#l8g#yWP1ue*uQ-g`QZXMbqS&pCC)i)=1_{=j2$vM*$FwQ)8ngh3){ z^RPVIa=)cd0R7m07!I7*j0IKYlPKACsZ^x|kG&J<>&yEHC%hQW1*!;EMg!CsO`@te zg0t|Yu9RZ~Sw}a;1gXh3UDc?_Dw$OMbzi2y_OgQ~do5$lCKl5Y=MQR&F_ONDtMZEY zfk!*F(KXpOX?BkB%u{UOYmu^{l8LawzES_+bX8?I9?sg=4(tV%etjALl>W7y>c5g- z9e&9;(K;y&QR*TQunynTsF6O~?kX%(uGaD{iZL-u*O}ki<=OcWg_-=Ymsr$r=w@e$ z0~Rjlw1$SIN07!q6Xz(C*V_=d8iGGN`|R7hx0{V>S)xnl{1QuE>-GXUE4`Gxhk-;v zbCje*%3b<#6GlNCPgf%B;>D8(&T6Cz1cvECkz)~~V}dq&mSRrx151_^f3iBEl||`) z=(0w8uovi#A~T!|V)(P;%$v@B(;-+F9FM;#Y9A=Ac5xMXlN=Vl`!hYft)9*4@gb@I?4k#i%-v z>{RKsrV-oZIcp%MA<-_W=K>ZD_P*RUwhBRdM*RfId}$(RRtxJtEZLe zV~?-f;8vUw7j7lq`K~kuJx7N(@%-zaTRVX|sBcDH0fI^a_Jc;e?s=i~AlK#rhVcQ8 zM&+yY8r`voy1Xl`<(4l3TT_Nk0W!l|4VoRy{;}M@Ln=UNn%WoW?R@Y+f z(T5#ig?bQZ*$iIsIxJpOag|c(@r(L}aoU2nWZ*Jv@)*m3;@=h0qJY2bVD6uYL-HKt z^eD4Zc+No8@^U8I@$F%HbfCea=Y7#uC+hs^6xr6KRhV`Bd23IeuX8_}v}E|IpZ33h zR@lT0as7s)O<`%hx)i}qejN+Y@mBTo!mznnW`5FtNiy|n85YUDi8*OwH6G}OPC5(U zoJQuvo-&cvnT>_xtnKL_VOXTJ`}tu&Z3Qn{*ane>VzcwhxskyxVS-$uS$#5*}xDa2u#G+T8&X2ue3fhM~N6$sZ zF0vewwYy5jhck6+wrJnzXjRo`bAm zeB0UO6KUf~&zsgflnU*loY2TfH?lsX%T?D_m!IZt(~e*hoygq`HGw)5V4tUfkvJNX zQRx_}k=?WFsbjGlI35w-#D6(7ZLvVWQi~CG)YMEHq zpA&=c3w!3Yti$!;j4FX;>wBLtS_Dd3OwURAq{E8>eJ^rLHaTc#3wm{0OD<*rReWdd zpC-LkURi|?h8DUkvU_^=Hzd8Bg8F2;B8_CT4D+UKcdqavH9awwJE6Tnk0Cx{_>Q{c z0dC&E2K&j2Hz+i_sI(;|3p^w5b-xU1MLc|!u<4XWV=kFlymI{#ircE=Kb0LD-Z{%m zZbcGMWm;;$<(P*rlh)TWZmx@|nA*=4Jv9^3ZJpzx{(7zL7iN+b zbz-i?;C8Yph<=tt#;+a)(^f=s>sm@m2uEM2O5S`kNWiWlgivYJJh_nb{LdAhF-z`0(cTnIWlz8}P_r%6 zo^`ljWbG?XpCxnk@*`ZYUOXC(s@T)VPwHQsSeykz1QpL5;Q}QH%~5{);^XgS^R`d2 zMyd1bJ1mTJeK@p_j?K-qV|uY%bz5#O+bez-@@%j>om$QL6q7(HhNL91j|WSPY!oD$ zo(JqHCZa=e>`(i_eSN~zYuq`N46(LPAi&vWgU-f040qmOM+ft+jWQB6%Iuvw&Pml} zlfgC#2s`?q3|Lbjh88uJVm@#&`y(hXiJgUZPD-|+mJ}1dnXZKsZphsd?wX^qS#xM=c>*68i?~hX6^kKaq)>#x zOZJ}xH4_oQ&3@byUQE2pY>^`iy%<;Pn(ocz**z6aF! z?v${UNs!+43 zy;yuhNgt_Oj08=Y8;ZV~it29MPJviB7XP|=IkBvc>9OW9C!~3|FxFVdzgbXj_-342 z0=hR(Jr*%9Sowho)K2smZz@!GE2vB?6Fgq*n}gY|o{O5FzuZ=9EX$U4e})H)B4!@5 zc5{qJWpI&*h!#0DtM1pd%c%V~$1}9nAc-nx8M*3gFLW5%3!#LyK9;?$>e%5s%CE24 zIISlaE;gAZP&|_4-R%4TnY$@wR!_JGl26x>o|&X1ys8!4U3x$KWL(`*UBx+kbt0lp zu|>z{SB^ts%h%r+e}a%OvbW&<2AFtgj=D-5t*m?JMf)A7Xb+Bgp+Tly=bN7?n?p;+ z;+U6d2k&`;oS|UI{iNGOHQdZAdqG#A^Fm{Ep>+xgG1U>|jGNV&V;vgjHZ<)xEA!RT zxHVySD}KlcOZQKDXG%RQT>tWaBxIbeg-^m(Y=0J9m*QqU3A05b*Mmz39$*U*W zTjHTkrN@2u%oc6f3PmGxjDiYbL*Q#nw5)GWLW(C|x;c^{aN3PHWD^RkZknflSh| zo3;Kbk}+_JO%2b->u>Z02Q7lmUGXP8?KMjK`Sb;Rp8OqZo1HVMyCv%3UtNvCBJfBI z%=G&L3TFefcj~tW8-85pGS-UMTm8KDf3e(7B+!8xYp>M6e*Saeo5|J3o1Q2Ezzyv^B^F zwhEk#^R6u=X9A#{sn>QrTGpI#{>5iHa(M?7ps^U*$FHb(-n`VfX&sS->@)<| zy^FCwqyC5`FvV+P=-n>(?1s#D6;|L;;OVncvK^gcoY0e&^;~o`7`(K`P+Mi`4tEnD ztyF87Fwf}cfh(qd%IJO+jJwQ1&(Q4L3bvPh zw<5@H&A~~*>}Um+)PK=p8`hNEg6laMF+tkzKV9Gi&#%T>sP5Kd&52v%xIP znJMt>szGV`h!P6AK_5jK56yh{4E6}Q$1PsGqUOw=i^a{WO^%S{nV|p$JC!?Oyn+Rcp_4V7w zJC6nGTkk?M!j;g8x@1a|v6pF#SUg@-69T;mTweOzH%;m@*>*?Mkr3}spsb9RT>2dJ z6q0wtyMiykniboJbbiU8VIVXFcm0O-gulW)A=kO?Rzp69G9IZ*dIZDie3D5Y(FyaN zj2VR^#6(ONl?9%zPJToOrN}@LBNav_iN}F^*P4Q;@~-u+rV+Ehbw@%umAkkg=6ii% zYc*kORkMs|x)>x-O$oKw%ZI!X8GqTjgSLKx?o+StM<&U~8*n!tMe1j?n{2-wg*Sx8q(b~6yT=BBOZqXAot>~g)JZr#^ zx(ejZ+^EI`6?aaR^T|)@irB38c-fTO?EGgiIo6R(>N#g}$J5(SQ+$kt%m!fX0sIIh z>?{2)&sTdoV7?|G6fIm6~#za|S5yO_Tmd+W9wx1(o(`uFu zTN681L(Lvexq`m*P2!sgM1k2xrv-ldxvBsp5g(EWW~1Vta${MuOnfE%OV@-Z%e9vq zyE@lwZQm2dHQNr^q8J-kCOblHQ-cgV_eAFN8|xnN75OKT(kRzoGzA)4^2UlckWXOS zs#&ir*E&^GiHNE@BTd=w0n-P6rd1B8i)G_3cwLH`%D~J9%+h~CbR3iYaG3-j+hG3w^{^xhW|3gUjze2SChW_8D e!pTl=FaW~Yh6oojr3sJMqFmbi?f(EHhAVmi literal 0 HcmV?d00001 diff --git a/views/img/mollie_panel_icon.png b/views/img/mollie_panel_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a1b7afd83eb05405e3a0acec5f4e2301718a1f71 GIT binary patch literal 705 zcmV;y0zUnTP)a)toBRbK<$+zWIP3&FL;iv^ z{s7MdQ(DSY5>9P`HsLsf)g@TO!W0>adb{4n^Vb&!c6h`4e&@~3y!W)pWTN2$LWujo z5%3x~1P;^yxKyJ9oB<6fqy>fnzDphExc4uAV9x8s?V@@g7^%ofQ}Tp0k(FpLMlk7bXH zWm%+BDMFzTWsI7-yuLnRl9JaN$+ilY6G{fQ0NyN*0!C>$NFzl>_Lcx(7!0Ywm^?Duc ze!rhsEJn3jb&P_p5{qrvmyx?gG#bUSEGP4!K9kYrkV>WI=B-u>(=;(nlUA#BWBoGw zqOTboXog|@1RgC~q?B`W(=-_j1^@&C0cy3{f7yi)b^?CsZbLbBzWD9d?gU*G61&3X zUI^&yP(VjlHQcUnrUMQ2EN&auKx3K>KLYQzEZ~!r^8NH0o~jhNEsPZB--1MyNck-a z$WP0%*@q~rs@F}Uskrv6D4jWqS8CxV$d4C$1KlPGeFemtkE5w}eqomjun}>k8qw?> nZ^uaaICAO{_qRFSR(t*j@dp1{9IDZ#00000NkvXXu0mjfXA(9o literal 0 HcmV?d00001 diff --git a/views/index.php b/views/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/views/index.php @@ -0,0 +1,11 @@ + +* @copyright 2007-2014 PrestaShop SA +* @version Release: $Revision: 7776 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/views/js/app/package.json b/views/js/app/package.json new file mode 100644 index 000000000..b31286300 --- /dev/null +++ b/views/js/app/package.json @@ -0,0 +1,30 @@ +{ + "name": "mollie", + "version": "2.1.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "Martijn Diederiks ", + "license": "AFL-3.0", + "dependencies": { + "babel-core": "^6.26.0", + "babel-loader": "^7.1.2", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.6.1", + "babel-preset-stage-3": "^6.24.1", + "classlist-polyfill": "^1.2.0", + "core-js": "^2.5.3", + "css-loader": "^0.28.7", + "lodash": "^4.17.4", + "raf": "^3.4.0", + "style-loader": "^0.19.0", + "sweetalert": "^2.1.0", + "webpack": "^3.10.0", + "xss": "^0.3.4" + }, + "devDependencies": { + "uglifyjs-webpack-plugin": "^1.1.8" + } +} diff --git a/views/js/app/src/banks.js b/views/js/app/src/banks.js new file mode 100644 index 000000000..8e2888890 --- /dev/null +++ b/views/js/app/src/banks.js @@ -0,0 +1,51 @@ +import 'babel-polyfill'; +import 'classlist-polyfill'; +import 'raf/polyfill'; +import swal from 'sweetalert'; +import xss from 'xss'; +import styles from '../css/banks.css'; + +export default class MollieBanks { + constructor(banks, translations) { + this.banks = banks; + this.translations = translations; + + this.initBanks(); + } + + initBanks() { + const elem = document.createElement('div'); + elem.id = 'mollie-banks-list'; + let content = '
    '; + Object.values(this.banks).forEach((bank) => { + content += `
    + + +
    `; + }); + content += '
'; + elem.innerHTML = content; + elem.querySelector('input').checked = true; + + swal({ + title: xss(this.translations.chooseYourBank), + content: elem, + buttons: { + cancel: xss(this.translations.cancel), + confirm: xss(this.translations.choose), + }, + }).then((value) => { + if (value) { + const issuer = elem.querySelector('input[name="mollie-bank"]:checked').value; + + window.open(this.banks[issuer].href, '_self'); + } else { + [].slice.call(document.querySelectorAll('.swal-overlay')).forEach((item) => { + item.parentNode.removeChild(item); + }); + } + }); + } +} diff --git a/views/js/app/src/confirmrefund.js b/views/js/app/src/confirmrefund.js new file mode 100644 index 000000000..2e7a7e47f --- /dev/null +++ b/views/js/app/src/confirmrefund.js @@ -0,0 +1,24 @@ +import 'babel-polyfill'; +import 'raf/polyfill'; +import swal from 'sweetalert'; +import xss from 'xss'; + +const refund = (callback, translations) => { + swal({ + icon: 'warning', + title: xss(translations.areYouSure), + text: xss(translations.areYouSureYouWantToRefund), + buttons: { + cancel: xss(translations.cancel), + confirm: xss(translations.refund), + }, + }).then((value) => { + [].slice.call(document.querySelectorAll('.swal-overlay')).forEach((elem) => { + elem.parentNode.removeChild(elem); + }); + + callback(!!value); + }); +}; + +export default refund; diff --git a/views/js/app/src/qrcode.js b/views/js/app/src/qrcode.js new file mode 100644 index 000000000..e69de29bb diff --git a/views/js/app/webpack.config.js b/views/js/app/webpack.config.js new file mode 100644 index 000000000..e4ed9f9ae --- /dev/null +++ b/views/js/app/webpack.config.js @@ -0,0 +1,136 @@ +const path = require('path'); +const webpack = require('webpack'); + +const production = (process.env.NODE_ENV === 'production'); +const plugins = [ + new webpack.optimize.ModuleConcatenationPlugin(), +]; + +if (production) { + plugins.push( + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false, + screw_ie8: true, + conditionals: true, + unused: true, + comparisons: true, + sequences: true, + dead_code: true, + evaluate: true, + if_return: true, + join_vars: true, + }, + output: { + comments: false, + }, + }) + ); + plugins.push( + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify('production'), + }) + ); + plugins.push( + new webpack.BannerPlugin(`Copyright (c) 2012-2018, Mollie B.V. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* - Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* - Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS \`\`AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +* DAMAGE. +* +* @author Mollie B.V. +* @copyright Mollie B.V. +* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php +* @category Mollie +* @package Mollie +* @link https://www.mollie.nl`), + ); +} else { + plugins.push( + new webpack.LoaderOptionsPlugin({ + debug: true, + }) + ); +} + +module.exports = { + entry: { + banks: './src/banks.js', + confirmrefund: './src/confirmrefund.js', + }, + output: { + path: path.resolve(__dirname, 'dist'), + filename: '[name].min.js', + library: ['MollieModule', '[name]'], + libraryTarget: 'var', + }, + resolve: { + extensions: ['.js', '.css'], + }, + devtool: 'source-map', + module: { + rules: [ + { + test: /\.js$/, + include: [ + path.join(__dirname, 'src'), + ], + exclude: path.join(__dirname, 'node_modules'), + use: { + loader: 'babel-loader', + options: { + presets: [ + ['env', { + targets: { + browsers: [ + 'defaults', + 'ie >= 9', + 'ie_mob >= 10', + 'edge >= 12', + 'chrome >= 30', + 'chromeandroid >= 30', + 'android >= 4.4', + 'ff >= 30', + 'safari >= 9', + 'ios >= 9', + 'opera >= 36', + ], + }, + useBuiltIns: 'entry', + debug: false, + }], + 'stage-3', + ], + sourceMap: true, + }, + }, + }, + { + test: /\.css$/, + loaders: 'style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]', + include: [ + path.join(__dirname, 'css'), + ], + }, + ], + }, + plugins, +}; diff --git a/views/js/index.php b/views/js/index.php new file mode 100644 index 000000000..e99b10b89 --- /dev/null +++ b/views/js/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2014 PrestaShop SA +* @version Release: $Revision: 7776 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/views/templates/admin/index.php b/views/templates/admin/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/views/templates/admin/index.php @@ -0,0 +1,11 @@ + +* @copyright Mollie B.V. +* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php +* @category Mollie +* @package Mollie +* @link https://www.mollie.nl +*} + +
+
+ +
+
+ +
+
+ + + +
+
+

+ {$config_legend|escape:'htmlall':'UTF-8' nofilter} +

+
+ {if $update_message} +
+ + {$update_message|escape:'htmlall':'UTF-8'} + +
+ {/if} + {include file="./new_release.tpl"} + {if $msg_result} +
+ + {$msg_result|escape:'htmlall':'UTF-8' nofilter} + +
+ {/if} + {if $msg_warning} +
+ + {$msg_warning|escape:'htmlall':'UTF-8' nofilter} + +
+ {/if} +
+ + + +
+
+ +
+
+ +
+ + {{{l s='You can find your API key in your %sMollie Profile%s; it starts with test or live.' mod='mollie'}|escape:'htmlall':'UTF-8'}|sprintf:'':''} + +
+
+ + + +
+
+ +
+
+ +
+ {l s='Enter a description here. Note: Payment methods may have a character limit, best keep the description under 29 characters.' mod='mollie'} +
+
+ + + +
+
+ +
+
+ +
+ {{l s='Should the plugin send the current webshop %slocale%s to Mollie. Mollie payment screens will be in the same language as your webshop. Mollie can also detect the language based on the user\'s browser language.' mod='mollie'}|escape:'htmlall':'UTF-8'|sprintf:'':''} +
+
+ + + +
+
+ +
+
+ +
+ + {l s='By enabling this option, the module will send your customer\'s data to Mollie. Please double-check if this complies with your local laws, policies and/or regulations.' mod='mollie'} + +
+
+ + + +
+
+

+ {l s='Visual settings' mod='mollie'} +

+
+
+ +
+
+ + {l s='Show big, normal or no payment method logos on checkout.' mod='mollie'} +
+
+ + + +
+
+ +
+
+
+ {l s='Some payment methods (eg. iDEAL) have an issuer list. This setting specifies where it is shown.' mod='mollie'} +
+
+ +
+
+ +
+
+ +
+ {l s='Leave empty for default stylesheet. Should include file path when set.' mod='mollie'} + {{l s='Hint: You can use %s{BASE}%s, %s{THEME}%s, %s{CSS}%s, %s{MOBILE}%s, %s{MOBILE_CSS}%s and %s{OVERRIDE}%s for easy folder mapping.' mod='mollie'}|escape:'htmlall':'UTF-8'|sprintf:'':'':'':'':'':'':'':'':'':'':'':''} +
+
+ + + + {foreach $statuses as $i => $name} +
+
+

+ {$title_status|ucfirst|sprintf:$lang[$name]|replace:'"':'`'|escape:'htmlall':'UTF-8' nofilter} +

+
+
+ +
+
+ +
+ {$desc_status_{$name}|escape:'htmlall':'UTF-8' nofilter} +
+ {if $name != Mollie_API_Object_Payment::STATUS_OPEN} +
+ +
+
+ +
+ {$desc_mail_{$name}|escape:'htmlall':'UTF-8' nofilter} +
+ {/if} +
+ {/foreach} + + + +
+
+

+ {l s='Debug level' mod='mollie'} +

+
+
+ +
+
+ +
+ {l s='Enabling this feature will display error messages (if any) on the front page. Use for debug purposes only!' mod='mollie'} +
+
+ {l s='Log level' mod='mollie'} +
+
+
+ {{l s='Recommended level: Errors. Set to Everything to monitor incoming webhook requests. %sView logs%s' mod='mollie'}|escape:'htmlall':'UTF-8'|sprintf:"":''|sprintf:{$link->getAdminLink('AdminLogs')|escape:'htmlall':'UTF-8'}} +
+
+ + + +
+
+ +
+
+ +
+
+ + +
+
diff --git a/views/templates/admin/new_release.tpl b/views/templates/admin/new_release.tpl new file mode 100644 index 000000000..1b7af720e --- /dev/null +++ b/views/templates/admin/new_release.tpl @@ -0,0 +1,41 @@ +{** +* Copyright (c) 2012-2018, Mollie B.V. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* - Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* - Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +* DAMAGE. +* +* @author Mollie B.V. +* @copyright Mollie B.V. +* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php +* @category Mollie +* @package Mollie +* @link https://www.mollie.nl +*} +{if isset($this_version) && isset($release_url) && isset($release_version)} + +{/if} diff --git a/views/templates/front/error.tpl b/views/templates/front/error.tpl new file mode 100644 index 000000000..7879cf323 --- /dev/null +++ b/views/templates/front/error.tpl @@ -0,0 +1,59 @@ +{** +* Copyright (c) 2012-2018, Mollie B.V. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* - Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* - Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +* DAMAGE. +* +* @author Mollie B.V. +* @copyright Mollie B.V. +* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php +* @category Mollie +* @package Mollie +* @link https://www.mollie.nl +*} + +{capture name=path} + + {l s='Payment' mod='mollie'} + + + {$navigationPipe|escape:'htmlall':'UTF-8'} + + + {l s='Payment error' mod='mollie'} + +{/capture} +
+ {l s='An error occurred' mod='mollie'}: +
    + {foreach from=$errors item='error'} +
  • {$error|escape:'htmlall':'UTF-8'}
  • + {/foreach} +
+
+ diff --git a/views/templates/front/index.php b/views/templates/front/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/views/templates/front/index.php @@ -0,0 +1,11 @@ + +* @copyright Mollie B.V. +* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php +* @category Mollie +* @package Mollie +* @link https://www.mollie.nl +*} + +
+
+
+
+
+ {if count($issuers)} +

{$msg_bankselect|escape:'htmlall':'UTF-8' nofilter}

+ {foreach $issuers as $issuer} + + {/foreach} + + {/if} + + {$msg_return|escape:'htmlall':'UTF-8' nofilter} + +
+
+
+
+
diff --git a/views/templates/front/mollie_issuers17.tpl b/views/templates/front/mollie_issuers17.tpl new file mode 100644 index 000000000..89531a2c6 --- /dev/null +++ b/views/templates/front/mollie_issuers17.tpl @@ -0,0 +1,108 @@ +{** +* Copyright (c) 2012-2018, Mollie B.V. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* - Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* - Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +* DAMAGE. +* +* @author Mollie B.V. +* @copyright Mollie B.V. +* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php +* @category Mollie +* @package Mollie +* @link https://www.mollie.nl +*} + + + + + {block name='head'} + {include file='_partials/head.tpl'} + {/block} + + + +
+
+ + {block name='content'} +
+
+
+
+
+
+
+ {if count($issuers)} + + + +
+
+

{$msg_bankselect|escape:'htmlall':'UTF-8' nofilter}

+ {foreach $issuers as $issuer} + + {/foreach} + + {/if} + + + {$msg_return|escape:'htmlall':'UTF-8' nofilter} + +
+
+
+
+
+
+
+ {/block} + +
+
+ + {block name='javascript_bottom'} + {include file="_partials/javascript.tpl" javascript=$javascript.bottom} + {/block} + + {block name='hook_before_body_closing_tag'} + {hook h='displayBeforeBodyClosingTag'} + {/block} + + + diff --git a/mollie/views/templates/front/mollie_return.tpl b/views/templates/front/mollie_return.tpl old mode 100755 new mode 100644 similarity index 64% rename from mollie/views/templates/front/mollie_return.tpl rename to views/templates/front/mollie_return.tpl index 32efe9700..6aa7fec44 --- a/mollie/views/templates/front/mollie_return.tpl +++ b/views/templates/front/mollie_return.tpl @@ -1,47 +1,38 @@ -{** -* Copyright (c) 2012-2014, Mollie B.V. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* - Redistributions of source code must retain the above copyright notice, -* this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -* DAMAGE. -* -* @category Mollie -* @package Mollie -* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php -* @author Mollie B.V. -* @copyright Mollie B.V. -* @link https://www.mollie.nl -*} - -{extends "$layout"} - -{block name="content"} -
-
-
-
-

{l s=$msg_welcome mod='mollie'}

-

{l s=$msg_details mod='mollie'}

-
-
-
-
-{/block} +{** +* Copyright (c) 2012-2018, Mollie B.V. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* - Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* - Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +* DAMAGE. +* +* @author Mollie B.V. +* @copyright Mollie B.V. +* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php +* @category Mollie +* @package Mollie +* @link https://www.mollie.nl +*} + +

{l s='Welcome back' mod='mollie'}

+

{$msg_details|escape:'htmlall':'UTF-8'}

+ + {l s='Continue shopping' mod='mollie'} + diff --git a/views/templates/hook/cancel.tpl b/views/templates/hook/cancel.tpl new file mode 100644 index 000000000..2d741bca8 --- /dev/null +++ b/views/templates/hook/cancel.tpl @@ -0,0 +1,35 @@ +{** +* Copyright (c) 2012-2018, Mollie B.V. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* - Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* - Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +* DAMAGE. +* +* @author Mollie B.V. +* @copyright Mollie B.V. +* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php +* @category Mollie +* @package Mollie +* @link https://www.mollie.nl +*} +

+ {$cancelMessage|escape:'html':'UTF-8'} +

diff --git a/views/templates/hook/error_message.tpl b/views/templates/hook/error_message.tpl new file mode 100644 index 000000000..b4fffe234 --- /dev/null +++ b/views/templates/hook/error_message.tpl @@ -0,0 +1,35 @@ +{** +* Copyright (c) 2012-2018, Mollie B.V. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* - Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* - Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +* DAMAGE. +* +* @author Mollie B.V. +* @copyright Mollie B.V. +* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php +* @category Mollie +* @package Mollie +* @link https://www.mollie.nl +*} +

+ {$message|escape:'html':'UTF-8'} +

diff --git a/mollie/views/templates/front/mollie_issuers.tpl b/views/templates/hook/ideal_dropdown.tpl old mode 100755 new mode 100644 similarity index 51% rename from mollie/views/templates/front/mollie_issuers.tpl rename to views/templates/hook/ideal_dropdown.tpl index 68acce7c1..682d48b02 --- a/mollie/views/templates/front/mollie_issuers.tpl +++ b/views/templates/hook/ideal_dropdown.tpl @@ -1,56 +1,64 @@ -{** -* Copyright (c) 2012-2014, Mollie B.V. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* - Redistributions of source code must retain the above copyright notice, -* this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -* DAMAGE. -* -* @category Mollie -* @package Mollie -* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php -* @author Mollie B.V. -* @copyright Mollie B.V. -* @link https://www.mollie.nl -*} - -{extends "$layout"} - -{block name="content"} - -
- {if count($issuers)} - - - {/if} -

- {l s=$msg_return mod='mollie'} -
-{/block} \ No newline at end of file +{** +* Copyright (c) 2012-2018, Mollie B.V. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* - Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* - Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +* DAMAGE. +* +* @author Mollie B.V. +* @copyright Mollie B.V. +* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php +* @category Mollie +* @package Mollie +* @link https://www.mollie.nl +*} +{html_options id="mollie-ideal-bank" name="mollie-ideal-bank" options=$idealIssuers} + diff --git a/views/templates/hook/index.php b/views/templates/hook/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/views/templates/hook/index.php @@ -0,0 +1,11 @@ + +* @copyright Mollie B.V. +* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php +* @category Mollie +* @package Mollie +* @link https://www.mollie.nl +*} +

{$okMessage|escape:'html':'UTF-8'}

diff --git a/views/templates/hook/payment.tpl b/views/templates/hook/payment.tpl new file mode 100644 index 000000000..bc2f3a78f --- /dev/null +++ b/views/templates/hook/payment.tpl @@ -0,0 +1,96 @@ +{** +* Copyright (c) 2012-2018, Mollie B.V. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* - Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* - Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +* DAMAGE. +* +* @author Mollie B.V. +* @copyright Mollie B.V. +* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php +* @category Mollie +* @package Mollie +* @link https://www.mollie.nl +*} + +{if $warning != ''} +

{$warning|escape:'htmlall':'UTF-8'}

+{/if} + + + +{if !empty($issuers['ideal']) && $issuer_setting == Mollie::ISSUERS_ON_CLICK} + +{/if} diff --git a/views/templates/hook/refund.tpl b/views/templates/hook/refund.tpl new file mode 100644 index 000000000..d5447e72a --- /dev/null +++ b/views/templates/hook/refund.tpl @@ -0,0 +1,116 @@ +{** +* Copyright (c) 2012-2018, Mollie B.V. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* - Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* - Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +* DAMAGE. +* +* @author Mollie B.V. +* @copyright Mollie B.V. +* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php +* @category Mollie +* @package Mollie +* @link https://www.mollie.nl +*} +{if $smarty.const._PS_VERSION_|@addcslashes:'\'' >= '1.6'} +
+
+ {$msg_title|escape:'htmlall':'UTF-8'} +
+
+ {if $status === 'form'} +
+
{$msg_description|escape:'htmlall':'UTF-8'}
+ +
+ {elseif $status === 'fail'} +
{$msg_fail|escape:'htmlall':'UTF-8'}
+
{$msg_details|escape:'htmlall':'UTF-8'}
+ {elseif $status === 'success'} +
{$msg_success|escape:'htmlall':'UTF-8'}
+
+
{$msg_details|escape:'htmlall':'UTF-8'}
+ {/if} +
+
+{else} +
+
+
+ {$msg_title|escape:'htmlall':'UTF-8'} +
+
+ {if $status === 'form'} +
+
{$msg_description|escape:'htmlall':'UTF-8'}
+ +
+ {elseif $status === 'fail'} +
{$msg_fail|escape:'htmlall':'UTF-8'}
+
{$msg_details|escape:'htmlall':'UTF-8'}
+ {elseif $status === 'success'} +
{$msg_success|escape:'htmlall':'UTF-8'}
+
+
{$msg_details|escape:'htmlall':'UTF-8'}
+ {/if} +
+
+
+{/if} + diff --git a/views/templates/index.php b/views/templates/index.php new file mode 100644 index 000000000..729abf520 --- /dev/null +++ b/views/templates/index.php @@ -0,0 +1,11 @@ +