Version Description
11-11-2021 =
Feature - New payment method - Klarna Pay Now
Feature - Apple Pay Subscriptions integration
Fix - Update Mollie Component Labels
Fix - Incorrect logo for SOFORT payment method
Fix - Tax calculation inaccurate for bundled products with mixed tax products
Fix - Catch error in Object class
Fix - Change NL translation for Klarna Slice It gateway
Fix - Show missing selector icons for credit card
Download this release
Release Info
| Developer | carmen222 |
| Plugin | |
| Version | 6.7.0 |
| Comparing to | |
| See all releases | |
Code changes from version 6.6.0 to 6.7.0
- languages/mollie-payments-for-woocommerce-nl_NL.mo +0 -0
- languages/mollie-payments-for-woocommerce-nl_NL.po +6 -3
- mollie-payments-for-woocommerce.php +3 -2
- pluginEnvironmentChecker/Constraints/AbstractVersionConstraint.php +1 -0
- pluginEnvironmentChecker/Constraints/ConstraintInterface.php +0 -2
- pluginEnvironmentChecker/Constraints/PhpConstraint.php +0 -1
- pluginEnvironmentChecker/Constraints/PluginConstraint.php +0 -1
- pluginEnvironmentChecker/Constraints/WordPressConstraint.php +0 -2
- public/images/Creditcard_issuers/amex-alt.png +0 -0
- public/images/Creditcard_issuers/amex-alt.svg +0 -9
- public/images/Creditcard_issuers/amex-alt@2x.png +0 -0
- public/images/Creditcard_issuers/amex.png +0 -0
- public/images/Creditcard_issuers/amex@2x.png +0 -0
- public/images/Creditcard_issuers/cartasi.png +0 -0
- public/images/Creditcard_issuers/cartasi.svg +0 -1
- public/images/Creditcard_issuers/cartasi@2x.png +0 -0
- public/images/Creditcard_issuers/cartebancaire.png +0 -0
- public/images/Creditcard_issuers/cartebancaire@2x.png +0 -0
- public/images/Creditcard_issuers/maestro.png +0 -0
- public/images/Creditcard_issuers/maestro.svg +0 -6
- public/images/Creditcard_issuers/maestro@2x.png +0 -0
- public/images/Creditcard_issuers/mastercard.png +0 -0
- public/images/Creditcard_issuers/mastercard.svg +0 -6
- public/images/Creditcard_issuers/mastercard@2x.png +0 -0
- public/images/Creditcard_issuers/visa.png +0 -0
- public/images/Creditcard_issuers/visa.svg +0 -1
- public/images/Creditcard_issuers/visa@2x.png +0 -0
- public/images/Creditcard_issuers/vpay.png +0 -0
- public/images/Creditcard_issuers/vpay@2x.png +0 -0
- public/images/{Creditcard_issuers/amex.svg → amex.svg} +0 -0
- public/images/{Creditcard_issuers/cartebancaire.svg → cartebancaire.svg} +0 -0
- public/images/{klarna-paynow.svg → klarnapaynow.svg} +0 -0
- public/images/sofort.svg +3 -2
- public/images/{Creditcard_issuers/vpay.svg → vpay.svg} +0 -0
- public/js/applepayDirect.min.js +1 -1
- public/js/applepayDirectCart.min.js +1 -1
- readme.txt +12 -1
- src/Mollie/WC/ActivationHandle/PluginDisabler.php +2 -2
- src/Mollie/WC/ApplePayButton/AjaxRequests.php +204 -285
- src/Mollie/WC/ApplePayButton/ApplePayDataObjectHttp.php +2 -2
- src/Mollie/WC/ApplePayButton/PropertiesDictionary.php +3 -2
- src/Mollie/WC/Gateway/Abstract.php +1 -0
- src/Mollie/WC/Gateway/AbstractSubscription.php +1 -0
- src/Mollie/WC/Gateway/Applepay.php +4 -2
- src/Mollie/WC/Gateway/Creditcard.php +1 -1
- src/Mollie/WC/Gateway/KlarnaPayNow.php +48 -0
- src/Mollie/WC/Helper/ApplePayDirectHandler.php +11 -2
- src/Mollie/WC/Helper/OrderLines.php +13 -11
- src/Mollie/WC/Helper/Settings.php +4 -4
- src/Mollie/WC/Payment/Object.php +1 -1
- src/Mollie/WC/Plugin.php +6 -5
- vendor/composer/autoload_classmap.php +1 -0
- vendor/composer/autoload_static.php +1 -0
languages/mollie-payments-for-woocommerce-nl_NL.mo
CHANGED
|
Binary file
|
languages/mollie-payments-for-woocommerce-nl_NL.po
CHANGED
|
@@ -2,14 +2,17 @@
|
|
| 2 |
# This file is distributed under the same license as the Plugins - Mollie Payments for WooCommerce - Stable (latest release) package.
|
| 3 |
msgid ""
|
| 4 |
msgstr ""
|
| 5 |
-
"PO-Revision-Date: 2021-
|
| 6 |
"MIME-Version: 1.0\n"
|
| 7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
| 8 |
"Content-Transfer-Encoding: 8bit\n"
|
| 9 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
| 10 |
-
"X-Generator:
|
| 11 |
"Language: nl\n"
|
| 12 |
"Project-Id-Version: Plugins - Mollie Payments for WooCommerce - Stable (latest release)\n"
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
#: src/Mollie/WC/Plugin.php:375
|
| 15 |
msgid "Unpaid order cancelled - time limit reached."
|
|
@@ -1104,7 +1107,7 @@ msgstr "Verzending"
|
|
| 1104 |
|
| 1105 |
#: src/Mollie/WC/Gateway/KlarnaSliceIt.php:33
|
| 1106 |
msgid "Klarna Slice it"
|
| 1107 |
-
msgstr "Klarna
|
| 1108 |
|
| 1109 |
#: src/Mollie/WC/Gateway/KlarnaPayLater.php:40
|
| 1110 |
#: src/Mollie/WC/Gateway/KlarnaSliceIt.php:40
|
| 2 |
# This file is distributed under the same license as the Plugins - Mollie Payments for WooCommerce - Stable (latest release) package.
|
| 3 |
msgid ""
|
| 4 |
msgstr ""
|
| 5 |
+
"PO-Revision-Date: 2021-10-28 10:53+0200\n"
|
| 6 |
"MIME-Version: 1.0\n"
|
| 7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
| 8 |
"Content-Transfer-Encoding: 8bit\n"
|
| 9 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
| 10 |
+
"X-Generator: Poedit 2.3.1\n"
|
| 11 |
"Language: nl\n"
|
| 12 |
"Project-Id-Version: Plugins - Mollie Payments for WooCommerce - Stable (latest release)\n"
|
| 13 |
+
"POT-Creation-Date: \n"
|
| 14 |
+
"Last-Translator: \n"
|
| 15 |
+
"Language-Team: \n"
|
| 16 |
|
| 17 |
#: src/Mollie/WC/Plugin.php:375
|
| 18 |
msgid "Unpaid order cancelled - time limit reached."
|
| 1107 |
|
| 1108 |
#: src/Mollie/WC/Gateway/KlarnaSliceIt.php:33
|
| 1109 |
msgid "Klarna Slice it"
|
| 1110 |
+
msgstr "Klarna Betaal in 3 delen"
|
| 1111 |
|
| 1112 |
#: src/Mollie/WC/Gateway/KlarnaPayLater.php:40
|
| 1113 |
#: src/Mollie/WC/Gateway/KlarnaSliceIt.php:40
|
mollie-payments-for-woocommerce.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
* Plugin Name: Mollie Payments for WooCommerce
|
| 4 |
* Plugin URI: https://www.mollie.com
|
| 5 |
* Description: Accept payments in WooCommerce with the official Mollie plugin
|
| 6 |
-
* Version: 6.
|
| 7 |
* Author: Mollie
|
| 8 |
* Author URI: https://www.mollie.com
|
| 9 |
* Requires at least: 5.0
|
|
@@ -12,7 +12,7 @@
|
|
| 12 |
* Domain Path: /languages
|
| 13 |
* License: GPLv2 or later
|
| 14 |
* WC requires at least: 3.0
|
| 15 |
-
* WC tested up to: 5.
|
| 16 |
* Requires PHP: 7.2
|
| 17 |
*/
|
| 18 |
|
|
@@ -180,6 +180,7 @@ $bootstrap = Closure::bind(
|
|
| 180 |
|| get_query_var('appleparam') == '') {
|
| 181 |
return $template;
|
| 182 |
}
|
|
|
|
| 183 |
echo('7B227073704964223A2244394337463730314338433646324336463344363536433039393434453332323030423137364631353245353844393134304331433533414138323436453630222C2276657273696F6E223A312C22637265617465644F6E223A313535373438323935353137362C227369676E6174757265223A22333038303036303932613836343838366637306430313037303261303830333038303032303130313331306633303064303630393630383634383031363530333034303230313035303033303830303630393261383634383836663730643031303730313030303061303830333038323033653633303832303338626130303330323031303230323038363836306636393964396363613730663330306130363038326138363438636533643034303330323330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333031653137306433313336333033363330333333313338333133363334333035613137306433323331333033363330333233313338333133363334333035613330363233313238333032363036303335353034303330633166363536333633326437333664373032643632373236663662363537323264373336393637366535663535343333343264353334313465343434323466353833313134333031323036303335353034306230633062363934663533323035333739373337343635366437333331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333035393330313330363037326138363438636533643032303130363038326138363438636533643033303130373033343230303034383233306664616263333963663735653230326335306439396234353132653633376532613930316464366362336530623163643462353236373938663863663465626465383161323561386332316534633333646463653865326139366332663661666131393330333435633465383761343432366365393531623132393561333832303231313330383230323064333034353036303832623036303130353035303730313031303433393330333733303335303630383262303630313035303530373330303138363239363837343734373033613266326636663633373337303265363137303730366336353265363336663664326636663633373337303330333432643631373037303663363536313639363336313333333033323330316430363033353531643065303431363034313430323234333030623961656565643436333139376134613635613239396534323731383231633435333030633036303335353164313330313031666630343032333030303330316630363033353531643233303431383330313638303134323366323439633434663933653465663237653663346636323836633366613262626664326534623330383230313164303630333535316432303034383230313134333038323031313033303832303130633036303932613836343838366637363336343035303133303831666533303831633330363038326230363031303530353037303230323330383162363063383162333532363536633639363136653633363532303666366532303734363836393733323036333635373237343639363636393633363137343635323036323739323036313665373932303730363137323734373932303631373337333735366436353733323036313633363336353730373436313665363336353230366636363230373436383635323037343638363536653230363137303730366336393633363136323663363532303733373436313665363436313732363432303734363537323664373332303631366536343230363336663665363436393734363936663665373332303666363632303735373336353263323036333635373237343639363636393633363137343635323037303666366336393633373932303631366536343230363336353732373436393636363936333631373436393666366532303730373236313633373436393633363532303733373436313734363536643635366537343733326533303336303630383262303630313035303530373032303131363261363837343734373033613266326637373737373732653631373037303663363532653633366636643266363336353732373436393636363936333631373436353631373537343638366637323639373437393266333033343036303335353164316630343264333032623330323961303237613032353836323336383734373437303361326632663633373236633265363137303730366336353265363336663664326636313730373036633635363136393633363133333265363337323663333030653036303335353164306630313031666630343034303330323037383033303066303630393261383634383836663736333634303631643034303230353030333030613036303832613836343863653364303430333032303334393030333034363032323130306461316336336165386265356636346638653131653836353639333762396236396334373262653933656163333233336131363739333665346138643565383330323231303062643561666266383639663363306361323734623266646465346637313731353963623362643731393962326361306666343039646536353961383262323464333038323032656533303832303237356130303330323031303230323038343936643266626633613938646139373330306130363038326138363438636533643034303330323330363733313162333031393036303335353034303330633132343137303730366336353230353236663666373432303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330316531373064333133343330333533303336333233333334333633333330356131373064333233393330333533303336333233333334333633333330356133303761333132653330326330363033353530343033306332353431373037303663363532303431373037303663363936333631373436393666366532303439366537343635363737323631373436393666366532303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330353933303133303630373261383634386365336430323031303630383261383634386365336430333031303730333432303030346630313731313834313964373634383564353161356532353831303737366538383061326566646537626165346465303864666334623933653133333536643536363562333561653232643039373736306432323465376262613038666437363137636538386362373662623636373062656338653832393834666635343435613338316637333038316634333034363036303832623036303130353035303730313031303433613330333833303336303630383262303630313035303530373330303138363261363837343734373033613266326636663633373337303265363137303730366336353265363336663664326636663633373337303330333432643631373037303663363537323666366637343633363136373333333031643036303335353164306530343136303431343233663234396334346639336534656632376536633466363238366333666132626266643265346233303066303630333535316431333031303166663034303533303033303130316666333031663036303335353164323330343138333031363830313462626230646561313538333338383961613438613939646562656264656261666461636232346162333033373036303335353164316630343330333032653330326361303261613032383836323636383734373437303361326632663633373236633265363137303730366336353265363336663664326636313730373036633635373236663666373436333631363733333265363337323663333030653036303335353164306630313031666630343034303330323031303633303130303630613261383634383836663736333634303630323065303430323035303033303061303630383261383634386365336430343033303230333637303033303634303233303361636637323833353131363939623138366662333563333536636136326266663431376564643930663735346461323865626566313963383135653432623738396638393866373962353939663938643534313064386639646539633266653032333033323264643534343231623061333035373736633564663333383362393036376664313737633263323136643936346663363732363938323132366635346638376137643162393963623962303938393231363130363939306630393932316430303030333138323031386233303832303138373032303130313330383138363330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533303230383638363066363939643963636137306633303064303630393630383634383031363530333034303230313035303061303831393533303138303630393261383634383836663730643031303930333331306230363039326138363438383666373064303130373031333031633036303932613836343838366637306430313039303533313066313730643331333933303335333133303331333033303339333133353561333032613036303932613836343838366637306430313039333433313164333031623330306430363039363038363438303136353033303430323031303530306131306130363038326138363438636533643034303330323330326630363039326138363438383666373064303130393034333132323034323035613437363366643264396534366338346162356331346462383563633833663831303934316536323838306363663138636536376131613630656633356661333030613036303832613836343863653364303430333032303434363330343430323230363436636338323861383361333062353136313731323266633462333532386432373762373937646264333861633064396263643439393864633832303634383032323030366663656534646432316661313165653665353834346561393565643465643034323939636666363333656437623233343461383835613433636431613662303030303030303030303030227D');
|
| 184 |
exit;
|
| 185 |
},
|
| 3 |
* Plugin Name: Mollie Payments for WooCommerce
|
| 4 |
* Plugin URI: https://www.mollie.com
|
| 5 |
* Description: Accept payments in WooCommerce with the official Mollie plugin
|
| 6 |
+
* Version: 6.7.0
|
| 7 |
* Author: Mollie
|
| 8 |
* Author URI: https://www.mollie.com
|
| 9 |
* Requires at least: 5.0
|
| 12 |
* Domain Path: /languages
|
| 13 |
* License: GPLv2 or later
|
| 14 |
* WC requires at least: 3.0
|
| 15 |
+
* WC tested up to: 5.8
|
| 16 |
* Requires PHP: 7.2
|
| 17 |
*/
|
| 18 |
|
| 180 |
|| get_query_var('appleparam') == '') {
|
| 181 |
return $template;
|
| 182 |
}
|
| 183 |
+
header('Content-Type: text/plain; charset=UTF-8', true, 200);
|
| 184 |
echo('7B227073704964223A2244394337463730314338433646324336463344363536433039393434453332323030423137364631353245353844393134304331433533414138323436453630222C2276657273696F6E223A312C22637265617465644F6E223A313535373438323935353137362C227369676E6174757265223A22333038303036303932613836343838366637306430313037303261303830333038303032303130313331306633303064303630393630383634383031363530333034303230313035303033303830303630393261383634383836663730643031303730313030303061303830333038323033653633303832303338626130303330323031303230323038363836306636393964396363613730663330306130363038326138363438636533643034303330323330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333031653137306433313336333033363330333333313338333133363334333035613137306433323331333033363330333233313338333133363334333035613330363233313238333032363036303335353034303330633166363536333633326437333664373032643632373236663662363537323264373336393637366535663535343333343264353334313465343434323466353833313134333031323036303335353034306230633062363934663533323035333739373337343635366437333331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533333035393330313330363037326138363438636533643032303130363038326138363438636533643033303130373033343230303034383233306664616263333963663735653230326335306439396234353132653633376532613930316464366362336530623163643462353236373938663863663465626465383161323561386332316534633333646463653865326139366332663661666131393330333435633465383761343432366365393531623132393561333832303231313330383230323064333034353036303832623036303130353035303730313031303433393330333733303335303630383262303630313035303530373330303138363239363837343734373033613266326636663633373337303265363137303730366336353265363336663664326636663633373337303330333432643631373037303663363536313639363336313333333033323330316430363033353531643065303431363034313430323234333030623961656565643436333139376134613635613239396534323731383231633435333030633036303335353164313330313031666630343032333030303330316630363033353531643233303431383330313638303134323366323439633434663933653465663237653663346636323836633366613262626664326534623330383230313164303630333535316432303034383230313134333038323031313033303832303130633036303932613836343838366637363336343035303133303831666533303831633330363038326230363031303530353037303230323330383162363063383162333532363536633639363136653633363532303666366532303734363836393733323036333635373237343639363636393633363137343635323036323739323036313665373932303730363137323734373932303631373337333735366436353733323036313633363336353730373436313665363336353230366636363230373436383635323037343638363536653230363137303730366336393633363136323663363532303733373436313665363436313732363432303734363537323664373332303631366536343230363336663665363436393734363936663665373332303666363632303735373336353263323036333635373237343639363636393633363137343635323037303666366336393633373932303631366536343230363336353732373436393636363936333631373436393666366532303730373236313633373436393633363532303733373436313734363536643635366537343733326533303336303630383262303630313035303530373032303131363261363837343734373033613266326637373737373732653631373037303663363532653633366636643266363336353732373436393636363936333631373436353631373537343638366637323639373437393266333033343036303335353164316630343264333032623330323961303237613032353836323336383734373437303361326632663633373236633265363137303730366336353265363336663664326636313730373036633635363136393633363133333265363337323663333030653036303335353164306630313031666630343034303330323037383033303066303630393261383634383836663736333634303631643034303230353030333030613036303832613836343863653364303430333032303334393030333034363032323130306461316336336165386265356636346638653131653836353639333762396236396334373262653933656163333233336131363739333665346138643565383330323231303062643561666266383639663363306361323734623266646465346637313731353963623362643731393962326361306666343039646536353961383262323464333038323032656533303832303237356130303330323031303230323038343936643266626633613938646139373330306130363038326138363438636533643034303330323330363733313162333031393036303335353034303330633132343137303730366336353230353236663666373432303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330316531373064333133343330333533303336333233333334333633333330356131373064333233393330333533303336333233333334333633333330356133303761333132653330326330363033353530343033306332353431373037303663363532303431373037303663363936333631373436393666366532303439366537343635363737323631373436393666366532303433343132303264323034373333333132363330323430363033353530343062306331643431373037303663363532303433363537323734363936363639363336313734363936663665323034313735373436383666373236393734373933313133333031313036303335353034306130633061343137303730366336353230343936653633326533313062333030393036303335353034303631333032353535333330353933303133303630373261383634386365336430323031303630383261383634386365336430333031303730333432303030346630313731313834313964373634383564353161356532353831303737366538383061326566646537626165346465303864666334623933653133333536643536363562333561653232643039373736306432323465376262613038666437363137636538386362373662623636373062656338653832393834666635343435613338316637333038316634333034363036303832623036303130353035303730313031303433613330333833303336303630383262303630313035303530373330303138363261363837343734373033613266326636663633373337303265363137303730366336353265363336663664326636663633373337303330333432643631373037303663363537323666366637343633363136373333333031643036303335353164306530343136303431343233663234396334346639336534656632376536633466363238366333666132626266643265346233303066303630333535316431333031303166663034303533303033303130316666333031663036303335353164323330343138333031363830313462626230646561313538333338383961613438613939646562656264656261666461636232346162333033373036303335353164316630343330333032653330326361303261613032383836323636383734373437303361326632663633373236633265363137303730366336353265363336663664326636313730373036633635373236663666373436333631363733333265363337323663333030653036303335353164306630313031666630343034303330323031303633303130303630613261383634383836663736333634303630323065303430323035303033303061303630383261383634386365336430343033303230333637303033303634303233303361636637323833353131363939623138366662333563333536636136326266663431376564643930663735346461323865626566313963383135653432623738396638393866373962353939663938643534313064386639646539633266653032333033323264643534343231623061333035373736633564663333383362393036376664313737633263323136643936346663363732363938323132366635346638376137643162393963623962303938393231363130363939306630393932316430303030333138323031386233303832303138373032303130313330383138363330376133313265333032633036303335353034303330633235343137303730366336353230343137303730366336393633363137343639366636653230343936653734363536373732363137343639366636653230343334313230326432303437333333313236333032343036303335353034306230633164343137303730366336353230343336353732373436393636363936333631373436393666366532303431373537343638366637323639373437393331313333303131303630333535303430613063306134313730373036633635323034393665363332653331306233303039303630333535303430363133303235353533303230383638363066363939643963636137306633303064303630393630383634383031363530333034303230313035303061303831393533303138303630393261383634383836663730643031303930333331306230363039326138363438383666373064303130373031333031633036303932613836343838366637306430313039303533313066313730643331333933303335333133303331333033303339333133353561333032613036303932613836343838366637306430313039333433313164333031623330306430363039363038363438303136353033303430323031303530306131306130363038326138363438636533643034303330323330326630363039326138363438383666373064303130393034333132323034323035613437363366643264396534366338346162356331346462383563633833663831303934316536323838306363663138636536376131613630656633356661333030613036303832613836343863653364303430333032303434363330343430323230363436636338323861383361333062353136313731323266633462333532386432373762373937646264333861633064396263643439393864633832303634383032323030366663656534646432316661313165653665353834346561393565643465643034323939636666363333656437623233343461383835613433636431613662303030303030303030303030227D');
|
| 185 |
exit;
|
| 186 |
},
|
pluginEnvironmentChecker/Constraints/AbstractVersionConstraint.php
CHANGED
|
@@ -20,6 +20,7 @@ abstract class AbstractVersionConstraint implements ConstraintInterface
|
|
| 20 |
* @var string
|
| 21 |
*/
|
| 22 |
protected $message;
|
|
|
|
| 23 |
/**
|
| 24 |
* @var string
|
| 25 |
*/
|
| 20 |
* @var string
|
| 21 |
*/
|
| 22 |
protected $message;
|
| 23 |
+
|
| 24 |
/**
|
| 25 |
* @var string
|
| 26 |
*/
|
pluginEnvironmentChecker/Constraints/ConstraintInterface.php
CHANGED
|
@@ -15,8 +15,6 @@ interface ConstraintInterface
|
|
| 15 |
/**
|
| 16 |
* Validates a value.
|
| 17 |
*
|
| 18 |
-
*
|
| 19 |
-
*
|
| 20 |
* @throws RuntimeException If problem validating.
|
| 21 |
* @throws ConstraintFailedExceptionInterface If validation failed. Must extend {@see RuntimeException}.
|
| 22 |
*/
|
| 15 |
/**
|
| 16 |
* Validates a value.
|
| 17 |
*
|
|
|
|
|
|
|
| 18 |
* @throws RuntimeException If problem validating.
|
| 19 |
* @throws ConstraintFailedExceptionInterface If validation failed. Must extend {@see RuntimeException}.
|
| 20 |
*/
|
pluginEnvironmentChecker/Constraints/PhpConstraint.php
CHANGED
|
@@ -4,7 +4,6 @@ namespace Inpsyde\EnvironmentChecker\Constraints;
|
|
| 4 |
|
| 5 |
class PhpConstraint extends AbstractVersionConstraint
|
| 6 |
{
|
| 7 |
-
|
| 8 |
/**
|
| 9 |
* PhpAbstractVersionConstraint constructor.
|
| 10 |
*
|
| 4 |
|
| 5 |
class PhpConstraint extends AbstractVersionConstraint
|
| 6 |
{
|
|
|
|
| 7 |
/**
|
| 8 |
* PhpAbstractVersionConstraint constructor.
|
| 9 |
*
|
pluginEnvironmentChecker/Constraints/PluginConstraint.php
CHANGED
|
@@ -72,5 +72,4 @@ class PluginConstraint extends AbstractVersionConstraint
|
|
| 72 |
}
|
| 73 |
return false;
|
| 74 |
}
|
| 75 |
-
|
| 76 |
}
|
| 72 |
}
|
| 73 |
return false;
|
| 74 |
}
|
|
|
|
| 75 |
}
|
pluginEnvironmentChecker/Constraints/WordPressConstraint.php
CHANGED
|
@@ -4,7 +4,6 @@ namespace Inpsyde\EnvironmentChecker\Constraints;
|
|
| 4 |
|
| 5 |
class WordPressConstraint extends AbstractVersionConstraint
|
| 6 |
{
|
| 7 |
-
|
| 8 |
/**
|
| 9 |
* WordPressAbstractVersionConstraint constructor.
|
| 10 |
*
|
|
@@ -30,5 +29,4 @@ class WordPressConstraint extends AbstractVersionConstraint
|
|
| 30 |
$WPCurrentVersion
|
| 31 |
);
|
| 32 |
}
|
| 33 |
-
|
| 34 |
}
|
| 4 |
|
| 5 |
class WordPressConstraint extends AbstractVersionConstraint
|
| 6 |
{
|
|
|
|
| 7 |
/**
|
| 8 |
* WordPressAbstractVersionConstraint constructor.
|
| 9 |
*
|
| 29 |
$WPCurrentVersion
|
| 30 |
);
|
| 31 |
}
|
|
|
|
| 32 |
}
|
public/images/Creditcard_issuers/amex-alt.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/amex-alt.svg
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
<svg width="32" height="24" viewBox="0 0 32 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 2 |
-
<path d="M27.871 0H4.12903C1.84863 0 0 1.86872 0 4.17391V19.8261C0 22.1313 1.84863 24 4.12903 24H27.871C30.1514 24 32 22.1313 32 19.8261V4.17391C32 1.86872 30.1514 0 27.871 0Z" fill="#0095FF"/>
|
| 3 |
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.3521 18.8585V11.2566L31.8821 11.2688V13.3686L30.3183 15.0398L31.8821 16.7263V18.8707H29.3853L28.0584 17.4065L26.7409 18.8763L18.3521 18.8585Z" fill="#FFFFFE"/>
|
| 4 |
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.2557 18.0251V12.0932H24.2855V13.4597H20.8843V14.3873H24.2044V15.7311H20.8843V16.6422H24.2855V18.0251H19.2557Z" fill="#0095FF"/>
|
| 5 |
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M24.2604 18.0251L27.0435 15.0557L24.2603 12.0933H26.4144L28.1151 13.9734L29.8206 12.0933H31.8821V12.14L29.1583 15.0557L31.8821 17.9409V18.0251H29.7998L28.069 16.1261L26.356 18.0251H24.2604Z" fill="#0095FF"/>
|
| 6 |
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.9831 4.50928H22.2445L23.39 7.11041V4.50928H27.4165L28.1108 6.45804L28.8075 4.50928H31.8821V12.1111H15.6334L18.9831 4.50928Z" fill="#FFFFFE"/>
|
| 7 |
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.6006 5.3349L16.9686 11.2618H18.7738L19.2704 10.0749H21.961L22.4572 11.2618H24.3073L21.6862 5.3349H19.6006ZM19.8268 8.74481L20.6162 6.85805L21.4049 8.74481H19.8268Z" fill="#0095FF"/>
|
| 8 |
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M24.2827 11.261V5.3342L26.8201 5.34292L28.1258 8.98656L29.44 5.3342H31.8822V11.261L30.3107 11.2749V7.20375L28.8272 11.261H27.3928L25.8786 7.18984V11.261H24.2827Z" fill="#0095FF"/>
|
| 9 |
-
</svg>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/images/Creditcard_issuers/amex-alt@2x.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/amex.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/amex@2x.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/cartasi.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/cartasi.svg
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
<svg fill="none" height="24" viewBox="0 0 32 24" width="32" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m4 0h24c2.2091 0 4 1.79086 4 4v16c0 2.2091-1.7909 4-4 4h-24c-2.20914 0-4-1.7909-4-4v-16c0-2.20914 1.79086-4 4-4z" fill="#ff6e28"/><path d="m5.39708.0876698c.21301-.0599205.43464-.0876698.65552-.0876698h.01549c.28676.00173033.55551.0506922.78753.134965.18744.068124.35081.159383.48049.267496.05398.044924.10418.095488.14826.150666.03225.04031.06116.083056.08579.128044.06688.122213.10158.260062.08389.406119-.01367.1124-.05662.21968-.12401.3187-.05127.07523-.11658.14579-.19393.21026-.0609.05076-.12917.0978-.20393.14048-.28424.16002-.65968.25737-1.07127.25737-.88697 0-1.60604-.45194-1.60604-1.00936 0-.29505.20142-.560495.5225-.745063.03011-.017111.06128-.033453.0934-.04909.10008-.048641.20948-.090041.32631-.1229172zm-5.176563 6.0324902c0-2.24853 3.925363-3.01198 5.920323-3.01198 1.12826 0 3.51906.24244 4.96736 1.50679.1867.16701.357.35151.5062.55524.0395.05384.0774.10901.1137.16554.0874.13592.1658.27973.2338.432.06.13439.0439.2318-.012.28474-.009.00852-.019.01589-.0299.02211-.0239.01358-.0521.02147-.0829.02339-.0907.00545-.1725-.03563-.2406-.09363-.0134-.01365-.0265-.02839-.0393-.04435-.0651-.08158-.1429-.16111-.232-.23834-.7405-.67034-2.32831-1.16771-3.78307-1.23269-1.58507-.07082-3.01212.37176-3.01212 1.66335v1.66618c0 .08055-.00246.1556-.00743.22532-.03301.46348-.17661.69534-.44592.78666-.12552.04262-.27832.05467-.45989.0455-.49315-.02512-1.74839-.2673-2.59632-.99987-.00195-.00166-.0039-.00333-.00579-.005-.462794-.41566-.794143-.98378-.794143-1.75096zm7.463763-.47097c.13182-.14605.3265-.20187.58964-.20187.0352 0 .07155.00096.10921.00288.77506.03948 3.43267.6151 3.43267 2.78782 0 2.24848-3.92544 3.01198-5.9204 3.01198-1.4171 0-4.82576-.3825-5.8572789-2.69162-.1575181-.35247.2092899-.4502.4408119-.16021 1.059677 1.32696 5.494877 2.12923 6.692037.65746.00523-.00603.01046-.01224.01562-.01833.03905-.04678.07483-.09587.10701-.14734.13056-.20879.20312-.45687.20312-.74814v-1.66617c0-.39952.06046-.6624.18756-.82646z" fill="#fff" transform="translate(10 6)"/></g></svg>
|
|
|
public/images/Creditcard_issuers/cartasi@2x.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/cartebancaire.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/cartebancaire@2x.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/maestro.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/maestro.svg
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
<svg width="32" height="24" viewBox="0 0 32 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 2 |
-
<path d="M4.12903 0.5H27.871C29.8701 0.5 31.5 2.13976 31.5 4.17391V19.8261C31.5 21.8602 29.8701 23.5 27.871 23.5H4.12903C2.12986 23.5 0.5 21.8602 0.5 19.8261V4.17391C0.5 2.13976 2.12986 0.5 4.12903 0.5Z" fill="white" stroke="#E6E6E6"/>
|
| 3 |
-
<path d="M5.16129 10.4348C8.01179 10.4348 10.3226 8.09888 10.3226 5.21739C10.3226 2.33591 8.01179 0 5.16129 0C2.31079 0 0 2.33591 0 5.21739C0 8.09888 2.31079 10.4348 5.16129 10.4348Z" transform="translate(7.74194 6.78259)" fill="#E7001A"/>
|
| 4 |
-
<path d="M5.16129 10.4348C8.01179 10.4348 10.3226 8.09888 10.3226 5.21739C10.3226 2.33591 8.01179 0 5.16129 0C2.31079 0 0 2.33591 0 5.21739C0 8.09888 2.31079 10.4348 5.16129 10.4348Z" transform="translate(13.9355 6.78259)" fill="#00A2E1"/>
|
| 5 |
-
<path opacity="0.3" fill-rule="evenodd" clip-rule="evenodd" d="M2.06452 0C3.31814 0.951867 4.12903 2.46735 4.12903 4.17429C4.12903 5.88124 3.31814 7.39672 2.06452 8.34859C0.810894 7.39672 0 5.88124 0 4.17429C0 2.46735 0.810894 0.951867 2.06452 0Z" transform="translate(13.9355 7.82568)" fill="#E7001A"/>
|
| 6 |
-
</svg>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/images/Creditcard_issuers/maestro@2x.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/mastercard.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/mastercard.svg
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
<svg width="32" height="24" viewBox="0 0 32 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 2 |
-
<path d="M4.12903 0.5H27.871C29.8701 0.5 31.5 2.13976 31.5 4.17391V19.8261C31.5 21.8602 29.8701 23.5 27.871 23.5H4.12903C2.12986 23.5 0.5 21.8602 0.5 19.8261V4.17391C0.5 2.13976 2.12986 0.5 4.12903 0.5Z" fill="white" stroke="#E6E6E6"/>
|
| 3 |
-
<path d="M5.16129 10.4348C8.01179 10.4348 10.3226 8.09888 10.3226 5.21739C10.3226 2.33591 8.01179 0 5.16129 0C2.31079 0 0 2.33591 0 5.21739C0 8.09888 2.31079 10.4348 5.16129 10.4348Z" transform="translate(7.74194 6.78259)" fill="#E7001A"/>
|
| 4 |
-
<path d="M5.16129 10.4348C8.01179 10.4348 10.3226 8.09888 10.3226 5.21739C10.3226 2.33591 8.01179 0 5.16129 0C2.31079 0 0 2.33591 0 5.21739C0 8.09888 2.31079 10.4348 5.16129 10.4348Z" transform="translate(13.9355 6.78259)" fill="#F49B1C"/>
|
| 5 |
-
<path opacity="0.3" fill-rule="evenodd" clip-rule="evenodd" d="M2.06452 0C3.31814 0.951867 4.12903 2.46735 4.12903 4.17429C4.12903 5.88124 3.31814 7.39672 2.06452 8.34859C0.810894 7.39672 0 5.88124 0 4.17429C0 2.46735 0.810894 0.951867 2.06452 0Z" transform="translate(13.9355 7.82568)" fill="#E7001A"/>
|
| 6 |
-
</svg>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/images/Creditcard_issuers/mastercard@2x.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/visa.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/visa.svg
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
<svg fill="none" height="24" viewBox="0 0 32 24" width="32" xmlns="http://www.w3.org/2000/svg"><path d="m28 0h-24c-2.20914 0-4 1.79086-4 4v16c0 2.2091 1.79086 4 4 4h24c2.2091 0 4-1.7909 4-4v-16c0-2.20914-1.7909-4-4-4z" fill="#27337a"/><path d="m9.30917 4.08183c-.01027-.83578.72153-1.30221 1.27293-1.5795.5664-.28455.7567-.46699.7545-.72141-.0043-.38944-.4518-.56128-.8707-.56798-.73081-.01171-1.15565.20365-1.49347.36656l-.26322-1.271521c.3389-.161243.96642-.30184175 1.61719-.307979 1.5275 0 2.5269.778315 2.5323 1.98512.0059 1.53152-2.0523 1.61633-2.0383 2.30091.0049.20755.1968.42905.6173.4854.2081.02846.7826.05022 1.434-.25943l.2556 1.23024c-.3502.13167-.8005.25776-1.361.25776-1.4377 0-2.44902-.78892-2.45713-1.91817zm6.27473 1.81216c-.2789 0-.514-.16793-.6189-.4257l-2.182-5.3779046h1.5264l.3038.8664676h1.8653l.1762-.8664676h1.3453l-1.174 5.8036046zm.2135-1.56779.4405-2.17928h-1.2064zm-8.33893 1.56779-1.20317-5.8036046h1.45451l1.20263 5.8036046zm-2.15176 0-1.51396-3.95015-.6124 3.35874c-.07189.37494-.35566.59141-.67077.59141h-2.4749874l-.0345926-.16849c.508078-.11382 1.08534-.29738 1.43505-.49377.21404-.11996.27512-.22485.34538-.50995l1.15993-4.6313946h1.53721l2.35661 5.8036046z" fill="#fff" transform="matrix(1 0 0 -1 7 15)"/></svg>
|
|
|
public/images/Creditcard_issuers/visa@2x.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/vpay.png
DELETED
|
Binary file
|
public/images/Creditcard_issuers/vpay@2x.png
DELETED
|
Binary file
|
public/images/{Creditcard_issuers/amex.svg → amex.svg}
RENAMED
|
File without changes
|
public/images/{Creditcard_issuers/cartebancaire.svg → cartebancaire.svg}
RENAMED
|
File without changes
|
public/images/{klarna-paynow.svg → klarnapaynow.svg}
RENAMED
|
File without changes
|
public/images/sofort.svg
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="24" viewBox="0 0 32 24" fill="none">
|
| 2 |
-
<path d="M28 0H4C1.79086 0 0 1.79086 0 4V20C0 22.2091 1.79086 24 4 24H28C30.2091 24 32 22.2091 32 20V4C32 1.79086 30.2091 0 28 0Z" fill="#
|
| 3 |
-
<path fill-rule="evenodd" clip-rule="evenodd" d="
|
|
|
|
| 4 |
</svg>
|
| 1 |
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="24" viewBox="0 0 32 24" fill="none">
|
| 2 |
+
<path d="M28 0H4C1.79086 0 0 1.79086 0 4V20C0 22.2091 1.79086 24 4 24H28C30.2091 24 32 22.2091 32 20V4C32 1.79086 30.2091 0 28 0Z" fill="#F4B6C7"/>
|
| 3 |
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.25 17.25H10V6.75H12.25V17.25ZM12.6667 12.0222C14.6631 11.039 15.9534 9.05237 15.9999 6.75088H18.3632C18.3311 8.93615 17.4292 10.9634 15.8415 12.4672L18.9999 17.25H15.9999L12.6667 12.0222Z" fill="black"/>
|
| 4 |
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M19 15.7501C19 16.5784 19.6716 17.25 20.5001 17.25C21.3284 17.25 22 16.5784 22 15.7501C22 14.9216 21.3284 14.25 20.5001 14.25C19.6716 14.25 19 14.9216 19 15.7501Z" fill="black"/>
|
| 5 |
</svg>
|
public/images/{Creditcard_issuers/vpay.svg → vpay.svg}
RENAMED
|
File without changes
|
public/js/applepayDirect.min.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
!function(e){var t={};function n(
|
| 1 |
+
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/public/js/",n(n.s="fmef")}({OiFV:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var i=function(){var e=window.ApplePaySession,t=document.querySelector("#mollie-applepayDirect-button");if(!(t&&e&&e.canMakePayments()))return!1;var n=document.createElement("button");return n.setAttribute("id","mollie_applepay_button"),n.classList.add("apple-pay-button"),n.classList.add("apple-pay-button-black"),t.appendChild(n),!0}},fmef:function(e,t,n){"use strict";n.r(t);var i=n("nxB1"),o=n("OiFV"),r=n("uXQx");!function(e){var t=e._,n=e.mollieApplePayDirectData,a=e.jQuery;if(!t.isEmpty(n)){var c=n.product,l=c.id,p=c.needShipping,s=void 0===p||p,u=c.isVariation,d=void 0!==u&&u,m=c.price,f=n.shop,y=f.countryCode,h=f.currencyCode,_=void 0===h?"EUR":h,g=f.totalLabel,b=void 0===g?"":g,v=n.ajaxUrl;if(l&&m&&y&&v&&Object(o.a)()){var w=document.getElementById("woocommerce-process-checkout-nonce").value,S=l,C=1,j=[],O=[],P="";if(document.querySelector("input.qty").addEventListener("change",(function(e){C=e.currentTarget.value})),d){var A=document.querySelector("#mollie_applepay_button");a(".single_variation_wrap").on("show_variation",(function(e,t){t.variation_id&&(S=t.variation_id),A.disabled=!1,A.classList.remove("buttonDisabled")})),A.disabled=!0,A.classList.add("buttonDisabled")}var x=C*m;document.querySelector("#mollie_applepay_button").addEventListener("click",(function(e){var t;(t=new ApplePaySession(3,Object(r.a)(y,_,b,x))).begin(),s&&(t.onshippingmethodselected=function(e){var n=this;a.ajax({url:v,method:"POST",data:{action:"mollie_apple_pay_update_shipping_method",shippingMethod:e.shippingMethod,productId:S,callerPage:"productDetail",productQuantity:C,simplifiedContact:j,nonce:w},complete:function(e,t){},success:function(t,o,r){var a=t.data;O=e.shippingMethod,!1===t.success&&(a.errors=Object(i.a)(a.errors)),n.completeShippingMethodSelection(a)},error:function(e,n,i){console.warn(n,i),t.abort()}})},t.onshippingcontactselected=function(e){var n=this;a.ajax({url:v,method:"POST",data:{action:"mollie_apple_pay_update_shipping_contact",productId:S,callerPage:"productDetail",productQuantity:C,simplifiedContact:e.shippingContact,needShipping:s,nonce:w},complete:function(e,t){},success:function(t,o,r){var a=t.data;j=e.shippingContact,!1===t.success&&(a.errors=Object(i.a)(a.errors)),a.newShippingMethods&&(O=a.newShippingMethods[0]),n.completeShippingContactSelection(a)},error:function(e,n,i){console.warn(n,i),t.abort()}})}),t.onvalidatemerchant=function(e){a.ajax({url:v,method:"POST",data:{action:"mollie_apple_pay_validation",validationUrl:e.validationURL,nonce:w},complete:function(e,t){},success:function(e,n,i){!0===e.success?t.completeMerchantValidation(JSON.parse(e.data)):(console.warn(e.data),t.abort())},error:function(e,n,i){console.warn(n,i),t.abort()}})},t.onpaymentauthorized=function(e){var n=e.payment,o=n.billingContact,r=n.shippingContact;a.ajax({url:v,method:"POST",data:{action:"mollie_apple_pay_create_order",productId:S,productQuantity:C,shippingContact:e.payment.shippingContact,billingContact:e.payment.billingContact,token:e.payment.token,shippingMethod:O,"mollie-payments-for-woocommerce_issuer_applepay":"applepay","woocommerce-process-checkout-nonce":w,billing_first_name:o.givenName||"",billing_last_name:o.familyName||"",billing_company:"",billing_country:o.countryCode||"",billing_address_1:o.addressLines[0]||"",billing_address_2:o.addressLines[1]||"",billing_postcode:o.postalCode||"",billing_city:o.locality||"",billing_state:o.administrativeArea||"",billing_phone:o.phoneNumber||"000000000000",billing_email:r.emailAddress||"",shipping_first_name:r.givenName||"",shipping_last_name:r.familyName||"",shipping_company:"",shipping_country:r.countryCode||"",shipping_address_1:r.addressLines[0]||"",shipping_address_2:r.addressLines[1]||"",shipping_postcode:r.postalCode||"",shipping_city:r.locality||"",shipping_state:r.administrativeArea||"",shipping_phone:r.phoneNumber||"000000000000",shipping_email:r.emailAddress||"",order_comments:"",payment_method:"mollie_wc_gateway_applepay",_wp_http_referer:"/?wc-ajax=update_order_review"},complete:function(e,t){},success:function(e,n,o){var r=e.data;!0===e.success?(P=r.returnUrl,t.completePayment(r.responseToApple),window.location.href=P):(r.errors=Object(i.a)(r.errors),t.completePayment(r))},error:function(e,n,i){console.warn(n,i),t.abort()}})}}))}}}(window)},nxB1:function(e,t,n){"use strict";function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){l=!0,a=e},f:function(){try{c||null==n.return||n.return()}finally{if(l)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function r(e){var t,n=[],o=i(e);try{for(o.s();!(t=o.n()).done;){var r=t.value,a=r.contactField,c=void 0===a?null:a,l=r.code,p=void 0===l?null:l,s=r.message,u=c?new ApplePayError(p,c,void 0===s?null:s):new ApplePayError(p);n.push(u)}}catch(e){o.e(e)}finally{o.f()}return n}n.d(t,"a",(function(){return r}))},uXQx:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var i=function(e,t,n,i){return{countryCode:e,currencyCode:t,supportedNetworks:["amex","maestro","masterCard","visa","vPay"],merchantCapabilities:["supports3DS"],shippingType:"shipping",requiredBillingContactFields:["postalAddress","email"],requiredShippingContactFields:["postalAddress","email"],total:{label:n,amount:i,type:"final"}}}}});
|
public/js/applepayDirectCart.min.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/public/js/",n(n.s="RX5I")}({OiFV:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var o=function(){var e=window.ApplePaySession,t=document.querySelector("#mollie-applepayDirect-button");if(!(t&&e&&e.canMakePayments()))return!1;var n=document.createElement("button");return n.setAttribute("id","mollie_applepay_button"),n.classList.add("apple-pay-button"),n.classList.add("apple-pay-button-black"),t.appendChild(n),!0}},RX5I:function(e,t,n){"use strict";n.r(t);var o=n("nxB1"),r=n("uXQx"),
|
| 1 |
+
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/public/js/",n(n.s="RX5I")}({OiFV:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var o=function(){var e=window.ApplePaySession,t=document.querySelector("#mollie-applepayDirect-button");if(!(t&&e&&e.canMakePayments()))return!1;var n=document.createElement("button");return n.setAttribute("id","mollie_applepay_button"),n.classList.add("apple-pay-button"),n.classList.add("apple-pay-button-black"),t.appendChild(n),!0}},RX5I:function(e,t,n){"use strict";n.r(t);var o=n("nxB1"),r=n("uXQx"),i=n("OiFV");!function(e){var t=e._,n=e.mollieApplePayDirectDataCart,a=e.jQuery;if(!t.isEmpty(n)){var c=n.product,l=c.needShipping,p=void 0===l||l,s=c.subtotal,u=n.shop,d=u.countryCode,m=u.currencyCode,f=void 0===m?"EUR":m,y=u.totalLabel,h=void 0===y?"":y,_=n.ajaxUrl;if(s&&d&&_){var g=document.getElementById("woocommerce-process-checkout-nonce").value,b=[],v=[],w="",S=function(){var e=new ApplePaySession(3,Object(r.a)(d,f,h,s));e.begin(),e.onshippingmethodselected=function(t){var n=this;a.ajax({url:_,method:"POST",data:{action:"mollie_apple_pay_update_shipping_method",shippingMethod:t.shippingMethod,callerPage:"cart",simplifiedContact:b,nonce:g},complete:function(e,t){},success:function(e,r,i){var a=e.data;v=t.shippingMethod,!1===e.success&&(a.errors=Object(o.a)(a.errors)),n.completeShippingMethodSelection(a)},error:function(t,n,o){console.warn(n,o),e.abort()}})},e.onshippingcontactselected=function(t){var n=this;a.ajax({url:_,method:"POST",data:{action:"mollie_apple_pay_update_shipping_contact",simplifiedContact:t.shippingContact,callerPage:"cart",needShipping:p,nonce:g},complete:function(e,t){},success:function(e,r,i){var a=e.data;b=t.shippingContact,!1===e.success&&(a.errors=Object(o.a)(a.errors)),a.newShippingMethods&&(v=a.newShippingMethods[0]),n.completeShippingContactSelection(a)},error:function(t,n,o){console.warn(n,o),e.abort()}})},e.onvalidatemerchant=function(t){a.ajax({url:_,method:"POST",data:{action:"mollie_apple_pay_validation",validationUrl:t.validationURL,nonce:g},complete:function(e,t){},success:function(t,n,o){!0===t.success?e.completeMerchantValidation(JSON.parse(t.data)):(console.warn(t.data),e.abort())},error:function(t,n,o){console.warn(n,o),e.abort()}})},e.onpaymentauthorized=function(t){var n=t.payment,r=n.billingContact,i=n.shippingContact;a.ajax({url:_,method:"POST",data:{action:"mollie_apple_pay_create_order_cart",shippingContact:t.payment.shippingContact,billingContact:t.payment.billingContact,token:t.payment.token,shippingMethod:v,"mollie-payments-for-woocommerce_issuer_applepay":"applepay","woocommerce-process-checkout-nonce":g,billing_first_name:r.givenName||"",billing_last_name:r.familyName||"",billing_company:"",billing_country:r.countryCode||"",billing_address_1:r.addressLines[0]||"",billing_address_2:r.addressLines[1]||"",billing_postcode:r.postalCode||"",billing_city:r.locality||"",billing_state:r.administrativeArea||"",billing_phone:r.phoneNumber||"000000000000",billing_email:i.emailAddress||"",shipping_first_name:i.givenName||"",shipping_last_name:i.familyName||"",shipping_company:"",shipping_country:i.countryCode||"",shipping_address_1:i.addressLines[0]||"",shipping_address_2:i.addressLines[1]||"",shipping_postcode:i.postalCode||"",shipping_city:i.locality||"",shipping_state:i.administrativeArea||"",shipping_phone:i.phoneNumber||"000000000000",shipping_email:i.emailAddress||"",order_comments:"",payment_method:"mollie_wc_gateway_applepay",_wp_http_referer:"/?wc-ajax=update_order_review"},complete:function(e,t){},success:function(t,n,r){var i=t.data;!0===t.success?(w=i.returnUrl,e.completePayment(i.responseToApple),window.location.href=w):(i.errors=Object(o.a)(i.errors),e.completePayment(i))},error:function(t,n,o){console.warn(n,o),e.abort()}})}};Object(i.a)()&&(a(document.body).on("updated_cart_totals",(function(e){Object(i.a)(),document.querySelector("#mollie_applepay_button").addEventListener("click",(function(e){S()}))})),document.querySelector("#mollie_applepay_button").addEventListener("click",(function(e){S()})))}}}(window)},nxB1:function(e,t,n){"use strict";function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){l=!0,a=e},f:function(){try{c||null==n.return||n.return()}finally{if(l)throw a}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function i(e){var t,n=[],r=o(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,a=i.contactField,c=void 0===a?null:a,l=i.code,p=void 0===l?null:l,s=i.message,u=c?new ApplePayError(p,c,void 0===s?null:s):new ApplePayError(p);n.push(u)}}catch(e){r.e(e)}finally{r.f()}return n}n.d(t,"a",(function(){return i}))},uXQx:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var o=function(e,t,n,o){return{countryCode:e,currencyCode:t,supportedNetworks:["amex","maestro","masterCard","visa","vPay"],merchantCapabilities:["supports3DS"],shippingType:"shipping",requiredBillingContactFields:["postalAddress","email"],requiredShippingContactFields:["postalAddress","email"],total:{label:n,amount:o,type:"final"}}}}});
|
readme.txt
CHANGED
|
@@ -3,7 +3,7 @@ Contributors: daanvm, danielhuesken, davdebcom, dinamiko, inpsyde, l.vangunst, n
|
|
| 3 |
Tags: mollie, payments, payment gateway, woocommerce, credit card, ideal, bancontact, klarna, sofort, giropay, woocommerce subscriptions
|
| 4 |
Requires at least: 3.8
|
| 5 |
Tested up to: 5.8
|
| 6 |
-
Stable tag: 6.
|
| 7 |
Requires PHP: 7.2
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
@@ -184,6 +184,17 @@ Automatic updates should work like a charm; as always though, ensure you backup
|
|
| 184 |
|
| 185 |
== Changelog ==
|
| 186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
= 6.6.0 - 14-09-2021 =
|
| 188 |
|
| 189 |
* Feature - Surcharge fee UI/UX improvements
|
| 3 |
Tags: mollie, payments, payment gateway, woocommerce, credit card, ideal, bancontact, klarna, sofort, giropay, woocommerce subscriptions
|
| 4 |
Requires at least: 3.8
|
| 5 |
Tested up to: 5.8
|
| 6 |
+
Stable tag: 6.7.0
|
| 7 |
Requires PHP: 7.2
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 184 |
|
| 185 |
== Changelog ==
|
| 186 |
|
| 187 |
+
= 6.7.0 - 11-11-2021 =
|
| 188 |
+
|
| 189 |
+
* Feature - New payment method - Klarna Pay Now
|
| 190 |
+
* Feature - Apple Pay Subscriptions integration
|
| 191 |
+
* Fix - Update Mollie Component Labels
|
| 192 |
+
* Fix - Incorrect logo for SOFORT payment method
|
| 193 |
+
* Fix - Tax calculation inaccurate for bundled products with mixed tax products
|
| 194 |
+
* Fix - Catch error in Object class
|
| 195 |
+
* Fix - Change NL translation for Klarna Slice It gateway
|
| 196 |
+
* Fix - Show missing selector icons for credit card
|
| 197 |
+
|
| 198 |
= 6.6.0 - 14-09-2021 =
|
| 199 |
|
| 200 |
* Feature - Surcharge fee UI/UX improvements
|
src/Mollie/WC/ActivationHandle/PluginDisabler.php
CHANGED
|
@@ -17,7 +17,6 @@ class Mollie_WC_ActivationHandle_PluginDisabler
|
|
| 17 |
$pluginSlug,
|
| 18 |
$initFunctionName
|
| 19 |
) {
|
| 20 |
-
|
| 21 |
$this->pluginSlug = $pluginSlug;
|
| 22 |
$this->initFunctionName = $initFunctionName;
|
| 23 |
}
|
|
@@ -56,10 +55,11 @@ class Mollie_WC_ActivationHandle_PluginDisabler
|
|
| 56 |
|
| 57 |
/**
|
| 58 |
* Remove the plugin from the auto-update list
|
|
|
|
| 59 |
* @param $update
|
| 60 |
* @param $item
|
| 61 |
*
|
| 62 |
-
* @return
|
| 63 |
*/
|
| 64 |
public function notAutoUpdateThisPlugin($update, $item)
|
| 65 |
{
|
| 17 |
$pluginSlug,
|
| 18 |
$initFunctionName
|
| 19 |
) {
|
|
|
|
| 20 |
$this->pluginSlug = $pluginSlug;
|
| 21 |
$this->initFunctionName = $initFunctionName;
|
| 22 |
}
|
| 55 |
|
| 56 |
/**
|
| 57 |
* Remove the plugin from the auto-update list
|
| 58 |
+
*
|
| 59 |
* @param $update
|
| 60 |
* @param $item
|
| 61 |
*
|
| 62 |
+
* @return bool|null
|
| 63 |
*/
|
| 64 |
public function notAutoUpdateThisPlugin($update, $item)
|
| 65 |
{
|
src/Mollie/WC/ApplePayButton/AjaxRequests.php
CHANGED
|
@@ -6,14 +6,17 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 6 |
* @var Mollie_WC_ApplePayButton_ResponsesToApple
|
| 7 |
*/
|
| 8 |
private $responseTemplates;
|
|
|
|
|
|
|
| 9 |
|
| 10 |
/**
|
| 11 |
* Mollie_WC_ApplePayButton_AjaxRequests constructor.
|
| 12 |
*
|
| 13 |
* @param Mollie_WC_ApplePayButton_ResponsesToApple $responseTemplates
|
| 14 |
*/
|
| 15 |
-
public function __construct(
|
| 16 |
-
|
|
|
|
| 17 |
$this->responseTemplates = $responseTemplates;
|
| 18 |
}
|
| 19 |
|
|
@@ -23,46 +26,57 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 23 |
public function bootstrapAjaxRequest()
|
| 24 |
{
|
| 25 |
add_action(
|
| 26 |
-
'wp_ajax_'
|
|
|
|
| 27 |
array($this, 'validateMerchant')
|
| 28 |
);
|
| 29 |
add_action(
|
| 30 |
-
'wp_ajax_nopriv_'
|
|
|
|
| 31 |
array($this, 'validateMerchant')
|
| 32 |
);
|
| 33 |
add_action(
|
| 34 |
-
'wp_ajax_'
|
|
|
|
| 35 |
array($this, 'createWcOrder')
|
| 36 |
);
|
| 37 |
add_action(
|
| 38 |
-
'wp_ajax_nopriv_'
|
|
|
|
| 39 |
array($this, 'createWcOrder')
|
| 40 |
);
|
| 41 |
add_action(
|
| 42 |
-
'wp_ajax_'
|
|
|
|
| 43 |
array($this, 'createWcOrderFromCart')
|
| 44 |
);
|
| 45 |
add_action(
|
| 46 |
-
'wp_ajax_nopriv_'
|
|
|
|
| 47 |
array($this, 'createWcOrderFromCart')
|
| 48 |
);
|
| 49 |
add_action(
|
| 50 |
-
'wp_ajax_'
|
|
|
|
| 51 |
array($this, 'updateShippingContact')
|
| 52 |
);
|
| 53 |
add_action(
|
| 54 |
-
'wp_ajax_nopriv_'
|
|
|
|
| 55 |
array($this, 'updateShippingContact')
|
| 56 |
);
|
| 57 |
add_action(
|
| 58 |
-
'wp_ajax_'
|
|
|
|
| 59 |
array($this, 'updateShippingMethod')
|
| 60 |
);
|
| 61 |
add_action(
|
| 62 |
-
'wp_ajax_nopriv_'
|
|
|
|
| 63 |
array($this, 'updateShippingMethod')
|
| 64 |
);
|
| 65 |
}
|
|
|
|
| 66 |
/**
|
| 67 |
* Method to validate the merchant against Apple system through Mollie
|
| 68 |
* On fail triggers and option that shows an admin notice showing the error
|
|
@@ -76,10 +90,18 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 76 |
return;
|
| 77 |
}
|
| 78 |
$validationUrl = $applePayRequestDataObject->validationUrl;
|
| 79 |
-
$completeDomain = parse_url(
|
|
|
|
|
|
|
|
|
|
| 80 |
$removeHttp = ["https://", "http://"];
|
| 81 |
-
$regex
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
$ending = preg_replace($regex, '$1', $domain);
|
| 84 |
$domain = str_replace($ending, "", $domain);//www.example.com/
|
| 85 |
$domain = str_replace("/", "", $domain);//www.example.com
|
|
@@ -112,7 +134,7 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 112 |
* On error returns an array of errors to be handled by the script
|
| 113 |
* On success returns the new contact data
|
| 114 |
*/
|
| 115 |
-
public function
|
| 116 |
{
|
| 117 |
$applePayRequestDataObject = $this->applePayDataObjectHttp();
|
| 118 |
$applePayRequestDataObject->updateContactData($_POST);
|
|
@@ -121,7 +143,9 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 121 |
return;
|
| 122 |
}
|
| 123 |
if ($applePayRequestDataObject->hasErrors()) {
|
| 124 |
-
$this->responseTemplates->responseWithDataErrors(
|
|
|
|
|
|
|
| 125 |
return;
|
| 126 |
}
|
| 127 |
|
|
@@ -157,8 +181,12 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 157 |
return;
|
| 158 |
}
|
| 159 |
|
| 160 |
-
$paymentDetails = $this->whichCalculateTotals(
|
| 161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
$this->responseTemplates->responseSuccess($response);
|
| 163 |
}
|
| 164 |
|
|
@@ -177,10 +205,16 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 177 |
return;
|
| 178 |
}
|
| 179 |
if ($applePayRequestDataObject->hasErrors()) {
|
| 180 |
-
$this->responseTemplates->responseWithDataErrors(
|
|
|
|
|
|
|
| 181 |
}
|
| 182 |
-
$paymentDetails = $this->whichCalculateTotals(
|
| 183 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
$this->responseTemplates->responseSuccess($response);
|
| 185 |
}
|
| 186 |
|
|
@@ -195,63 +229,23 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 195 |
*/
|
| 196 |
public function createWcOrder()
|
| 197 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
$applePayRequestDataObject = $this->applePayDataObjectHttp();
|
| 199 |
$applePayRequestDataObject->orderData($_POST, 'productDetail');
|
| 200 |
-
if (!$this->isNonceValid($applePayRequestDataObject)) {
|
| 201 |
-
return;
|
| 202 |
-
}
|
| 203 |
-
if ($applePayRequestDataObject->hasErrors()) {
|
| 204 |
-
$this->responseTemplates->responseWithDataErrors($applePayRequestDataObject->errors);
|
| 205 |
-
}
|
| 206 |
-
$order = wc_create_order();
|
| 207 |
-
$order->add_product(
|
| 208 |
-
wc_get_product($applePayRequestDataObject->productId),
|
| 209 |
-
$applePayRequestDataObject->productQuantity
|
| 210 |
-
);
|
| 211 |
-
$order = $this->addAddressesToOrder($applePayRequestDataObject, $order);
|
| 212 |
-
|
| 213 |
-
if(isset($applePayRequestDataObject->shippingMethod)){
|
| 214 |
-
$order = $this->addShippingMethodsToOrder(
|
| 215 |
-
$applePayRequestDataObject->shippingMethod,
|
| 216 |
-
$applePayRequestDataObject->shippingAddress,
|
| 217 |
-
$order
|
| 218 |
-
);
|
| 219 |
-
}
|
| 220 |
-
$surchargeHandler = new Mollie_WC_Helper_GatewaySurchargeHandler();
|
| 221 |
-
$order = $surchargeHandler->addSurchargeFeeProductPage($order, 'mollie_wc_gateway_applepay');
|
| 222 |
-
|
| 223 |
-
$orderId = $order->get_id();
|
| 224 |
-
|
| 225 |
-
$order->calculate_totals();
|
| 226 |
|
| 227 |
-
$
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
) {
|
| 233 |
-
$order->payment_complete();
|
| 234 |
-
|
| 235 |
-
$this->responseTemplates->responseSuccess(
|
| 236 |
-
$this->responseTemplates->authorizationResultResponse(
|
| 237 |
-
'STATUS_SUCCESS',
|
| 238 |
-
$orderId
|
| 239 |
-
)
|
| 240 |
-
);
|
| 241 |
-
} else {
|
| 242 |
-
/* translators: Placeholder 1: Payment method title */
|
| 243 |
-
$message = sprintf(
|
| 244 |
-
__(
|
| 245 |
-
'Could not create %s payment.',
|
| 246 |
-
'mollie-payments-for-woocommerce'
|
| 247 |
-
),
|
| 248 |
-
'ApplePay'
|
| 249 |
-
);
|
| 250 |
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
);
|
| 255 |
}
|
| 256 |
}
|
| 257 |
|
|
@@ -266,62 +260,13 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 266 |
*/
|
| 267 |
public function createWcOrderFromCart()
|
| 268 |
{
|
|
|
|
| 269 |
$applePayRequestDataObject = $this->applePayDataObjectHttp();
|
| 270 |
$applePayRequestDataObject->orderData($_POST, 'cart');
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
}
|
| 274 |
-
|
| 275 |
-
list($cart, $order) = $this->createOrderFromCart();
|
| 276 |
-
$order = $this->addAddressesToOrder($applePayRequestDataObject, $order);
|
| 277 |
-
$order = $this->addShippingMethodsToOrder(
|
| 278 |
-
$applePayRequestDataObject->shippingMethod,
|
| 279 |
-
$applePayRequestDataObject->shippingAddress,
|
| 280 |
-
$order
|
| 281 |
-
);
|
| 282 |
-
$surchargeHandler = new Mollie_WC_Helper_GatewaySurchargeHandler();
|
| 283 |
-
$order = $surchargeHandler->addSurchargeFeeProductPage($order, 'mollie_wc_gateway_applepay');
|
| 284 |
-
|
| 285 |
-
$orderId = $order->get_id();
|
| 286 |
-
$order->calculate_totals();
|
| 287 |
-
$this->updateOrderPostMeta($orderId, $order);
|
| 288 |
-
$result = $this->processOrderPayment($orderId);
|
| 289 |
-
if (isset($result['result'])
|
| 290 |
-
&& 'success' === $result['result']
|
| 291 |
-
) {
|
| 292 |
-
$order->payment_complete();
|
| 293 |
-
$cart->empty_cart();
|
| 294 |
-
$this->responseTemplates->responseSuccess(
|
| 295 |
-
$this->responseTemplates->authorizationResultResponse(
|
| 296 |
-
'STATUS_SUCCESS',
|
| 297 |
-
$orderId
|
| 298 |
-
)
|
| 299 |
-
);
|
| 300 |
-
} else {
|
| 301 |
-
/* translators: Placeholder 1: Payment method title */
|
| 302 |
-
$message = sprintf(
|
| 303 |
-
__(
|
| 304 |
-
'Could not create %s payment.',
|
| 305 |
-
'mollie-payments-for-woocommerce'
|
| 306 |
-
),
|
| 307 |
-
'ApplePay'
|
| 308 |
-
);
|
| 309 |
-
|
| 310 |
-
Mollie_WC_Plugin::addNotice($message, 'error');
|
| 311 |
-
|
| 312 |
-
wp_send_json_error(
|
| 313 |
-
$this->responseTemplates->authorizationResultResponse(
|
| 314 |
-
'STATUS_FAILURE',
|
| 315 |
-
0,
|
| 316 |
-
[['errorCode' => 'unknown']]
|
| 317 |
-
)
|
| 318 |
-
);
|
| 319 |
-
}
|
| 320 |
}
|
| 321 |
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
/**
|
| 326 |
* Data Object to collect and validate all needed data collected
|
| 327 |
* through HTTP
|
|
@@ -333,6 +278,45 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 333 |
return new Mollie_WC_ApplePayButton_ApplePayDataObjectHttp();
|
| 334 |
}
|
| 335 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 336 |
|
| 337 |
/**
|
| 338 |
* Returns a WC_Countries instance to check shipping
|
|
@@ -392,13 +376,10 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 392 |
$shippingMethod = null
|
| 393 |
) {
|
| 394 |
$results = [];
|
| 395 |
-
$reloadCart = false;
|
|
|
|
| 396 |
if (!WC()->cart->is_empty()) {
|
| 397 |
-
$
|
| 398 |
-
foreach ($oldCartContents as $cartItemKey => $value) {
|
| 399 |
-
WC()->cart->remove_cart_item($cartItemKey);
|
| 400 |
-
}
|
| 401 |
-
$reloadCart = true;
|
| 402 |
}
|
| 403 |
try {
|
| 404 |
//I just care about apple address details
|
|
@@ -439,10 +420,8 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 439 |
|
| 440 |
$cart->remove_cart_item($cartItemKey);
|
| 441 |
$this->customerAddress();
|
| 442 |
-
if ($reloadCart) {
|
| 443 |
-
|
| 444 |
-
$cart->restore_cart_item($cartItemKey);
|
| 445 |
-
}
|
| 446 |
}
|
| 447 |
} catch (Exception $e) {
|
| 448 |
}
|
|
@@ -451,6 +430,18 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 451 |
return $results;
|
| 452 |
}
|
| 453 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 454 |
/**
|
| 455 |
* Sets the customer address with ApplePay details to perform correct
|
| 456 |
* calculations
|
|
@@ -539,6 +530,7 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 539 |
|
| 540 |
/**
|
| 541 |
* Sets shipping packages for correct calculations
|
|
|
|
| 542 |
* @param $customerAddress
|
| 543 |
* @param $total
|
| 544 |
*
|
|
@@ -580,8 +572,11 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 580 |
$surchargeLabel = $surcharge->gatewayFeeLabel;
|
| 581 |
$settings = get_option('mollie_wc_gateway_applepay_settings', false);
|
| 582 |
|
| 583 |
-
$calculatedFee = round(
|
| 584 |
-
|
|
|
|
|
|
|
|
|
|
| 585 |
$total = $cart->get_total('edit') + $surchargeFeeValue;
|
| 586 |
$total = round($total, 2);
|
| 587 |
$result = [
|
|
@@ -599,8 +594,8 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 599 |
'total' => $total
|
| 600 |
];
|
| 601 |
|
| 602 |
-
if($surchargeFeeValue){
|
| 603 |
-
$result['fee'] =
|
| 604 |
'amount' => $surchargeFeeValue,
|
| 605 |
'label' => $surchargeLabel
|
| 606 |
];
|
|
@@ -608,6 +603,16 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 608 |
return $result;
|
| 609 |
}
|
| 610 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 611 |
/**
|
| 612 |
* Calculates totals for the cart page with the given information
|
| 613 |
* If no shippingMethodId provided will return the first available shipping
|
|
@@ -667,163 +672,77 @@ class Mollie_WC_ApplePayButton_AjaxRequests
|
|
| 667 |
return $results;
|
| 668 |
}
|
| 669 |
|
| 670 |
-
/**
|
| 671 |
-
* Add address billing and shipping data to order
|
| 672 |
-
*
|
| 673 |
-
* @param Mollie_WC_ApplePayButton_ApplePayDataObjectHttp $applePayRequestDataObject
|
| 674 |
-
* @param $order
|
| 675 |
-
*
|
| 676 |
-
* @return mixed
|
| 677 |
-
*/
|
| 678 |
-
protected function addAddressesToOrder(
|
| 679 |
-
Mollie_WC_ApplePayButton_ApplePayDataObjectHttp $applePayRequestDataObject,
|
| 680 |
-
$order
|
| 681 |
-
) {
|
| 682 |
-
$billingAddress = $applePayRequestDataObject->billingAddress;
|
| 683 |
-
$shippingAddress = $applePayRequestDataObject->shippingAddress;
|
| 684 |
-
//apple puts email in shippingAddress while we get it from WC's billingAddress
|
| 685 |
-
$billingAddress['email'] = $shippingAddress['email'];
|
| 686 |
-
$billingAddress['phone'] = $shippingAddress['phone'];
|
| 687 |
-
|
| 688 |
-
$order->set_address($billingAddress, 'billing');
|
| 689 |
-
$order->set_address($shippingAddress, 'shipping');
|
| 690 |
-
return $order;
|
| 691 |
-
}
|
| 692 |
|
| 693 |
-
|
| 694 |
-
* Add shipping methods to order
|
| 695 |
-
*
|
| 696 |
-
* @param array $shippingMethod
|
| 697 |
-
* @param array $shippingAddress
|
| 698 |
-
* @param $order
|
| 699 |
-
*
|
| 700 |
-
* @return mixed
|
| 701 |
-
*/
|
| 702 |
-
protected function addShippingMethodsToOrder(
|
| 703 |
-
array $shippingMethod,
|
| 704 |
-
array $shippingAddress,
|
| 705 |
-
$order
|
| 706 |
-
) {
|
| 707 |
-
if ($shippingMethod) {
|
| 708 |
-
$calculate_tax_for = array(
|
| 709 |
-
'country' => $shippingAddress['country'],
|
| 710 |
-
'state' => $shippingAddress['state'],
|
| 711 |
-
'postcode' => $shippingAddress['postcode'],
|
| 712 |
-
'city' => $shippingAddress['city'],
|
| 713 |
-
);
|
| 714 |
-
$item = new WC_Order_Item_Shipping();
|
| 715 |
-
$ratesIds = explode(":", $shippingMethod['identifier']);
|
| 716 |
-
$shippingMethodId = $ratesIds[0];
|
| 717 |
-
$shippingInstanceId = $ratesIds[1];
|
| 718 |
-
|
| 719 |
-
$item->set_props(
|
| 720 |
-
array(
|
| 721 |
-
'method_title' => $shippingMethod['label'],
|
| 722 |
-
'method_id' => $shippingMethodId,
|
| 723 |
-
'instance_id' => $shippingInstanceId,
|
| 724 |
-
'total' => wc_format_decimal(
|
| 725 |
-
$shippingMethod['amount']
|
| 726 |
-
),
|
| 727 |
-
)
|
| 728 |
-
);
|
| 729 |
-
$item->calculate_taxes($calculate_tax_for);
|
| 730 |
-
$order->add_item($item);
|
| 731 |
-
}
|
| 732 |
-
return $order;
|
| 733 |
-
}
|
| 734 |
-
|
| 735 |
-
/**
|
| 736 |
-
* Update order post meta
|
| 737 |
-
*
|
| 738 |
-
* @param string $orderId
|
| 739 |
-
* @param $order
|
| 740 |
-
*/
|
| 741 |
-
protected function updateOrderPostMeta($orderId, $order)
|
| 742 |
{
|
| 743 |
-
|
| 744 |
-
|
| 745 |
-
|
| 746 |
-
|
| 747 |
-
|
| 748 |
-
|
| 749 |
-
|
| 750 |
-
|
| 751 |
-
|
| 752 |
-
|
| 753 |
-
|
| 754 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 755 |
);
|
| 756 |
}
|
| 757 |
|
| 758 |
/**
|
| 759 |
-
*
|
| 760 |
-
*
|
| 761 |
-
* @param int $orderId
|
| 762 |
-
*
|
| 763 |
-
* @return array|string[]
|
| 764 |
-
* @throws \Mollie\Api\Exceptions\ApiException
|
| 765 |
-
*/
|
| 766 |
-
protected function processOrderPayment($orderId)
|
| 767 |
-
{
|
| 768 |
-
$gateway = new Mollie_WC_Gateway_Applepay();
|
| 769 |
-
|
| 770 |
-
$result = $gateway->process_payment($orderId);
|
| 771 |
-
return $result;
|
| 772 |
-
}
|
| 773 |
-
|
| 774 |
-
/**
|
| 775 |
-
* Handles the order creation in cart page
|
| 776 |
-
*
|
| 777 |
-
* @return array
|
| 778 |
-
* @throws Exception
|
| 779 |
-
*/
|
| 780 |
-
protected function createOrderFromCart()
|
| 781 |
-
{
|
| 782 |
-
$cart = WC()->cart;
|
| 783 |
-
$checkout = WC()->checkout();
|
| 784 |
-
$orderId = $checkout->create_order([]);
|
| 785 |
-
$order = wc_get_order($orderId);
|
| 786 |
-
return array($cart, $order);
|
| 787 |
-
}
|
| 788 |
-
|
| 789 |
-
/**
|
| 790 |
-
* Checks if the nonce in the data object is valid
|
| 791 |
*
|
| 792 |
* @param Mollie_WC_ApplePayButton_ApplePayDataObjectHttp $applePayRequestDataObject
|
|
|
|
| 793 |
*
|
| 794 |
-
* @return bool|int
|
| 795 |
*/
|
| 796 |
-
protected function
|
| 797 |
Mollie_WC_ApplePayButton_ApplePayDataObjectHttp $applePayRequestDataObject
|
| 798 |
) {
|
| 799 |
-
|
| 800 |
-
|
| 801 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 802 |
);
|
| 803 |
-
return $isNonceValid;
|
| 804 |
-
}
|
| 805 |
-
|
| 806 |
-
/**
|
| 807 |
-
* Calls Mollie API wallets to validate merchant session
|
| 808 |
-
*
|
| 809 |
-
* @param string $domain
|
| 810 |
-
* @param $validationUrl
|
| 811 |
-
*
|
| 812 |
-
* @return false|string
|
| 813 |
-
* @throws \Mollie\Api\Exceptions\ApiException
|
| 814 |
-
*/
|
| 815 |
-
protected function validationApiWalletsEndpointCall(
|
| 816 |
-
$domain,
|
| 817 |
-
$validationUrl
|
| 818 |
-
) {
|
| 819 |
-
$json = Mollie_WC_Plugin::getApiHelper()
|
| 820 |
-
->getApiClient()
|
| 821 |
-
->wallets
|
| 822 |
-
->requestApplePayPaymentSession(
|
| 823 |
-
$domain,
|
| 824 |
-
$validationUrl
|
| 825 |
-
);
|
| 826 |
-
return $json;
|
| 827 |
}
|
| 828 |
|
| 829 |
}
|
| 6 |
* @var Mollie_WC_ApplePayButton_ResponsesToApple
|
| 7 |
*/
|
| 8 |
private $responseTemplates;
|
| 9 |
+
private $reloadCart;
|
| 10 |
+
private $oldCartContents;
|
| 11 |
|
| 12 |
/**
|
| 13 |
* Mollie_WC_ApplePayButton_AjaxRequests constructor.
|
| 14 |
*
|
| 15 |
* @param Mollie_WC_ApplePayButton_ResponsesToApple $responseTemplates
|
| 16 |
*/
|
| 17 |
+
public function __construct(
|
| 18 |
+
Mollie_WC_ApplePayButton_ResponsesToApple $responseTemplates
|
| 19 |
+
) {
|
| 20 |
$this->responseTemplates = $responseTemplates;
|
| 21 |
}
|
| 22 |
|
| 26 |
public function bootstrapAjaxRequest()
|
| 27 |
{
|
| 28 |
add_action(
|
| 29 |
+
'wp_ajax_'
|
| 30 |
+
. Mollie_WC_ApplePayButton_PropertiesDictionary::VALIDATION,
|
| 31 |
array($this, 'validateMerchant')
|
| 32 |
);
|
| 33 |
add_action(
|
| 34 |
+
'wp_ajax_nopriv_'
|
| 35 |
+
. Mollie_WC_ApplePayButton_PropertiesDictionary::VALIDATION,
|
| 36 |
array($this, 'validateMerchant')
|
| 37 |
);
|
| 38 |
add_action(
|
| 39 |
+
'wp_ajax_'
|
| 40 |
+
. Mollie_WC_ApplePayButton_PropertiesDictionary::CREATE_ORDER,
|
| 41 |
array($this, 'createWcOrder')
|
| 42 |
);
|
| 43 |
add_action(
|
| 44 |
+
'wp_ajax_nopriv_'
|
| 45 |
+
. Mollie_WC_ApplePayButton_PropertiesDictionary::CREATE_ORDER,
|
| 46 |
array($this, 'createWcOrder')
|
| 47 |
);
|
| 48 |
add_action(
|
| 49 |
+
'wp_ajax_'
|
| 50 |
+
. Mollie_WC_ApplePayButton_PropertiesDictionary::CREATE_ORDER_CART,
|
| 51 |
array($this, 'createWcOrderFromCart')
|
| 52 |
);
|
| 53 |
add_action(
|
| 54 |
+
'wp_ajax_nopriv_'
|
| 55 |
+
. Mollie_WC_ApplePayButton_PropertiesDictionary::CREATE_ORDER_CART,
|
| 56 |
array($this, 'createWcOrderFromCart')
|
| 57 |
);
|
| 58 |
add_action(
|
| 59 |
+
'wp_ajax_'
|
| 60 |
+
. Mollie_WC_ApplePayButton_PropertiesDictionary::UPDATE_SHIPPING_CONTACT,
|
| 61 |
array($this, 'updateShippingContact')
|
| 62 |
);
|
| 63 |
add_action(
|
| 64 |
+
'wp_ajax_nopriv_'
|
| 65 |
+
. Mollie_WC_ApplePayButton_PropertiesDictionary::UPDATE_SHIPPING_CONTACT,
|
| 66 |
array($this, 'updateShippingContact')
|
| 67 |
);
|
| 68 |
add_action(
|
| 69 |
+
'wp_ajax_'
|
| 70 |
+
. Mollie_WC_ApplePayButton_PropertiesDictionary::UPDATE_SHIPPING_METHOD,
|
| 71 |
array($this, 'updateShippingMethod')
|
| 72 |
);
|
| 73 |
add_action(
|
| 74 |
+
'wp_ajax_nopriv_'
|
| 75 |
+
. Mollie_WC_ApplePayButton_PropertiesDictionary::UPDATE_SHIPPING_METHOD,
|
| 76 |
array($this, 'updateShippingMethod')
|
| 77 |
);
|
| 78 |
}
|
| 79 |
+
|
| 80 |
/**
|
| 81 |
* Method to validate the merchant against Apple system through Mollie
|
| 82 |
* On fail triggers and option that shows an admin notice showing the error
|
| 90 |
return;
|
| 91 |
}
|
| 92 |
$validationUrl = $applePayRequestDataObject->validationUrl;
|
| 93 |
+
$completeDomain = parse_url(
|
| 94 |
+
get_site_url(),
|
| 95 |
+
PHP_URL_HOST
|
| 96 |
+
); //https://www.example.com/bla/bla
|
| 97 |
$removeHttp = ["https://", "http://"];
|
| 98 |
+
$regex
|
| 99 |
+
= '/.+\.\w+\/?((\w*\/*)*)/i';//captures in $1 strings with the form bla or bla/ or bla/bla
|
| 100 |
+
$domain = str_replace(
|
| 101 |
+
$removeHttp,
|
| 102 |
+
"",
|
| 103 |
+
$completeDomain
|
| 104 |
+
);//www.example.com/bla/bla
|
| 105 |
$ending = preg_replace($regex, '$1', $domain);
|
| 106 |
$domain = str_replace($ending, "", $domain);//www.example.com/
|
| 107 |
$domain = str_replace("/", "", $domain);//www.example.com
|
| 134 |
* On error returns an array of errors to be handled by the script
|
| 135 |
* On success returns the new contact data
|
| 136 |
*/
|
| 137 |
+
public function updateShippingContact()
|
| 138 |
{
|
| 139 |
$applePayRequestDataObject = $this->applePayDataObjectHttp();
|
| 140 |
$applePayRequestDataObject->updateContactData($_POST);
|
| 143 |
return;
|
| 144 |
}
|
| 145 |
if ($applePayRequestDataObject->hasErrors()) {
|
| 146 |
+
$this->responseTemplates->responseWithDataErrors(
|
| 147 |
+
$applePayRequestDataObject->errors
|
| 148 |
+
);
|
| 149 |
return;
|
| 150 |
}
|
| 151 |
|
| 181 |
return;
|
| 182 |
}
|
| 183 |
|
| 184 |
+
$paymentDetails = $this->whichCalculateTotals(
|
| 185 |
+
$applePayRequestDataObject
|
| 186 |
+
);
|
| 187 |
+
$response = $this->responseTemplates->appleFormattedResponse(
|
| 188 |
+
$paymentDetails
|
| 189 |
+
);
|
| 190 |
$this->responseTemplates->responseSuccess($response);
|
| 191 |
}
|
| 192 |
|
| 205 |
return;
|
| 206 |
}
|
| 207 |
if ($applePayRequestDataObject->hasErrors()) {
|
| 208 |
+
$this->responseTemplates->responseWithDataErrors(
|
| 209 |
+
$applePayRequestDataObject->errors
|
| 210 |
+
);
|
| 211 |
}
|
| 212 |
+
$paymentDetails = $this->whichCalculateTotals(
|
| 213 |
+
$applePayRequestDataObject
|
| 214 |
+
);
|
| 215 |
+
$response = $this->responseTemplates->appleFormattedResponse(
|
| 216 |
+
$paymentDetails
|
| 217 |
+
);
|
| 218 |
$this->responseTemplates->responseSuccess($response);
|
| 219 |
}
|
| 220 |
|
| 229 |
*/
|
| 230 |
public function createWcOrder()
|
| 231 |
{
|
| 232 |
+
$this->responseAfterSuccessfulResult();
|
| 233 |
+
$cart = WC()->cart;
|
| 234 |
+
$this->oldCartContents = WC()->cart->get_cart_contents();
|
| 235 |
+
$this->emptyCurrentCart();
|
| 236 |
$applePayRequestDataObject = $this->applePayDataObjectHttp();
|
| 237 |
$applePayRequestDataObject->orderData($_POST, 'productDetail');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 238 |
|
| 239 |
+
$cartItemKey = $cart->add_to_cart(
|
| 240 |
+
filter_input(INPUT_POST, 'productId'),
|
| 241 |
+
filter_input(INPUT_POST, 'productQuantity')
|
| 242 |
+
);
|
| 243 |
+
$this->addAddressesToOrder($applePayRequestDataObject);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
|
| 245 |
+
WC()->checkout()->process_checkout();
|
| 246 |
+
$cart->remove_cart_item($cartItemKey);
|
| 247 |
+
if ($this->reloadCart) {
|
| 248 |
+
$this->reloadCart($cart);
|
| 249 |
}
|
| 250 |
}
|
| 251 |
|
| 260 |
*/
|
| 261 |
public function createWcOrderFromCart()
|
| 262 |
{
|
| 263 |
+
$this->responseAfterSuccessfulResult();
|
| 264 |
$applePayRequestDataObject = $this->applePayDataObjectHttp();
|
| 265 |
$applePayRequestDataObject->orderData($_POST, 'cart');
|
| 266 |
+
$this->addAddressesToOrder($applePayRequestDataObject);
|
| 267 |
+
WC()->checkout()->process_checkout();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 268 |
}
|
| 269 |
|
|
|
|
|
|
|
|
|
|
| 270 |
/**
|
| 271 |
* Data Object to collect and validate all needed data collected
|
| 272 |
* through HTTP
|
| 278 |
return new Mollie_WC_ApplePayButton_ApplePayDataObjectHttp();
|
| 279 |
}
|
| 280 |
|
| 281 |
+
/**
|
| 282 |
+
* Checks if the nonce in the data object is valid
|
| 283 |
+
*
|
| 284 |
+
* @param Mollie_WC_ApplePayButton_ApplePayDataObjectHttp $applePayRequestDataObject
|
| 285 |
+
*
|
| 286 |
+
* @return bool|int
|
| 287 |
+
*/
|
| 288 |
+
protected function isNonceValid(
|
| 289 |
+
Mollie_WC_ApplePayButton_ApplePayDataObjectHttp $applePayRequestDataObject
|
| 290 |
+
) {
|
| 291 |
+
$isNonceValid = wp_verify_nonce(
|
| 292 |
+
$applePayRequestDataObject->nonce,
|
| 293 |
+
'woocommerce-process_checkout'
|
| 294 |
+
);
|
| 295 |
+
return $isNonceValid;
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
/**
|
| 299 |
+
* Calls Mollie API wallets to validate merchant session
|
| 300 |
+
*
|
| 301 |
+
* @param string $domain
|
| 302 |
+
* @param $validationUrl
|
| 303 |
+
*
|
| 304 |
+
* @return false|string
|
| 305 |
+
* @throws \Mollie\Api\Exceptions\ApiException
|
| 306 |
+
*/
|
| 307 |
+
protected function validationApiWalletsEndpointCall(
|
| 308 |
+
$domain,
|
| 309 |
+
$validationUrl
|
| 310 |
+
) {
|
| 311 |
+
$json = Mollie_WC_Plugin::getApiHelper()
|
| 312 |
+
->getApiClient()
|
| 313 |
+
->wallets
|
| 314 |
+
->requestApplePayPaymentSession(
|
| 315 |
+
$domain,
|
| 316 |
+
$validationUrl
|
| 317 |
+
);
|
| 318 |
+
return $json;
|
| 319 |
+
}
|
| 320 |
|
| 321 |
/**
|
| 322 |
* Returns a WC_Countries instance to check shipping
|
| 376 |
$shippingMethod = null
|
| 377 |
) {
|
| 378 |
$results = [];
|
| 379 |
+
$this->reloadCart = false;
|
| 380 |
+
$this->oldCartContents = WC()->cart->get_cart_contents();
|
| 381 |
if (!WC()->cart->is_empty()) {
|
| 382 |
+
$this->emptyCurrentCart();
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
}
|
| 384 |
try {
|
| 385 |
//I just care about apple address details
|
| 420 |
|
| 421 |
$cart->remove_cart_item($cartItemKey);
|
| 422 |
$this->customerAddress();
|
| 423 |
+
if ($this->reloadCart) {
|
| 424 |
+
$this->reloadCart($cart);
|
|
|
|
|
|
|
| 425 |
}
|
| 426 |
} catch (Exception $e) {
|
| 427 |
}
|
| 430 |
return $results;
|
| 431 |
}
|
| 432 |
|
| 433 |
+
/**
|
| 434 |
+
* Empty the cart to use for calculations
|
| 435 |
+
* while saving its contents in a field
|
| 436 |
+
*/
|
| 437 |
+
protected function emptyCurrentCart()
|
| 438 |
+
{
|
| 439 |
+
foreach ($this->oldCartContents as $cartItemKey => $value) {
|
| 440 |
+
WC()->cart->remove_cart_item($cartItemKey);
|
| 441 |
+
}
|
| 442 |
+
$this->reloadCart = true;
|
| 443 |
+
}
|
| 444 |
+
|
| 445 |
/**
|
| 446 |
* Sets the customer address with ApplePay details to perform correct
|
| 447 |
* calculations
|
| 530 |
|
| 531 |
/**
|
| 532 |
* Sets shipping packages for correct calculations
|
| 533 |
+
*
|
| 534 |
* @param $customerAddress
|
| 535 |
* @param $total
|
| 536 |
*
|
| 572 |
$surchargeLabel = $surcharge->gatewayFeeLabel;
|
| 573 |
$settings = get_option('mollie_wc_gateway_applepay_settings', false);
|
| 574 |
|
| 575 |
+
$calculatedFee = round(
|
| 576 |
+
(float)$surcharge->calculteFeeAmount($cart, $settings),
|
| 577 |
+
2
|
| 578 |
+
);
|
| 579 |
+
$surchargeFeeValue = !empty($settings) ? $calculatedFee : 0;
|
| 580 |
$total = $cart->get_total('edit') + $surchargeFeeValue;
|
| 581 |
$total = round($total, 2);
|
| 582 |
$result = [
|
| 594 |
'total' => $total
|
| 595 |
];
|
| 596 |
|
| 597 |
+
if ($surchargeFeeValue) {
|
| 598 |
+
$result['fee'] = [
|
| 599 |
'amount' => $surchargeFeeValue,
|
| 600 |
'label' => $surchargeLabel
|
| 601 |
];
|
| 603 |
return $result;
|
| 604 |
}
|
| 605 |
|
| 606 |
+
/**
|
| 607 |
+
* @param WC_Cart $cart
|
| 608 |
+
*/
|
| 609 |
+
protected function reloadCart(WC_Cart $cart): void
|
| 610 |
+
{
|
| 611 |
+
foreach ($this->oldCartContents as $cartItemKey => $value) {
|
| 612 |
+
$cart->restore_cart_item($cartItemKey);
|
| 613 |
+
}
|
| 614 |
+
}
|
| 615 |
+
|
| 616 |
/**
|
| 617 |
* Calculates totals for the cart page with the given information
|
| 618 |
* If no shippingMethodId provided will return the first available shipping
|
| 672 |
return $results;
|
| 673 |
}
|
| 674 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 675 |
|
| 676 |
+
protected function responseAfterSuccessfulResult(): void
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 677 |
{
|
| 678 |
+
add_filter(
|
| 679 |
+
'woocommerce_payment_successful_result',
|
| 680 |
+
function ($result, $order_id) {
|
| 681 |
+
if (isset($result['result'])
|
| 682 |
+
&& 'success' === $result['result']
|
| 683 |
+
) {
|
| 684 |
+
$this->responseTemplates->responseSuccess(
|
| 685 |
+
$this->responseTemplates->authorizationResultResponse(
|
| 686 |
+
'STATUS_SUCCESS',
|
| 687 |
+
$order_id
|
| 688 |
+
)
|
| 689 |
+
);
|
| 690 |
+
} else {
|
| 691 |
+
/* translators: Placeholder 1: Payment method title */
|
| 692 |
+
$message = sprintf(
|
| 693 |
+
__(
|
| 694 |
+
'Could not create %s payment.',
|
| 695 |
+
'mollie-payments-for-woocommerce'
|
| 696 |
+
),
|
| 697 |
+
'ApplePay'
|
| 698 |
+
);
|
| 699 |
+
|
| 700 |
+
Mollie_WC_Plugin::addNotice($message, 'error');
|
| 701 |
+
|
| 702 |
+
wp_send_json_error(
|
| 703 |
+
$this->responseTemplates->authorizationResultResponse(
|
| 704 |
+
'STATUS_FAILURE',
|
| 705 |
+
0,
|
| 706 |
+
[['errorCode' => 'unknown']]
|
| 707 |
+
)
|
| 708 |
+
);
|
| 709 |
+
}
|
| 710 |
+
},
|
| 711 |
+
10,
|
| 712 |
+
2
|
| 713 |
);
|
| 714 |
}
|
| 715 |
|
| 716 |
/**
|
| 717 |
+
* Add address billing and shipping data to order
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 718 |
*
|
| 719 |
* @param Mollie_WC_ApplePayButton_ApplePayDataObjectHttp $applePayRequestDataObject
|
| 720 |
+
* @param $order
|
| 721 |
*
|
|
|
|
| 722 |
*/
|
| 723 |
+
protected function addAddressesToOrder(
|
| 724 |
Mollie_WC_ApplePayButton_ApplePayDataObjectHttp $applePayRequestDataObject
|
| 725 |
) {
|
| 726 |
+
add_action(
|
| 727 |
+
'woocommerce_checkout_create_order',
|
| 728 |
+
function ($order, $data) use ($applePayRequestDataObject) {
|
| 729 |
+
if (isset($applePayRequestDataObject->shippingMethod)) {
|
| 730 |
+
$billingAddress
|
| 731 |
+
= $applePayRequestDataObject->billingAddress;
|
| 732 |
+
$shippingAddress
|
| 733 |
+
= $applePayRequestDataObject->shippingAddress;
|
| 734 |
+
//apple puts email in shippingAddress while we get it from WC's billingAddress
|
| 735 |
+
$billingAddress['email'] = $shippingAddress['email'];
|
| 736 |
+
$billingAddress['phone'] = $shippingAddress['phone'];
|
| 737 |
+
|
| 738 |
+
$order->set_address($billingAddress, 'billing');
|
| 739 |
+
$order->set_address($shippingAddress, 'shipping');
|
| 740 |
+
}
|
| 741 |
+
}
|
| 742 |
+
,
|
| 743 |
+
10,
|
| 744 |
+
2
|
| 745 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 746 |
}
|
| 747 |
|
| 748 |
}
|
src/Mollie/WC/ApplePayButton/ApplePayDataObjectHttp.php
CHANGED
|
@@ -343,8 +343,8 @@ class Mollie_WC_ApplePayButton_ApplePayDataObjectHttp
|
|
| 343 |
return [
|
| 344 |
'first_name' => filter_var($data['givenName'], $filter),
|
| 345 |
'last_name' => filter_var($data['familyName'], $filter),
|
| 346 |
-
'email' => filter_var($data['emailAddress'], $filter),
|
| 347 |
-
'phone' => filter_var($data['phoneNumber'], $filter),
|
| 348 |
'address_1' => isset($data['addressLines'][0])
|
| 349 |
? filter_var($data['addressLines'][0], $filter) : '',
|
| 350 |
'address_2' => isset($data['addressLines'][1])
|
| 343 |
return [
|
| 344 |
'first_name' => filter_var($data['givenName'], $filter),
|
| 345 |
'last_name' => filter_var($data['familyName'], $filter),
|
| 346 |
+
'email' => isset($data['emailAddress']) ? filter_var($data['emailAddress'], $filter): '',
|
| 347 |
+
'phone' => isset($data['phoneNumber']) ?filter_var($data['phoneNumber'], $filter): '',
|
| 348 |
'address_1' => isset($data['addressLines'][0])
|
| 349 |
? filter_var($data['addressLines'][0], $filter) : '',
|
| 350 |
'address_2' => isset($data['addressLines'][1])
|
src/Mollie/WC/ApplePayButton/PropertiesDictionary.php
CHANGED
|
@@ -11,7 +11,7 @@ class Mollie_WC_ApplePayButton_PropertiesDictionary
|
|
| 11 |
const BILLING_CONTACT_INVALID = 'billing Contact Invalid';
|
| 12 |
const CREATE_ORDER_SINGLE_PROD_REQUIRED_FIELDS
|
| 13 |
= [
|
| 14 |
-
Mollie_WC_ApplePayButton_PropertiesDictionary::
|
| 15 |
Mollie_WC_ApplePayButton_PropertiesDictionary::PRODUCT_ID,
|
| 16 |
self::PRODUCT_QUANTITY,
|
| 17 |
self::BILLING_CONTACT,
|
|
@@ -57,9 +57,10 @@ class Mollie_WC_ApplePayButton_PropertiesDictionary
|
|
| 57 |
const SHIPPING_CONTACT = 'shippingContact';
|
| 58 |
const SHIPPING_CONTACT_INVALID = 'shipping Contact Invalid';
|
| 59 |
const NONCE = 'nonce';
|
|
|
|
| 60 |
const CREATE_ORDER_CART_REQUIRED_FIELDS
|
| 61 |
= [
|
| 62 |
-
Mollie_WC_ApplePayButton_PropertiesDictionary::
|
| 63 |
Mollie_WC_ApplePayButton_PropertiesDictionary::BILLING_CONTACT,
|
| 64 |
Mollie_WC_ApplePayButton_PropertiesDictionary::SHIPPING_CONTACT
|
| 65 |
];
|
| 11 |
const BILLING_CONTACT_INVALID = 'billing Contact Invalid';
|
| 12 |
const CREATE_ORDER_SINGLE_PROD_REQUIRED_FIELDS
|
| 13 |
= [
|
| 14 |
+
Mollie_WC_ApplePayButton_PropertiesDictionary::WCNONCE,
|
| 15 |
Mollie_WC_ApplePayButton_PropertiesDictionary::PRODUCT_ID,
|
| 16 |
self::PRODUCT_QUANTITY,
|
| 17 |
self::BILLING_CONTACT,
|
| 57 |
const SHIPPING_CONTACT = 'shippingContact';
|
| 58 |
const SHIPPING_CONTACT_INVALID = 'shipping Contact Invalid';
|
| 59 |
const NONCE = 'nonce';
|
| 60 |
+
const WCNONCE = 'woocommerce-process-checkout-nonce';
|
| 61 |
const CREATE_ORDER_CART_REQUIRED_FIELDS
|
| 62 |
= [
|
| 63 |
+
Mollie_WC_ApplePayButton_PropertiesDictionary::WCNONCE,
|
| 64 |
Mollie_WC_ApplePayButton_PropertiesDictionary::BILLING_CONTACT,
|
| 65 |
Mollie_WC_ApplePayButton_PropertiesDictionary::SHIPPING_CONTACT
|
| 66 |
];
|
src/Mollie/WC/Gateway/Abstract.php
CHANGED
|
@@ -2360,6 +2360,7 @@ abstract class Mollie_WC_Gateway_Abstract extends WC_Payment_Gateway
|
|
| 2360 |
|
| 2361 |
if ($order_payment_method == 'mollie_wc_gateway_klarnapaylater'
|
| 2362 |
|| $order_payment_method == 'mollie_wc_gateway_sliceit'
|
|
|
|
| 2363 |
) {
|
| 2364 |
Mollie_WC_Plugin::debug(
|
| 2365 |
'Creating payment object: type Order, failed for Klarna payment, stopping process.'
|
| 2360 |
|
| 2361 |
if ($order_payment_method == 'mollie_wc_gateway_klarnapaylater'
|
| 2362 |
|| $order_payment_method == 'mollie_wc_gateway_sliceit'
|
| 2363 |
+
|| $order_payment_method == 'mollie_wc_gateway_klarnapaynow'
|
| 2364 |
) {
|
| 2365 |
Mollie_WC_Plugin::debug(
|
| 2366 |
'Creating payment object: type Order, failed for Klarna payment, stopping process.'
|
src/Mollie/WC/Gateway/AbstractSubscription.php
CHANGED
|
@@ -366,6 +366,7 @@ abstract class Mollie_WC_Gateway_AbstractSubscription extends Mollie_WC_Gateway_
|
|
| 366 |
'mollie_wc_gateway_kbc',
|
| 367 |
'mollie_wc_gateway_mistercash',
|
| 368 |
'mollie_wc_gateway_sofort',
|
|
|
|
| 369 |
);
|
| 370 |
|
| 371 |
$current_method = get_post_meta( $renewal_order_id, '_payment_method', $single = true );
|
| 366 |
'mollie_wc_gateway_kbc',
|
| 367 |
'mollie_wc_gateway_mistercash',
|
| 368 |
'mollie_wc_gateway_sofort',
|
| 369 |
+
'mollie_wc_gateway_applepay'
|
| 370 |
);
|
| 371 |
|
| 372 |
$current_method = get_post_meta( $renewal_order_id, '_payment_method', $single = true );
|
src/Mollie/WC/Gateway/Applepay.php
CHANGED
|
@@ -6,19 +6,21 @@ use Mollie\Api\Types\PaymentMethod;
|
|
| 6 |
/**
|
| 7 |
* Class applepay
|
| 8 |
*/
|
| 9 |
-
class Mollie_WC_Gateway_Applepay extends
|
| 10 |
{
|
| 11 |
/**
|
| 12 |
* Mollie_WC_Gateway_Applepay constructor.
|
| 13 |
*/
|
| 14 |
public function __construct()
|
| 15 |
{
|
|
|
|
|
|
|
| 16 |
$this->supports = [
|
| 17 |
'products',
|
| 18 |
'refunds',
|
| 19 |
];
|
| 20 |
|
| 21 |
-
|
| 22 |
}
|
| 23 |
/**
|
| 24 |
* @inheritDoc
|
| 6 |
/**
|
| 7 |
* Class applepay
|
| 8 |
*/
|
| 9 |
+
class Mollie_WC_Gateway_Applepay extends Mollie_WC_Gateway_AbstractSubscription
|
| 10 |
{
|
| 11 |
/**
|
| 12 |
* Mollie_WC_Gateway_Applepay constructor.
|
| 13 |
*/
|
| 14 |
public function __construct()
|
| 15 |
{
|
| 16 |
+
parent::__construct();
|
| 17 |
+
|
| 18 |
$this->supports = [
|
| 19 |
'products',
|
| 20 |
'refunds',
|
| 21 |
];
|
| 22 |
|
| 23 |
+
$this->initSubscriptionSupport();
|
| 24 |
}
|
| 25 |
/**
|
| 26 |
* @inheritDoc
|
src/Mollie/WC/Gateway/Creditcard.php
CHANGED
|
@@ -194,7 +194,7 @@ class Mollie_WC_Gateway_Creditcard extends Mollie_WC_Gateway_AbstractSubscriptio
|
|
| 194 |
$enabledCreditCards = $this->enabledCreditcards();
|
| 195 |
|
| 196 |
$assetsImagesPath
|
| 197 |
-
= Mollie_WC_Plugin::getPluginPath('public/images/
|
| 198 |
$cardWidth = Mollie_WC_Helper_PaymentMethodsIconUrl::CREDIT_CARD_ICON_WIDTH;
|
| 199 |
$cardsNumber = count($enabledCreditCards);
|
| 200 |
$cardsWidth = $cardWidth * $cardsNumber;
|
| 194 |
$enabledCreditCards = $this->enabledCreditcards();
|
| 195 |
|
| 196 |
$assetsImagesPath
|
| 197 |
+
= Mollie_WC_Plugin::getPluginPath('public/images/');
|
| 198 |
$cardWidth = Mollie_WC_Helper_PaymentMethodsIconUrl::CREDIT_CARD_ICON_WIDTH;
|
| 199 |
$cardsNumber = count($enabledCreditCards);
|
| 200 |
$cardsWidth = $cardWidth * $cardsNumber;
|
src/Mollie/WC/Gateway/KlarnaPayNow.php
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Mollie_WC_Gateway_KlarnaPayNow extends Mollie_WC_Gateway_Abstract
|
| 4 |
+
{
|
| 5 |
+
/**
|
| 6 |
+
*
|
| 7 |
+
*/
|
| 8 |
+
public function __construct ()
|
| 9 |
+
{
|
| 10 |
+
$this->supports = array(
|
| 11 |
+
'products',
|
| 12 |
+
'refunds',
|
| 13 |
+
);
|
| 14 |
+
|
| 15 |
+
parent::__construct();
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
/**
|
| 19 |
+
* @return string
|
| 20 |
+
*/
|
| 21 |
+
public function getMollieMethodId ()
|
| 22 |
+
{
|
| 23 |
+
return 'klarnapaynow';
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
/**
|
| 27 |
+
* @return string
|
| 28 |
+
*/
|
| 29 |
+
public function getDefaultTitle ()
|
| 30 |
+
{
|
| 31 |
+
return __('Klarna Pay now', 'mollie-payments-for-woocommerce');
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
/**
|
| 35 |
+
* @return string
|
| 36 |
+
*/
|
| 37 |
+
protected function getSettingsDescription() {
|
| 38 |
+
return __('To accept payments via Klarna, all default WooCommerce checkout fields should be enabled and required.', 'mollie-payments-for-woocommerce');
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
/**
|
| 42 |
+
* @return string
|
| 43 |
+
*/
|
| 44 |
+
protected function getDefaultDescription ()
|
| 45 |
+
{
|
| 46 |
+
return '';
|
| 47 |
+
}
|
| 48 |
+
}
|
src/Mollie/WC/Helper/ApplePayDirectHandler.php
CHANGED
|
@@ -77,7 +77,16 @@ class Mollie_WC_Helper_ApplePayDirectHandler
|
|
| 77 |
add_action(
|
| 78 |
'woocommerce_cart_totals_after_order_total',
|
| 79 |
function () {
|
| 80 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
}
|
| 82 |
);
|
| 83 |
}
|
|
@@ -114,7 +123,7 @@ class Mollie_WC_Helper_ApplePayDirectHandler
|
|
| 114 |
{
|
| 115 |
?>
|
| 116 |
<div id="mollie-applepayDirect-button">
|
| 117 |
-
<?php wp_nonce_field('
|
| 118 |
</div>
|
| 119 |
<?php
|
| 120 |
}
|
| 77 |
add_action(
|
| 78 |
'woocommerce_cart_totals_after_order_total',
|
| 79 |
function () {
|
| 80 |
+
$cartItems = WC()->cart->get_cart_contents_count();
|
| 81 |
+
$isMixedCartWithShipping = false;
|
| 82 |
+
if(class_exists('WC_Subscriptions_Cart')){
|
| 83 |
+
$hasSubscriptionWithShipping = WC_Subscriptions_Cart::cart_contains_subscriptions_needing_shipping();
|
| 84 |
+
$isMixedCartWithShipping = $cartItems > 1 && $hasSubscriptionWithShipping;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
if(!$isMixedCartWithShipping){
|
| 88 |
+
$this->applePayDirectButton();
|
| 89 |
+
}
|
| 90 |
}
|
| 91 |
);
|
| 92 |
}
|
| 123 |
{
|
| 124 |
?>
|
| 125 |
<div id="mollie-applepayDirect-button">
|
| 126 |
+
<?php wp_nonce_field( 'woocommerce-process_checkout', 'woocommerce-process-checkout-nonce' ); ?>
|
| 127 |
</div>
|
| 128 |
<?php
|
| 129 |
}
|
src/Mollie/WC/Helper/OrderLines.php
CHANGED
|
@@ -307,18 +307,20 @@ class Mollie_WC_Helper_OrderLines {
|
|
| 307 |
private function get_item_vatRate( $cart_item, $product ) {
|
| 308 |
if ( $product && $product->is_taxable() && $cart_item['line_subtotal_tax'] > 0 ) {
|
| 309 |
// Calculate tax rate.
|
| 310 |
-
|
| 311 |
$_tax = new WC_Tax();
|
| 312 |
$tmp_rates = $_tax->get_rates( $product->get_tax_class() );
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
|
|
|
|
|
|
|
|
|
| 322 |
$item_vatRate = 0;
|
| 323 |
}
|
| 324 |
|
|
@@ -547,7 +549,7 @@ class Mollie_WC_Helper_OrderLines {
|
|
| 547 |
private function get_shipping_vat_rate() {
|
| 548 |
$shipping_vat_rate = 0;
|
| 549 |
if ( WC()->cart->shipping_tax_total > 0 ) {
|
| 550 |
-
$shipping_vat_rate = round( WC()->cart->shipping_tax_total / WC()->cart->shipping_total,
|
| 551 |
}
|
| 552 |
|
| 553 |
return $shipping_vat_rate;
|
| 307 |
private function get_item_vatRate( $cart_item, $product ) {
|
| 308 |
if ( $product && $product->is_taxable() && $cart_item['line_subtotal_tax'] > 0 ) {
|
| 309 |
// Calculate tax rate.
|
|
|
|
| 310 |
$_tax = new WC_Tax();
|
| 311 |
$tmp_rates = $_tax->get_rates( $product->get_tax_class() );
|
| 312 |
+
$item_vatRate = 0;
|
| 313 |
+
foreach($tmp_rates as $rate){
|
| 314 |
+
if ( isset( $rate['rate'] ) ) {
|
| 315 |
+
if($rate['compound'] === "yes" ){
|
| 316 |
+
$compoundRate = round($item_vatRate * ($rate['rate']/100)) + $rate['rate'];
|
| 317 |
+
$item_vatRate += $compoundRate;
|
| 318 |
+
continue;
|
| 319 |
+
}
|
| 320 |
+
$item_vatRate += $rate['rate'];
|
| 321 |
+
}
|
| 322 |
+
}
|
| 323 |
+
} else {
|
| 324 |
$item_vatRate = 0;
|
| 325 |
}
|
| 326 |
|
| 549 |
private function get_shipping_vat_rate() {
|
| 550 |
$shipping_vat_rate = 0;
|
| 551 |
if ( WC()->cart->shipping_tax_total > 0 ) {
|
| 552 |
+
$shipping_vat_rate = round( WC()->cart->shipping_tax_total / WC()->cart->shipping_total, 3 ) * 100;
|
| 553 |
}
|
| 554 |
|
| 555 |
return $shipping_vat_rate;
|
src/Mollie/WC/Helper/Settings.php
CHANGED
|
@@ -624,11 +624,11 @@ class Mollie_WC_Helper_Settings
|
|
| 624 |
$presentationText = __('Quickly integrate all major payment methods in WooCommerce, wherever you need them.', 'mollie-payments-for-woocommerce' );
|
| 625 |
$presentationText .= __(' Simply drop them ready-made into your WooCommerce webshop with this powerful plugin by Mollie.', 'mollie-payments-for-woocommerce');
|
| 626 |
$presentationText .= __(' Mollie is dedicated to making payments better for WooCommerce. ', 'mollie-payments-for-woocommerce');
|
| 627 |
-
$presentationText .='<p>Please go to <a href="https://www.mollie.com/dashboard/signup"
|
| 628 |
$presentationText .= __('to create a new Mollie account and start receiving payments in a couple of minutes. ', 'mollie-payments-for-woocommerce');
|
| 629 |
-
$presentationText .= 'Contact <a href="mailto:info@mollie.com">info@mollie.com</a>';
|
| 630 |
-
$presentationText .=
|
| 631 |
-
$presentationText .= '<p style="border-left: 4px solid black; padding: 8px; height:32px; font-weight:bold; font-size: medium;">Our pricing is always per transaction. No startup fees, no monthly fees, and no gateway fees. No hidden fees, period
|
| 632 |
|
| 633 |
|
| 634 |
$presentation = ''
|
| 624 |
$presentationText = __('Quickly integrate all major payment methods in WooCommerce, wherever you need them.', 'mollie-payments-for-woocommerce' );
|
| 625 |
$presentationText .= __(' Simply drop them ready-made into your WooCommerce webshop with this powerful plugin by Mollie.', 'mollie-payments-for-woocommerce');
|
| 626 |
$presentationText .= __(' Mollie is dedicated to making payments better for WooCommerce. ', 'mollie-payments-for-woocommerce');
|
| 627 |
+
$presentationText .='<p>'. __('Please go to', 'mollie-payments-for-woocommerce') .'<a href="https://www.mollie.com/dashboard/signup">'. __(' the signup page', 'mollie-payments-for-woocommerce') .'</a>';
|
| 628 |
$presentationText .= __('to create a new Mollie account and start receiving payments in a couple of minutes. ', 'mollie-payments-for-woocommerce');
|
| 629 |
+
$presentationText .= __('Contact ', 'mollie-payments-for-woocommerce') .'<a href="mailto:info@mollie.com">info@mollie.com</a>';
|
| 630 |
+
$presentationText .= __(' if you have any questions or comments about this plugin.', 'mollie-payments-for-woocommerce').'</p>';
|
| 631 |
+
$presentationText .= '<p style="border-left: 4px solid black; padding: 8px; height:32px; font-weight:bold; font-size: medium;">'. __('Our pricing is always per transaction. No startup fees, no monthly fees, and no gateway fees. No hidden fees, period.', 'mollie-payments-for-woocommerce').'</p>';
|
| 632 |
|
| 633 |
|
| 634 |
$presentation = ''
|
src/Mollie/WC/Payment/Object.php
CHANGED
|
@@ -230,7 +230,7 @@ class Mollie_WC_Payment_Object {
|
|
| 230 |
$order = wc_get_order( $order_id );
|
| 231 |
$mollie_payment_id = $order->get_meta( '_mollie_payment_id', true );
|
| 232 |
|
| 233 |
-
if ( $mollie_payment_id == $this->data->id ) {
|
| 234 |
$order->delete_meta_data( '_mollie_payment_id' );
|
| 235 |
$order->delete_meta_data( '_mollie_payment_mode' );
|
| 236 |
$order->save();
|
| 230 |
$order = wc_get_order( $order_id );
|
| 231 |
$mollie_payment_id = $order->get_meta( '_mollie_payment_id', true );
|
| 232 |
|
| 233 |
+
if (is_object($this->data) && isset($this->data->id) && $mollie_payment_id == $this->data->id ) {
|
| 234 |
$order->delete_meta_data( '_mollie_payment_id' );
|
| 235 |
$order->delete_meta_data( '_mollie_payment_mode' );
|
| 236 |
$order->save();
|
src/Mollie/WC/Plugin.php
CHANGED
|
@@ -8,7 +8,7 @@ class Mollie_WC_Plugin
|
|
| 8 |
{
|
| 9 |
const PLUGIN_ID = 'mollie-payments-for-woocommerce';
|
| 10 |
const PLUGIN_TITLE = 'Mollie Payments for WooCommerce';
|
| 11 |
-
const PLUGIN_VERSION = '6.
|
| 12 |
|
| 13 |
const DB_VERSION = '1.0';
|
| 14 |
const DB_VERSION_PARAM_NAME = 'mollie-db-version';
|
|
@@ -36,6 +36,7 @@ class Mollie_WC_Plugin
|
|
| 36 |
'Mollie_WC_Gateway_Kbc',
|
| 37 |
'Mollie_WC_Gateway_KlarnaPayLater',
|
| 38 |
'Mollie_WC_Gateway_KlarnaSliceIt',
|
|
|
|
| 39 |
'Mollie_WC_Gateway_Bancontact',
|
| 40 |
'Mollie_WC_Gateway_PayPal',
|
| 41 |
'Mollie_WC_Gateway_Paysafecard',
|
|
@@ -915,20 +916,20 @@ class Mollie_WC_Plugin
|
|
| 915 |
'componentsAttributes' => [
|
| 916 |
[
|
| 917 |
'name' => 'cardHolder',
|
| 918 |
-
'label' => esc_html__('
|
| 919 |
],
|
| 920 |
[
|
| 921 |
'name' => 'cardNumber',
|
| 922 |
-
'label' => esc_html__('Card
|
| 923 |
],
|
| 924 |
[
|
| 925 |
'name' => 'expiryDate',
|
| 926 |
-
'label' => esc_html__('Expiry
|
| 927 |
],
|
| 928 |
[
|
| 929 |
'name' => 'verificationCode',
|
| 930 |
'label' => esc_html__(
|
| 931 |
-
'
|
| 932 |
'mollie-payments-for-woocommerce'
|
| 933 |
)
|
| 934 |
],
|
| 8 |
{
|
| 9 |
const PLUGIN_ID = 'mollie-payments-for-woocommerce';
|
| 10 |
const PLUGIN_TITLE = 'Mollie Payments for WooCommerce';
|
| 11 |
+
const PLUGIN_VERSION = '6.7.0';
|
| 12 |
|
| 13 |
const DB_VERSION = '1.0';
|
| 14 |
const DB_VERSION_PARAM_NAME = 'mollie-db-version';
|
| 36 |
'Mollie_WC_Gateway_Kbc',
|
| 37 |
'Mollie_WC_Gateway_KlarnaPayLater',
|
| 38 |
'Mollie_WC_Gateway_KlarnaSliceIt',
|
| 39 |
+
'Mollie_WC_Gateway_KlarnaPayNow',
|
| 40 |
'Mollie_WC_Gateway_Bancontact',
|
| 41 |
'Mollie_WC_Gateway_PayPal',
|
| 42 |
'Mollie_WC_Gateway_Paysafecard',
|
| 916 |
'componentsAttributes' => [
|
| 917 |
[
|
| 918 |
'name' => 'cardHolder',
|
| 919 |
+
'label' => esc_html__('Name on card', 'mollie-payments-for-woocommerce')
|
| 920 |
],
|
| 921 |
[
|
| 922 |
'name' => 'cardNumber',
|
| 923 |
+
'label' => esc_html__('Card number', 'mollie-payments-for-woocommerce')
|
| 924 |
],
|
| 925 |
[
|
| 926 |
'name' => 'expiryDate',
|
| 927 |
+
'label' => esc_html__('Expiry date', 'mollie-payments-for-woocommerce')
|
| 928 |
],
|
| 929 |
[
|
| 930 |
'name' => 'verificationCode',
|
| 931 |
'label' => esc_html__(
|
| 932 |
+
'CVC/CVV',
|
| 933 |
'mollie-payments-for-woocommerce'
|
| 934 |
)
|
| 935 |
],
|
vendor/composer/autoload_classmap.php
CHANGED
|
@@ -46,6 +46,7 @@ return array(
|
|
| 46 |
'Mollie_WC_Gateway_Kbc' => $baseDir . '/src/Mollie/WC/Gateway/Kbc.php',
|
| 47 |
'Mollie_WC_Gateway_KlarnaPayLater' => $baseDir . '/src/Mollie/WC/Gateway/KlarnaPayLater.php',
|
| 48 |
'Mollie_WC_Gateway_KlarnaSliceIt' => $baseDir . '/src/Mollie/WC/Gateway/KlarnaSliceIt.php',
|
|
|
|
| 49 |
'Mollie_WC_Gateway_Mealvoucher' => $baseDir . '/src/Mollie/WC/Gateway/Mealvoucher.php',
|
| 50 |
'Mollie_WC_Gateway_MisterCash' => $baseDir . '/src/Mollie/WC/Gateway/MisterCash.php',
|
| 51 |
'Mollie_WC_Gateway_MyBank' => $baseDir . '/src/Mollie/WC/Gateway/MyBank.php',
|
| 46 |
'Mollie_WC_Gateway_Kbc' => $baseDir . '/src/Mollie/WC/Gateway/Kbc.php',
|
| 47 |
'Mollie_WC_Gateway_KlarnaPayLater' => $baseDir . '/src/Mollie/WC/Gateway/KlarnaPayLater.php',
|
| 48 |
'Mollie_WC_Gateway_KlarnaSliceIt' => $baseDir . '/src/Mollie/WC/Gateway/KlarnaSliceIt.php',
|
| 49 |
+
'Mollie_WC_Gateway_KlarnaPayNow' => $baseDir . '/src/Mollie/WC/Gateway/KlarnaPayNow.php',
|
| 50 |
'Mollie_WC_Gateway_Mealvoucher' => $baseDir . '/src/Mollie/WC/Gateway/Mealvoucher.php',
|
| 51 |
'Mollie_WC_Gateway_MisterCash' => $baseDir . '/src/Mollie/WC/Gateway/MisterCash.php',
|
| 52 |
'Mollie_WC_Gateway_MyBank' => $baseDir . '/src/Mollie/WC/Gateway/MyBank.php',
|
vendor/composer/autoload_static.php
CHANGED
|
@@ -166,6 +166,7 @@ class ComposerStaticInit68ce666d6530886f5f9fc388596510e2
|
|
| 166 |
'Mollie_WC_Gateway_Kbc' => __DIR__ . '/../..' . '/src/Mollie/WC/Gateway/Kbc.php',
|
| 167 |
'Mollie_WC_Gateway_KlarnaPayLater' => __DIR__ . '/../..' . '/src/Mollie/WC/Gateway/KlarnaPayLater.php',
|
| 168 |
'Mollie_WC_Gateway_KlarnaSliceIt' => __DIR__ . '/../..' . '/src/Mollie/WC/Gateway/KlarnaSliceIt.php',
|
|
|
|
| 169 |
'Mollie_WC_Gateway_Mealvoucher' => __DIR__ . '/../..' . '/src/Mollie/WC/Gateway/Mealvoucher.php',
|
| 170 |
'Mollie_WC_Gateway_MisterCash' => __DIR__ . '/../..' . '/src/Mollie/WC/Gateway/MisterCash.php',
|
| 171 |
'Mollie_WC_Gateway_MyBank' => __DIR__ . '/../..' . '/src/Mollie/WC/Gateway/MyBank.php',
|
| 166 |
'Mollie_WC_Gateway_Kbc' => __DIR__ . '/../..' . '/src/Mollie/WC/Gateway/Kbc.php',
|
| 167 |
'Mollie_WC_Gateway_KlarnaPayLater' => __DIR__ . '/../..' . '/src/Mollie/WC/Gateway/KlarnaPayLater.php',
|
| 168 |
'Mollie_WC_Gateway_KlarnaSliceIt' => __DIR__ . '/../..' . '/src/Mollie/WC/Gateway/KlarnaSliceIt.php',
|
| 169 |
+
'Mollie_WC_Gateway_KlarnaPayNow' => __DIR__ . '/../..' . '/src/Mollie/WC/Gateway/KlarnaPayNow.php',
|
| 170 |
'Mollie_WC_Gateway_Mealvoucher' => __DIR__ . '/../..' . '/src/Mollie/WC/Gateway/Mealvoucher.php',
|
| 171 |
'Mollie_WC_Gateway_MisterCash' => __DIR__ . '/../..' . '/src/Mollie/WC/Gateway/MisterCash.php',
|
| 172 |
'Mollie_WC_Gateway_MyBank' => __DIR__ . '/../..' . '/src/Mollie/WC/Gateway/MyBank.php',
|
