From 681641649ab541934768a04668f868e5a16427d0 Mon Sep 17 00:00:00 2001 From: Max Geraci Date: Thu, 5 Sep 2019 15:50:55 +0200 Subject: [PATCH 1/3] Added payment method Apple Pay --- Model/Config/Source/Available/Applepay.php | 12 ++ Model/ConfigProvider.php | 1 + Model/Paymentmethod/Applepay.php | 14 ++ README.md | 2 +- composer.json | 2 +- etc/adminhtml/paymentmethods.xml | 1 + etc/adminhtml/paymentmethods/applepay.xml | 121 ++++++++++++++++++ etc/config.xml | 12 ++ etc/payment.xml | 3 + view/frontend/layout/checkout_index_index.xml | 3 + .../web/js/view/payment/method-renderer.js | 1 + 11 files changed, 170 insertions(+), 2 deletions(-) create mode 100644 Model/Config/Source/Available/Applepay.php create mode 100644 Model/Paymentmethod/Applepay.php create mode 100644 etc/adminhtml/paymentmethods/applepay.xml diff --git a/Model/Config/Source/Available/Applepay.php b/Model/Config/Source/Available/Applepay.php new file mode 100644 index 00000000..af1359d9 --- /dev/null +++ b/Model/Config/Source/Available/Applepay.php @@ -0,0 +1,12 @@ + + diff --git a/etc/adminhtml/paymentmethods/applepay.xml b/etc/adminhtml/paymentmethods/applepay.xml new file mode 100644 index 00000000..5d0253b2 --- /dev/null +++ b/etc/adminhtml/paymentmethods/applepay.xml @@ -0,0 +1,121 @@ + + + + + + + Paynl\Payment\Model\Config\Source\Available\Applepay + payment/paynl_payment_applepay/active + + + + payment/paynl_payment_applepay/title + + 1 + + + + + Paynl\Payment\Model\Config\Source\Order\Status\PendingPayment + + 1 + + payment/paynl_payment_applepay/order_status + + + + Paynl\Payment\Model\Config\Source\Order\Status\Processing + + 1 + + payment/paynl_payment_applepay/order_status_authorized + + + + Paynl\Payment\Model\Config\Source\Order\Status\Processing + + 1 + + payment/paynl_payment_applepay/order_status_processing + + + + Magento\Payment\Model\Config\Source\Allspecificcountries + payment/paynl_payment_applepay/allowspecific + + 1 + + + + + Magento\Directory\Model\Config\Source\Country + 1 + payment/paynl_payment_applepay/specificcountry + + 1 + 1 + + + + + + 1 + + payment/paynl_payment_applepay/instructions + + + + payment/paynl_payment_applepay/min_order_total + + 1 + + + + + payment/paynl_payment_applepay/max_order_total + + 1 + + + + + validate-number + payment/paynl_payment_applepay/sort_order + + 1 + + + + + Paynl\Payment\Model\Config\Source\SendNewOrderEmail + payment/paynl_payment_applepay/send_new_order_email + + 1 + + + + + + + The id of the payment method, only change this if you are told to do so + payment/paynl_payment_applepay/payment_option_id + + + + + \ No newline at end of file diff --git a/etc/config.xml b/etc/config.xml index 4806d8db..51bbf2e3 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -61,6 +61,18 @@ paynl_payment after_payment + + 0 + Apple Pay + 2277 + pending_payment + processing + processing + order + Paynl\Payment\Model\Paymentmethod\Applepay + paynl_payment + after_payment + 0 Billink diff --git a/etc/payment.xml b/etc/payment.xml index ef742a76..6ae72801 100644 --- a/etc/payment.xml +++ b/etc/payment.xml @@ -21,6 +21,9 @@ 0 + + 0 + 0 diff --git a/view/frontend/layout/checkout_index_index.xml b/view/frontend/layout/checkout_index_index.xml index 34e6dbd1..af61626c 100644 --- a/view/frontend/layout/checkout_index_index.xml +++ b/view/frontend/layout/checkout_index_index.xml @@ -29,6 +29,9 @@ true + + true + true diff --git a/view/frontend/web/js/view/payment/method-renderer.js b/view/frontend/web/js/view/payment/method-renderer.js index 81de048c..6fccc96f 100644 --- a/view/frontend/web/js/view/payment/method-renderer.js +++ b/view/frontend/web/js/view/payment/method-renderer.js @@ -16,6 +16,7 @@ define( {type: 'paynl_payment_afterpay', component: defaultComponent}, {type: 'paynl_payment_alipay', component: defaultComponent}, {type: 'paynl_payment_amex', component: defaultComponent}, + {type: 'paynl_payment_applepay', component: defaultComponent}, {type: 'paynl_payment_billink', component: defaultComponent}, {type: 'paynl_payment_capayable', component: defaultComponent}, {type: 'paynl_payment_capayable_gespreid', component: defaultComponent}, From 7858ba6d00f2a8377de8816299315f9f1200eadb Mon Sep 17 00:00:00 2001 From: max-geraci <52400284+max-geraci@users.noreply.github.com> Date: Thu, 5 Sep 2019 16:03:09 +0200 Subject: [PATCH 2/3] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 87dfda5b..06798fac 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "paynl/magento2-plugin", + "name": "max-geraci/magento2-plugin", "description": "Pay.nl Magento2 Payment methods", "type": "magento2-module", "version": "1.5.2", From bcfde4a7487d625742ce0bbbb7f8e08071a53ed0 Mon Sep 17 00:00:00 2001 From: max-geraci <52400284+max-geraci@users.noreply.github.com> Date: Mon, 9 Sep 2019 10:22:56 +0200 Subject: [PATCH 3/3] Updated composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 06798fac..ed768285 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { - "name": "max-geraci/magento2-plugin", + "name": "paynl/magento2-plugin", "description": "Pay.nl Magento2 Payment methods", "type": "magento2-module", - "version": "1.5.2", + "version": "1.5.3", "require": { "magento/module-sales": "100 - 103", "magento/module-payment": "100 - 103",