Version Notes
ING PSP-Magento Extension
====================
# Changelog #
## Changes in version 1.0.0
+ Initial version based upon Ginger Payments version
## Changes in version 1.0.1
+ Updated the README.md
## Changes in version 1.0.2
+ Handle banktransfer correctly
## Changes in version 1.0.3
+ Added version to the webhook
+ Added cash on delivery
## Changes in version 1.1.0
+ Added Bancontact
+ Added product selection
## Changes in version 1.1.1
+ Renamed bcmc to bancontact
## Changes in version 1.1.5
+ Small fixes
+ Version synchronization
## Changes in version 1.1.4
+ Fixed missing library folder
## Changes in version 1.1.5
+ Added ING-PSP PayPal payment method
+ Added ING-PSP HomePay payment method
+ Added ING-PSP SOFORT payment method
+ Added ING-PSP Klarna payment method
+ Updated ing-php library to 1.2.6
## Changes in version 1.1.6
+ Updated ing-php library to 1.2.8
+ Added French translations
+ Added German translations
## Changes in version 1.1.7
+ Performance improvements
+ Some bug fixes
+ Added Dutch translations
Release Info
Developer | ING |
Extension | ing_psp |
Version | 1.1.7 |
Comparing to | |
See all releases |
Code changes from version 1.1.4 to 1.1.7
- app/code/community/ING/PSP/Block/Payment/Banktransfer/Form.php +3 -3
- app/code/community/ING/PSP/Block/Payment/Banktransfer/Info.php +3 -3
- app/code/community/ING/PSP/Block/Payment/Cashondelivery/Form.php +3 -3
- app/code/community/ING/PSP/Block/Payment/Cashondelivery/Info.php +3 -3
- app/code/community/ING/PSP/Block/Payment/Ideal/Form.php +3 -3
- app/code/community/ING/PSP/Block/Payment/Ideal/Info.php +3 -3
- app/code/community/ING/PSP/Helper/Bancontact.php +3 -3
- app/code/community/ING/PSP/Helper/Banktransfer.php +3 -3
- app/code/community/ING/PSP/Helper/Cashondelivery.php +3 -3
- app/code/community/ING/PSP/Helper/Creditcard.php +3 -3
- app/code/community/ING/PSP/Helper/Data.php +3 -3
- app/code/community/ING/PSP/Helper/HomePay.php +170 -0
- app/code/community/ING/PSP/Helper/Homepay.php +170 -0
- app/code/community/ING/PSP/Helper/Ideal.php +3 -3
- app/code/community/ING/PSP/Helper/Klarna.php +151 -0
- app/code/community/ING/PSP/Helper/Paypal.php +170 -0
- app/code/community/ING/PSP/Helper/Sofort.php +170 -0
- app/code/community/ING/PSP/Model/Bancontact.php +3 -3
- app/code/community/ING/PSP/Model/Banktransfer.php +3 -3
- app/code/community/ING/PSP/Model/Cashondelivery.php +3 -3
- app/code/community/ING/PSP/Model/Creditcard.php +3 -3
- app/code/community/ING/PSP/Model/HomePay.php +118 -0
- app/code/community/ING/PSP/Model/Homepay.php +118 -0
- app/code/community/ING/PSP/Model/Ideal.php +3 -3
- app/code/community/ING/PSP/Model/Klarna.php +118 -0
- app/code/community/ING/PSP/Model/Observer.php +54 -20
- app/code/community/ING/PSP/Model/Paypal.php +118 -0
- app/code/community/ING/PSP/Model/Sofort.php +118 -0
- app/code/community/ING/PSP/controllers/BancontactController.php +3 -3
- app/code/community/ING/PSP/controllers/BanktransferController.php +3 -3
- app/code/community/ING/PSP/controllers/CashondeliveryController.php +3 -3
- app/code/community/ING/PSP/controllers/CreditcardController.php +3 -3
- app/code/community/ING/PSP/controllers/HomePayController.php +260 -0
- app/code/community/ING/PSP/controllers/HomepayController.php +260 -0
- app/code/community/ING/PSP/controllers/IdealController.php +3 -4
- app/code/community/ING/PSP/controllers/KlarnaController.php +256 -0
- app/code/community/ING/PSP/controllers/PaypalController.php +260 -0
- app/code/community/ING/PSP/controllers/SofortController.php +260 -0
- app/code/community/ING/PSP/etc/adminhtml.xml +3 -3
- app/code/community/ING/PSP/etc/config.xml +52 -4
- app/code/community/ING/PSP/etc/system.xml +379 -14
- app/code/community/ING/PSP/etc/system.xml_bak +874 -0
- app/code/community/ING/PSP/sql/ingpsp_setup/mysql4-install-0.0.1.php +3 -3
- app/code/community/ING/PSP/sql/ingpsp_setup/mysql4-uninstall-0.0.1.php +3 -3
- app/code/community/ING/PSP/sql/ingpsp_setup/mysql4-upgrade-0.0.1-0.0.2.php +3 -3
- app/code/community/ING/PSP/sql/ingpsp_setup/mysql4-upgrade-0.0.2-0.0.3.php +3 -3
- app/design/adminhtml/default/default/template/ing_psp/info/banktransfer.phtml +3 -3
- app/design/adminhtml/default/default/template/ing_psp/info/cashondelivery.phtml +3 -3
- app/design/frontend/base/default/layout/ing_psp.xml +3 -3
- app/design/frontend/base/default/template/ing_psp/form/banktransfer.phtml +3 -3
- app/design/frontend/base/default/template/ing_psp/form/cashondelivery.phtml +3 -3
- app/design/frontend/base/default/template/ing_psp/form/ideal.phtml +3 -3
- app/design/frontend/base/default/template/ing_psp/info/banktransfer.phtml +3 -3
- app/design/frontend/base/default/template/ing_psp/info/cashondelivery.phtml +3 -3
- app/design/frontend/base/default/template/ing_psp/success.phtml +3 -3
- app/etc/modules/ING_PSP.xml +4 -4
- lib/Ing/Services/ing-php/composer.json +10 -4
- lib/Ing/Services/ing-php/composer.lock +7 -7
- lib/Ing/Services/ing-php/src/Client.php +136 -7
- lib/Ing/Services/ing-php/src/Common/IntegerBasedValueObject.php +38 -0
- lib/Ing/Services/ing-php/src/Ginger.php +2 -2
- lib/Ing/Services/ing-php/src/Order.php +178 -18
- lib/Ing/Services/ing-php/src/Order/Customer.php +60 -3
- lib/Ing/Services/ing-php/src/Order/Customer/Birthdate.php +21 -0
- lib/Ing/Services/ing-php/src/Order/Customer/Gender.php +40 -0
- lib/Ing/Services/ing-php/src/Order/Customer/IP.php +21 -0
- lib/Ing/Services/ing-php/src/Order/OrderLine.php +370 -0
- lib/Ing/Services/ing-php/src/Order/OrderLine/Amount.php +21 -0
- lib/Ing/Services/ing-php/src/Order/OrderLine/Currency.php +28 -0
- lib/Ing/Services/ing-php/src/Order/OrderLine/DiscountRate.php +22 -0
- lib/Ing/Services/ing-php/src/Order/OrderLine/Ean.php +21 -0
- lib/Ing/Services/ing-php/src/Order/OrderLine/ImageUrl.php +21 -0
- lib/Ing/Services/ing-php/src/Order/OrderLine/MerchantOrderLineId.php +21 -0
- lib/Ing/Services/ing-php/src/Order/OrderLine/Name.php +21 -0
- lib/Ing/Services/ing-php/src/Order/OrderLine/Quantity.php +21 -0
- lib/Ing/Services/ing-php/src/Order/OrderLine/Type.php +50 -0
- lib/Ing/Services/ing-php/src/Order/OrderLine/Url.php +21 -0
- lib/Ing/Services/ing-php/src/Order/OrderLine/VatPercentage.php +22 -0
- lib/Ing/Services/ing-php/src/Order/OrderLines.php +101 -0
- lib/Ing/Services/ing-php/src/Order/Transaction/PaymentMethod.php +31 -1
- lib/Ing/Services/ing-php/src/Order/Transaction/PaymentMethodDetails/HomePayPaymentMethodDetails.php +30 -0
- lib/Ing/Services/ing-php/src/Order/Transaction/PaymentMethodDetails/KlarnaPaymentMethodDetails.php +53 -0
- lib/Ing/Services/ing-php/src/Order/Transaction/PaymentMethodDetails/KlarnaPaymentMethodDetails/ErrorCode.php +21 -0
- lib/Ing/Services/ing-php/src/Order/Transaction/PaymentMethodDetails/PayPalPaymentMethodDetails.php +30 -0
- lib/Ing/Services/ing-php/src/Order/Transaction/PaymentMethodDetails/PaymentMethodDetailsFactory.php +12 -0
- lib/Ing/Services/ing-php/src/Order/Transaction/PaymentMethodDetails/PaypalPaymentMethodDetails.php +30 -0
- lib/Ing/Services/ing-php/src/Order/Transaction/Status.php +11 -1
- lib/Ing/Services/ing-php/tests/ClientTest.php +2 -2
- lib/Ing/Services/ing-php/tests/Common/IntegerBasedValueObjectTest.php +32 -0
- lib/Ing/Services/ing-php/tests/Mock/FakeIntegerBasedValueObject.php +10 -0
- lib/Ing/Services/ing-php/tests/Order/Customer/BirthdateTest.php +47 -0
- lib/Ing/Services/ing-php/tests/Order/Customer/GenderTest.php +50 -0
- lib/Ing/Services/ing-php/tests/Order/CustomerTest.php +13 -2
- lib/Ing/Services/ing-php/tests/Order/OrderLineTest.php +105 -0
- lib/Ing/Services/ing-php/tests/Order/OrderLinesTest.php +91 -0
- lib/Ing/Services/ing-php/tests/Order/Transaction/PaymentMethodDetails/PaymentMethodDetailsFactoryTest.php +14 -0
- lib/Ing/Services/ing-php/tests/OrderTest.php +14 -5
- lib/Ing/Services/ing-php/vendor/autoload.php +1 -1
- lib/Ing/Services/ing-php/vendor/composer/installed.json +52 -52
- lib/Ing/Services/ing-php/vendor/paragonie/random_compat/composer.json +34 -32
- lib/Ing/Services/ing-php/vendor/paragonie/random_compat/lib/byte_safe_strings.php +8 -8
- lib/Ing/Services/ing-php/vendor/paragonie/random_compat/lib/cast_to_int.php +12 -9
- lib/Ing/Services/ing-php/vendor/paragonie/random_compat/lib/error_polyfill.php +1 -1
- lib/Ing/Services/ing-php/vendor/paragonie/random_compat/lib/random.php +154 -146
- lib/Ing/Services/ing-php/vendor/paragonie/random_compat/lib/random_bytes_com_dotnet.php +6 -1
- lib/Ing/Services/ing-php/vendor/paragonie/random_compat/lib/random_bytes_dev_urandom.php +27 -10
- lib/Ing/Services/ing-php/vendor/paragonie/random_compat/lib/random_bytes_libsodium.php +1 -1
- lib/Ing/Services/ing-php/vendor/paragonie/random_compat/lib/random_bytes_libsodium_legacy.php +8 -4
- lib/Ing/Services/ing-php/vendor/paragonie/random_compat/lib/random_bytes_mcrypt.php +1 -1
- lib/Ing/Services/ing-php/vendor/paragonie/random_compat/lib/random_int.php +159 -160
- lib/Ing/Services/ing-php/vendor/paragonie/random_compat/psalm-autoload.php +9 -0
- lib/Ing/Services/ing-php/vendor/paragonie/random_compat/psalm.xml +15 -0
- package.xml +24 -7
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.6
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Helper_HomePay extends Mage_Core_Helper_Abstract
|
22 |
+
{
|
23 |
+
protected $orderId = null;
|
24 |
+
protected $amount = 0;
|
25 |
+
protected $description = null;
|
26 |
+
protected $returnUrl = null;
|
27 |
+
protected $paymentUrl = null;
|
28 |
+
protected $orderStatus = null;
|
29 |
+
protected $consumerInfo = array();
|
30 |
+
protected $errorMessage = '';
|
31 |
+
protected $errorCode = 0;
|
32 |
+
protected $ingLib = null;
|
33 |
+
|
34 |
+
public function __construct()
|
35 |
+
{
|
36 |
+
require_once(Mage::getBaseDir('lib').DS.'Ing'.DS.'Services'.DS.'ing-php'.DS.'vendor'.DS.'autoload.php');
|
37 |
+
|
38 |
+
if (Mage::getStoreConfig("payment/ingpsp/apikey")) {
|
39 |
+
$this->ingLib = \GingerPayments\Payment\Ginger::createClient(
|
40 |
+
Mage::getStoreConfig("payment/ingpsp/apikey"),
|
41 |
+
Mage::getStoreConfig("payment/ingpsp/product")
|
42 |
+
);
|
43 |
+
|
44 |
+
if (Mage::getStoreConfig("payment/ingpsp/bundle_cacert")) {
|
45 |
+
$this->ingLib->useBundledCA();
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
public function extensionEnabled()
|
51 |
+
{
|
52 |
+
return false;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Prepare an order and get a redirect URL
|
57 |
+
*
|
58 |
+
* @param int $orderId
|
59 |
+
* @param float $amount
|
60 |
+
* @param string $currency
|
61 |
+
* @param string $description
|
62 |
+
* @param string $returnUrl
|
63 |
+
* @param array $customer
|
64 |
+
* @return bool
|
65 |
+
*/
|
66 |
+
public function createOrder($orderId, $amount, $currency, $description, $returnUrl, $customer = array())
|
67 |
+
{
|
68 |
+
if (!$this->setOrderId($orderId) ||
|
69 |
+
!$this->setAmount($amount) ||
|
70 |
+
!$this->setDescription($description) ||
|
71 |
+
!$this->setReturnUrl($returnUrl)
|
72 |
+
) {
|
73 |
+
$this->errorMessage = "Error in the given payment data";
|
74 |
+
return false;
|
75 |
+
}
|
76 |
+
|
77 |
+
$webhookUrl = Mage::getStoreConfig("payment/ingpsp/webhook") ? Mage::getUrl('ingpsp/homepay/webhook') : null;
|
78 |
+
|
79 |
+
try {
|
80 |
+
$ingOrder = $this->ingLib->createHomepayOrder(
|
81 |
+
ING_PSP_Helper_Data::getAmountInCents($amount),
|
82 |
+
$currency,
|
83 |
+
[],
|
84 |
+
$description,
|
85 |
+
$orderId,
|
86 |
+
$returnUrl,
|
87 |
+
null,
|
88 |
+
$customer,
|
89 |
+
null,
|
90 |
+
$webhookUrl
|
91 |
+
)->toArray();
|
92 |
+
} catch (\Exception $exception) {
|
93 |
+
Mage::throwException($exception->getMessage());
|
94 |
+
}
|
95 |
+
|
96 |
+
Mage::log($ingOrder);
|
97 |
+
|
98 |
+
if (!is_array($ingOrder) or array_key_exists('error', $ingOrder) or $ingOrder['status'] == 'error') {
|
99 |
+
Mage::throwException(
|
100 |
+
"Could not start transaction. Contact the owner."
|
101 |
+
);
|
102 |
+
}
|
103 |
+
|
104 |
+
$this->orderId = (string) $ingOrder['id'];
|
105 |
+
$this->paymentUrl = (string) $ingOrder['transactions'][0]['payment_url'];
|
106 |
+
|
107 |
+
return true;
|
108 |
+
}
|
109 |
+
|
110 |
+
public function getOrderDetails($ingOrderId)
|
111 |
+
{
|
112 |
+
return $this->ingLib->getOrder($ingOrderId)->toArray();
|
113 |
+
}
|
114 |
+
|
115 |
+
public function setAmount($amount)
|
116 |
+
{
|
117 |
+
return ($this->amount = $amount);
|
118 |
+
}
|
119 |
+
|
120 |
+
public function getAmount()
|
121 |
+
{
|
122 |
+
return $this->amount;
|
123 |
+
}
|
124 |
+
|
125 |
+
public function setOrderId($orderId)
|
126 |
+
{
|
127 |
+
return ($this->orderId = $orderId);
|
128 |
+
}
|
129 |
+
|
130 |
+
public function getOrderId()
|
131 |
+
{
|
132 |
+
return $this->orderId;
|
133 |
+
}
|
134 |
+
|
135 |
+
public function setDescription($description)
|
136 |
+
{
|
137 |
+
$description = substr($description, 0, 29);
|
138 |
+
|
139 |
+
return ($this->description = $description);
|
140 |
+
}
|
141 |
+
|
142 |
+
public function getDescription()
|
143 |
+
{
|
144 |
+
return $this->description;
|
145 |
+
}
|
146 |
+
|
147 |
+
public function setReturnURL($returnUrl)
|
148 |
+
{
|
149 |
+
if (!preg_match('|(\w+)://([^/:]+)(:\d+)?(.*)|', $returnUrl)) {
|
150 |
+
return false;
|
151 |
+
}
|
152 |
+
|
153 |
+
return ($this->returnUrl = $returnUrl);
|
154 |
+
}
|
155 |
+
|
156 |
+
public function getReturnURL()
|
157 |
+
{
|
158 |
+
return $this->returnUrl;
|
159 |
+
}
|
160 |
+
|
161 |
+
public function getPaymentURL()
|
162 |
+
{
|
163 |
+
return (string) $this->paymentUrl;
|
164 |
+
}
|
165 |
+
|
166 |
+
public function getErrorMessage()
|
167 |
+
{
|
168 |
+
return $this->errorMessage;
|
169 |
+
}
|
170 |
+
}
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Helper_Homepay extends Mage_Core_Helper_Abstract
|
22 |
+
{
|
23 |
+
protected $orderId = null;
|
24 |
+
protected $amount = 0;
|
25 |
+
protected $description = null;
|
26 |
+
protected $returnUrl = null;
|
27 |
+
protected $paymentUrl = null;
|
28 |
+
protected $orderStatus = null;
|
29 |
+
protected $consumerInfo = array();
|
30 |
+
protected $errorMessage = '';
|
31 |
+
protected $errorCode = 0;
|
32 |
+
protected $ingLib = null;
|
33 |
+
|
34 |
+
public function __construct()
|
35 |
+
{
|
36 |
+
require_once(Mage::getBaseDir('lib').DS.'Ing'.DS.'Services'.DS.'ing-php'.DS.'vendor'.DS.'autoload.php');
|
37 |
+
|
38 |
+
if (Mage::getStoreConfig("payment/ingpsp/apikey")) {
|
39 |
+
$this->ingLib = \GingerPayments\Payment\Ginger::createClient(
|
40 |
+
Mage::getStoreConfig("payment/ingpsp/apikey"),
|
41 |
+
Mage::getStoreConfig("payment/ingpsp/product")
|
42 |
+
);
|
43 |
+
|
44 |
+
if (Mage::getStoreConfig("payment/ingpsp/bundle_cacert")) {
|
45 |
+
$this->ingLib->useBundledCA();
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
public function extensionEnabled()
|
51 |
+
{
|
52 |
+
return false;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Prepare an order and get a redirect URL
|
57 |
+
*
|
58 |
+
* @param int $orderId
|
59 |
+
* @param float $amount
|
60 |
+
* @param string $currency
|
61 |
+
* @param string $description
|
62 |
+
* @param string $returnUrl
|
63 |
+
* @param array $customer
|
64 |
+
* @return bool
|
65 |
+
*/
|
66 |
+
public function createOrder($orderId, $amount, $currency, $description, $returnUrl, $customer = array())
|
67 |
+
{
|
68 |
+
if (!$this->setOrderId($orderId) ||
|
69 |
+
!$this->setAmount($amount) ||
|
70 |
+
!$this->setDescription($description) ||
|
71 |
+
!$this->setReturnUrl($returnUrl)
|
72 |
+
) {
|
73 |
+
$this->errorMessage = "Error in the given payment data";
|
74 |
+
return false;
|
75 |
+
}
|
76 |
+
|
77 |
+
$webhookUrl = Mage::getStoreConfig("payment/ingpsp/webhook") ? Mage::getUrl('ingpsp/homepay/webhook') : null;
|
78 |
+
|
79 |
+
try {
|
80 |
+
$ingOrder = $this->ingLib->createHomepayOrder(
|
81 |
+
ING_PSP_Helper_Data::getAmountInCents($amount),
|
82 |
+
$currency,
|
83 |
+
[],
|
84 |
+
$description,
|
85 |
+
$orderId,
|
86 |
+
$returnUrl,
|
87 |
+
null,
|
88 |
+
$customer,
|
89 |
+
null,
|
90 |
+
$webhookUrl
|
91 |
+
)->toArray();
|
92 |
+
} catch (\Exception $exception) {
|
93 |
+
Mage::throwException($exception->getMessage());
|
94 |
+
}
|
95 |
+
|
96 |
+
Mage::log($ingOrder);
|
97 |
+
|
98 |
+
if (!is_array($ingOrder) or array_key_exists('error', $ingOrder) or $ingOrder['status'] == 'error') {
|
99 |
+
Mage::throwException(
|
100 |
+
"Could not start transaction. Contact the owner."
|
101 |
+
);
|
102 |
+
}
|
103 |
+
|
104 |
+
$this->orderId = (string) $ingOrder['id'];
|
105 |
+
$this->paymentUrl = (string) $ingOrder['transactions'][0]['payment_url'];
|
106 |
+
|
107 |
+
return true;
|
108 |
+
}
|
109 |
+
|
110 |
+
public function getOrderDetails($ingOrderId)
|
111 |
+
{
|
112 |
+
return $this->ingLib->getOrder($ingOrderId)->toArray();
|
113 |
+
}
|
114 |
+
|
115 |
+
public function setAmount($amount)
|
116 |
+
{
|
117 |
+
return ($this->amount = $amount);
|
118 |
+
}
|
119 |
+
|
120 |
+
public function getAmount()
|
121 |
+
{
|
122 |
+
return $this->amount;
|
123 |
+
}
|
124 |
+
|
125 |
+
public function setOrderId($orderId)
|
126 |
+
{
|
127 |
+
return ($this->orderId = $orderId);
|
128 |
+
}
|
129 |
+
|
130 |
+
public function getOrderId()
|
131 |
+
{
|
132 |
+
return $this->orderId;
|
133 |
+
}
|
134 |
+
|
135 |
+
public function setDescription($description)
|
136 |
+
{
|
137 |
+
$description = substr($description, 0, 29);
|
138 |
+
|
139 |
+
return ($this->description = $description);
|
140 |
+
}
|
141 |
+
|
142 |
+
public function getDescription()
|
143 |
+
{
|
144 |
+
return $this->description;
|
145 |
+
}
|
146 |
+
|
147 |
+
public function setReturnURL($returnUrl)
|
148 |
+
{
|
149 |
+
if (!preg_match('|(\w+)://([^/:]+)(:\d+)?(.*)|', $returnUrl)) {
|
150 |
+
return false;
|
151 |
+
}
|
152 |
+
|
153 |
+
return ($this->returnUrl = $returnUrl);
|
154 |
+
}
|
155 |
+
|
156 |
+
public function getReturnURL()
|
157 |
+
{
|
158 |
+
return $this->returnUrl;
|
159 |
+
}
|
160 |
+
|
161 |
+
public function getPaymentURL()
|
162 |
+
{
|
163 |
+
return (string) $this->paymentUrl;
|
164 |
+
}
|
165 |
+
|
166 |
+
public function getErrorMessage()
|
167 |
+
{
|
168 |
+
return $this->errorMessage;
|
169 |
+
}
|
170 |
+
}
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Helper_Klarna extends Mage_Core_Helper_Abstract
|
22 |
+
{
|
23 |
+
protected $orderId = null;
|
24 |
+
protected $amount = 0;
|
25 |
+
protected $description = null;
|
26 |
+
protected $returnUrl = null;
|
27 |
+
protected $paymentUrl = null;
|
28 |
+
protected $orderStatus = null;
|
29 |
+
protected $consumerInfo = array();
|
30 |
+
protected $errorMessage = '';
|
31 |
+
protected $errorCode = 0;
|
32 |
+
protected $ingLib = null;
|
33 |
+
|
34 |
+
public function __construct()
|
35 |
+
{
|
36 |
+
require_once(Mage::getBaseDir('lib').DS.'Ing'.DS.'Services'.DS.'ing-php'.DS.'vendor'.DS.'autoload.php');
|
37 |
+
|
38 |
+
$apiKey = Mage::getStoreConfig("payment/ingpsp/test_apikey")
|
39 |
+
?: Mage::getStoreConfig("payment/ingpsp/apikey");
|
40 |
+
|
41 |
+
if (strlen($apiKey) > 0) {
|
42 |
+
$this->ingLib = \GingerPayments\Payment\Ginger::createClient(
|
43 |
+
$apiKey,
|
44 |
+
Mage::getStoreConfig("payment/ingpsp/product")
|
45 |
+
);
|
46 |
+
|
47 |
+
if (Mage::getStoreConfig("payment/ingpsp/bundle_cacert")) {
|
48 |
+
$this->ingLib->useBundledCA();
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
public function extensionEnabled()
|
54 |
+
{
|
55 |
+
return false;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Prepare an order and get a redirect URL
|
60 |
+
*
|
61 |
+
* @param int $orderId
|
62 |
+
* @param float $amount
|
63 |
+
* @param string $currency
|
64 |
+
* @param string $description
|
65 |
+
* @param array $customer
|
66 |
+
* @param array $orderLines
|
67 |
+
* @return bool
|
68 |
+
*/
|
69 |
+
public function createOrder($orderId, $amount, $currency, $description, $customer = [], $orderLines = [])
|
70 |
+
{
|
71 |
+
if (!$this->setOrderId($orderId) ||
|
72 |
+
!$this->setAmount($amount) ||
|
73 |
+
!$this->setDescription($description)
|
74 |
+
) {
|
75 |
+
$this->errorMessage = "Error in the given payment data";
|
76 |
+
return false;
|
77 |
+
}
|
78 |
+
|
79 |
+
$webhookUrl = Mage::getStoreConfig("payment/ingpsp/webhook") ? Mage::getUrl('ingpsp/klarna/webhook') : null;
|
80 |
+
|
81 |
+
try {
|
82 |
+
$ingOrder = $this->ingLib->createKlarnaOrder(
|
83 |
+
ING_PSP_Helper_Data::getAmountInCents($amount),
|
84 |
+
$currency,
|
85 |
+
$description,
|
86 |
+
$orderId,
|
87 |
+
null,
|
88 |
+
null,
|
89 |
+
$customer,
|
90 |
+
null,
|
91 |
+
$webhookUrl,
|
92 |
+
$orderLines
|
93 |
+
);
|
94 |
+
} catch (\Exception $exception) {
|
95 |
+
Mage::throwException($exception->getMessage());
|
96 |
+
}
|
97 |
+
|
98 |
+
Mage::log($ingOrder->toArray());
|
99 |
+
|
100 |
+
if ($ingOrder->status()->isError()) {
|
101 |
+
$this->errorMessage = $ingOrder->transactions()->current()->reason()->toString();
|
102 |
+
return false;
|
103 |
+
} elseif ($ingOrder->status()->isCancelled()) {
|
104 |
+
return false;
|
105 |
+
} else {
|
106 |
+
return true;
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
public function getOrderDetails($ingOrderId)
|
111 |
+
{
|
112 |
+
return $this->ingLib->getOrder($ingOrderId)->toArray();
|
113 |
+
}
|
114 |
+
|
115 |
+
public function setAmount($amount)
|
116 |
+
{
|
117 |
+
return ($this->amount = $amount);
|
118 |
+
}
|
119 |
+
|
120 |
+
public function getAmount()
|
121 |
+
{
|
122 |
+
return $this->amount;
|
123 |
+
}
|
124 |
+
|
125 |
+
public function setOrderId($orderId)
|
126 |
+
{
|
127 |
+
return ($this->orderId = $orderId);
|
128 |
+
}
|
129 |
+
|
130 |
+
public function getOrderId()
|
131 |
+
{
|
132 |
+
return $this->orderId;
|
133 |
+
}
|
134 |
+
|
135 |
+
public function setDescription($description)
|
136 |
+
{
|
137 |
+
$description = substr($description, 0, 29);
|
138 |
+
|
139 |
+
return ($this->description = $description);
|
140 |
+
}
|
141 |
+
|
142 |
+
public function getDescription()
|
143 |
+
{
|
144 |
+
return $this->description;
|
145 |
+
}
|
146 |
+
|
147 |
+
public function getErrorMessage()
|
148 |
+
{
|
149 |
+
return $this->errorMessage;
|
150 |
+
}
|
151 |
+
}
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Helper_Paypal extends Mage_Core_Helper_Abstract
|
22 |
+
{
|
23 |
+
protected $orderId = null;
|
24 |
+
protected $amount = 0;
|
25 |
+
protected $description = null;
|
26 |
+
protected $returnUrl = null;
|
27 |
+
protected $paymentUrl = null;
|
28 |
+
protected $orderStatus = null;
|
29 |
+
protected $consumerInfo = array();
|
30 |
+
protected $errorMessage = '';
|
31 |
+
protected $errorCode = 0;
|
32 |
+
protected $ingLib = null;
|
33 |
+
|
34 |
+
public function __construct()
|
35 |
+
{
|
36 |
+
require_once(Mage::getBaseDir('lib').DS.'Ing'.DS.'Services'.DS.'ing-php'.DS.'vendor'.DS.'autoload.php');
|
37 |
+
|
38 |
+
if (Mage::getStoreConfig("payment/ingpsp/apikey")) {
|
39 |
+
$this->ingLib = \GingerPayments\Payment\Ginger::createClient(
|
40 |
+
Mage::getStoreConfig("payment/ingpsp/apikey"),
|
41 |
+
Mage::getStoreConfig("payment/ingpsp/product")
|
42 |
+
);
|
43 |
+
|
44 |
+
if (Mage::getStoreConfig("payment/ingpsp/bundle_cacert")) {
|
45 |
+
$this->ingLib->useBundledCA();
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
public function extensionEnabled()
|
51 |
+
{
|
52 |
+
return false;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Prepare an order and get a redirect URL
|
57 |
+
*
|
58 |
+
* @param int $orderId
|
59 |
+
* @param float $amount
|
60 |
+
* @param string $currency
|
61 |
+
* @param string $description
|
62 |
+
* @param string $returnUrl
|
63 |
+
* @param array $customer
|
64 |
+
* @return bool
|
65 |
+
*/
|
66 |
+
public function createOrder($orderId, $amount, $currency, $description, $returnUrl, $customer = array())
|
67 |
+
{
|
68 |
+
if (!$this->setOrderId($orderId) ||
|
69 |
+
!$this->setAmount($amount) ||
|
70 |
+
!$this->setDescription($description) ||
|
71 |
+
!$this->setReturnUrl($returnUrl)
|
72 |
+
) {
|
73 |
+
$this->errorMessage = "Error in the given payment data";
|
74 |
+
return false;
|
75 |
+
}
|
76 |
+
|
77 |
+
$webhookUrl = Mage::getStoreConfig("payment/ingpsp/webhook") ? Mage::getUrl('ingpsp/paypal/webhook') : null;
|
78 |
+
|
79 |
+
try {
|
80 |
+
$ingOrder = $this->ingLib->createPaypalOrder(
|
81 |
+
ING_PSP_Helper_Data::getAmountInCents($amount),
|
82 |
+
$currency,
|
83 |
+
[],
|
84 |
+
$description,
|
85 |
+
$orderId,
|
86 |
+
$returnUrl,
|
87 |
+
null,
|
88 |
+
$customer,
|
89 |
+
null,
|
90 |
+
$webhookUrl
|
91 |
+
)->toArray();
|
92 |
+
} catch (\Exception $exception) {
|
93 |
+
Mage::throwException($exception->getMessage());
|
94 |
+
}
|
95 |
+
|
96 |
+
Mage::log($ingOrder);
|
97 |
+
|
98 |
+
if (!is_array($ingOrder) or array_key_exists('error', $ingOrder) or $ingOrder['status'] == 'error') {
|
99 |
+
Mage::throwException(
|
100 |
+
"Could not start transaction. Contact the owner."
|
101 |
+
);
|
102 |
+
}
|
103 |
+
|
104 |
+
$this->orderId = (string) $ingOrder['id'];
|
105 |
+
$this->paymentUrl = (string) $ingOrder['transactions'][0]['payment_url'];
|
106 |
+
|
107 |
+
return true;
|
108 |
+
}
|
109 |
+
|
110 |
+
public function getOrderDetails($ingOrderId)
|
111 |
+
{
|
112 |
+
return $this->ingLib->getOrder($ingOrderId)->toArray();
|
113 |
+
}
|
114 |
+
|
115 |
+
public function setAmount($amount)
|
116 |
+
{
|
117 |
+
return ($this->amount = $amount);
|
118 |
+
}
|
119 |
+
|
120 |
+
public function getAmount()
|
121 |
+
{
|
122 |
+
return $this->amount;
|
123 |
+
}
|
124 |
+
|
125 |
+
public function setOrderId($orderId)
|
126 |
+
{
|
127 |
+
return ($this->orderId = $orderId);
|
128 |
+
}
|
129 |
+
|
130 |
+
public function getOrderId()
|
131 |
+
{
|
132 |
+
return $this->orderId;
|
133 |
+
}
|
134 |
+
|
135 |
+
public function setDescription($description)
|
136 |
+
{
|
137 |
+
$description = substr($description, 0, 29);
|
138 |
+
|
139 |
+
return ($this->description = $description);
|
140 |
+
}
|
141 |
+
|
142 |
+
public function getDescription()
|
143 |
+
{
|
144 |
+
return $this->description;
|
145 |
+
}
|
146 |
+
|
147 |
+
public function setReturnURL($returnUrl)
|
148 |
+
{
|
149 |
+
if (!preg_match('|(\w+)://([^/:]+)(:\d+)?(.*)|', $returnUrl)) {
|
150 |
+
return false;
|
151 |
+
}
|
152 |
+
|
153 |
+
return ($this->returnUrl = $returnUrl);
|
154 |
+
}
|
155 |
+
|
156 |
+
public function getReturnURL()
|
157 |
+
{
|
158 |
+
return $this->returnUrl;
|
159 |
+
}
|
160 |
+
|
161 |
+
public function getPaymentURL()
|
162 |
+
{
|
163 |
+
return (string) $this->paymentUrl;
|
164 |
+
}
|
165 |
+
|
166 |
+
public function getErrorMessage()
|
167 |
+
{
|
168 |
+
return $this->errorMessage;
|
169 |
+
}
|
170 |
+
}
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Helper_Sofort extends Mage_Core_Helper_Abstract
|
22 |
+
{
|
23 |
+
protected $orderId = null;
|
24 |
+
protected $amount = 0;
|
25 |
+
protected $description = null;
|
26 |
+
protected $returnUrl = null;
|
27 |
+
protected $paymentUrl = null;
|
28 |
+
protected $orderStatus = null;
|
29 |
+
protected $consumerInfo = array();
|
30 |
+
protected $errorMessage = '';
|
31 |
+
protected $errorCode = 0;
|
32 |
+
protected $ingLib = null;
|
33 |
+
|
34 |
+
public function __construct()
|
35 |
+
{
|
36 |
+
require_once(Mage::getBaseDir('lib').DS.'Ing'.DS.'Services'.DS.'ing-php'.DS.'vendor'.DS.'autoload.php');
|
37 |
+
|
38 |
+
if (Mage::getStoreConfig("payment/ingpsp/apikey")) {
|
39 |
+
$this->ingLib = \GingerPayments\Payment\Ginger::createClient(
|
40 |
+
Mage::getStoreConfig("payment/ingpsp/apikey"),
|
41 |
+
Mage::getStoreConfig("payment/ingpsp/product")
|
42 |
+
);
|
43 |
+
|
44 |
+
if (Mage::getStoreConfig("payment/ingpsp/bundle_cacert")) {
|
45 |
+
$this->ingLib->useBundledCA();
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
public function extensionEnabled()
|
51 |
+
{
|
52 |
+
return false;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Prepare an order and get a redirect URL
|
57 |
+
*
|
58 |
+
* @param int $orderId
|
59 |
+
* @param float $amount
|
60 |
+
* @param string $currency
|
61 |
+
* @param string $description
|
62 |
+
* @param string $returnUrl
|
63 |
+
* @param array $customer
|
64 |
+
* @return bool
|
65 |
+
*/
|
66 |
+
public function createOrder($orderId, $amount, $currency, $description, $returnUrl, $customer = array())
|
67 |
+
{
|
68 |
+
if (!$this->setOrderId($orderId) ||
|
69 |
+
!$this->setAmount($amount) ||
|
70 |
+
!$this->setDescription($description) ||
|
71 |
+
!$this->setReturnUrl($returnUrl)
|
72 |
+
) {
|
73 |
+
$this->errorMessage = "Error in the given payment data";
|
74 |
+
return false;
|
75 |
+
}
|
76 |
+
|
77 |
+
$webhookUrl = Mage::getStoreConfig("payment/ingpsp/webhook") ? Mage::getUrl('ingpsp/paypal/webhook') : null;
|
78 |
+
|
79 |
+
try {
|
80 |
+
$ingOrder = $this->ingLib->createSofortOrder(
|
81 |
+
ING_PSP_Helper_Data::getAmountInCents($amount),
|
82 |
+
$currency,
|
83 |
+
[],
|
84 |
+
$description,
|
85 |
+
$orderId,
|
86 |
+
$returnUrl,
|
87 |
+
null,
|
88 |
+
$customer,
|
89 |
+
null,
|
90 |
+
$webhookUrl
|
91 |
+
)->toArray();
|
92 |
+
} catch (\Exception $exception) {
|
93 |
+
Mage::throwException($exception->getMessage());
|
94 |
+
}
|
95 |
+
|
96 |
+
Mage::log($ingOrder);
|
97 |
+
|
98 |
+
if (!is_array($ingOrder) or array_key_exists('error', $ingOrder) or $ingOrder['status'] == 'error') {
|
99 |
+
Mage::throwException(
|
100 |
+
"Could not start transaction. Contact the owner."
|
101 |
+
);
|
102 |
+
}
|
103 |
+
|
104 |
+
$this->orderId = (string) $ingOrder['id'];
|
105 |
+
$this->paymentUrl = (string) $ingOrder['transactions'][0]['payment_url'];
|
106 |
+
|
107 |
+
return true;
|
108 |
+
}
|
109 |
+
|
110 |
+
public function getOrderDetails($ingOrderId)
|
111 |
+
{
|
112 |
+
return $this->ingLib->getOrder($ingOrderId)->toArray();
|
113 |
+
}
|
114 |
+
|
115 |
+
public function setAmount($amount)
|
116 |
+
{
|
117 |
+
return ($this->amount = $amount);
|
118 |
+
}
|
119 |
+
|
120 |
+
public function getAmount()
|
121 |
+
{
|
122 |
+
return $this->amount;
|
123 |
+
}
|
124 |
+
|
125 |
+
public function setOrderId($orderId)
|
126 |
+
{
|
127 |
+
return ($this->orderId = $orderId);
|
128 |
+
}
|
129 |
+
|
130 |
+
public function getOrderId()
|
131 |
+
{
|
132 |
+
return $this->orderId;
|
133 |
+
}
|
134 |
+
|
135 |
+
public function setDescription($description)
|
136 |
+
{
|
137 |
+
$description = substr($description, 0, 29);
|
138 |
+
|
139 |
+
return ($this->description = $description);
|
140 |
+
}
|
141 |
+
|
142 |
+
public function getDescription()
|
143 |
+
{
|
144 |
+
return $this->description;
|
145 |
+
}
|
146 |
+
|
147 |
+
public function setReturnURL($returnUrl)
|
148 |
+
{
|
149 |
+
if (!preg_match('|(\w+)://([^/:]+)(:\d+)?(.*)|', $returnUrl)) {
|
150 |
+
return false;
|
151 |
+
}
|
152 |
+
|
153 |
+
return ($this->returnUrl = $returnUrl);
|
154 |
+
}
|
155 |
+
|
156 |
+
public function getReturnURL()
|
157 |
+
{
|
158 |
+
return $this->returnUrl;
|
159 |
+
}
|
160 |
+
|
161 |
+
public function getPaymentURL()
|
162 |
+
{
|
163 |
+
return (string) $this->paymentUrl;
|
164 |
+
}
|
165 |
+
|
166 |
+
public function getErrorMessage()
|
167 |
+
{
|
168 |
+
return $this->errorMessage;
|
169 |
+
}
|
170 |
+
}
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.6
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Model_Homepay extends Mage_Payment_Model_Method_Abstract
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_HomePay
|
25 |
+
*/
|
26 |
+
protected $_HomePay;
|
27 |
+
|
28 |
+
protected $_code = 'ingpsp_homepay';
|
29 |
+
protected $_paymentMethod = 'HomePay';
|
30 |
+
protected $_isGateway = true;
|
31 |
+
protected $_canAuthorize = true;
|
32 |
+
protected $_canUseCheckout = true;
|
33 |
+
protected $_canUseInternal = true;
|
34 |
+
protected $_canUseForMultishipping = false;
|
35 |
+
protected $_canRefund = true;
|
36 |
+
protected $_canRefundInvoicePartial = false;
|
37 |
+
protected $_canCapture = false;
|
38 |
+
|
39 |
+
// Payment flags
|
40 |
+
const PAYMENT_FLAG_PENDING = "Payment is pending";
|
41 |
+
const PAYMENT_FLAG_COMPLETED = "Payment is completed";
|
42 |
+
const PAYMENT_FLAG_CANCELLED = "Payment is cancelled";
|
43 |
+
const PAYMENT_FLAG_ERROR = "Payment failed with an error";
|
44 |
+
const PAYMENT_FLAG_FRAUD = "Amounts don't match. Possible fraud";
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Build constructor
|
48 |
+
*/
|
49 |
+
public function __construct()
|
50 |
+
{
|
51 |
+
parent::_construct();
|
52 |
+
$this->_HomePay = Mage::helper('ingpsp/homepay');
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @param Mage_Sales_Model_Quote|null $quote
|
57 |
+
* @return bool
|
58 |
+
*/
|
59 |
+
public function isAvailable($quote = null)
|
60 |
+
{
|
61 |
+
if (Mage::getStoreConfig('payment/ingpsp/apikey', $quote ? $quote->getStoreId() : null)) {
|
62 |
+
return parent::isAvailable($quote);
|
63 |
+
}
|
64 |
+
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Get checkout session namespace
|
70 |
+
*
|
71 |
+
* @return Mage_Checkout_Model_Session
|
72 |
+
*/
|
73 |
+
protected function _getCheckout()
|
74 |
+
{
|
75 |
+
return Mage::getSingleton('checkout/session');
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Get current quote
|
80 |
+
*
|
81 |
+
* @return Mage_Sales_Model_Quote
|
82 |
+
*/
|
83 |
+
public function getQuote()
|
84 |
+
{
|
85 |
+
return $this->_getCheckout()->getQuote();
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* HomePay is only active if 'EURO' is currency
|
90 |
+
*
|
91 |
+
* @param string $currencyCode
|
92 |
+
* @return bool
|
93 |
+
*/
|
94 |
+
public function canUseForCurrency($currencyCode)
|
95 |
+
{
|
96 |
+
if ($currencyCode !== "EUR") {
|
97 |
+
return false;
|
98 |
+
}
|
99 |
+
|
100 |
+
return parent::canUseForCurrency($currencyCode);
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Redirects the client on click 'Place Order' to selected HomePay bank
|
105 |
+
*
|
106 |
+
* @return string
|
107 |
+
*/
|
108 |
+
public function getOrderPlaceRedirectUrl()
|
109 |
+
{
|
110 |
+
return Mage::getUrl(
|
111 |
+
'ingpsp/homepay/payment',
|
112 |
+
array(
|
113 |
+
'_secure' => true,
|
114 |
+
'_query' => array(),
|
115 |
+
)
|
116 |
+
);
|
117 |
+
}
|
118 |
+
}
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Model_Homepay extends Mage_Payment_Model_Method_Abstract
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_HomePay
|
25 |
+
*/
|
26 |
+
protected $_HomePay;
|
27 |
+
|
28 |
+
protected $_code = 'ingpsp_homepay';
|
29 |
+
protected $_paymentMethod = 'HomePay';
|
30 |
+
protected $_isGateway = true;
|
31 |
+
protected $_canAuthorize = true;
|
32 |
+
protected $_canUseCheckout = true;
|
33 |
+
protected $_canUseInternal = true;
|
34 |
+
protected $_canUseForMultishipping = false;
|
35 |
+
protected $_canRefund = true;
|
36 |
+
protected $_canRefundInvoicePartial = false;
|
37 |
+
protected $_canCapture = false;
|
38 |
+
|
39 |
+
// Payment flags
|
40 |
+
const PAYMENT_FLAG_PENDING = "Payment is pending";
|
41 |
+
const PAYMENT_FLAG_COMPLETED = "Payment is completed";
|
42 |
+
const PAYMENT_FLAG_CANCELLED = "Payment is cancelled";
|
43 |
+
const PAYMENT_FLAG_ERROR = "Payment failed with an error";
|
44 |
+
const PAYMENT_FLAG_FRAUD = "Amounts don't match. Possible fraud";
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Build constructor
|
48 |
+
*/
|
49 |
+
public function __construct()
|
50 |
+
{
|
51 |
+
parent::_construct();
|
52 |
+
$this->_HomePay = Mage::helper('ingpsp/homepay');
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @param Mage_Sales_Model_Quote|null $quote
|
57 |
+
* @return bool
|
58 |
+
*/
|
59 |
+
public function isAvailable($quote = null)
|
60 |
+
{
|
61 |
+
if (Mage::getStoreConfig('payment/ingpsp/apikey', $quote ? $quote->getStoreId() : null)) {
|
62 |
+
return parent::isAvailable($quote);
|
63 |
+
}
|
64 |
+
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Get checkout session namespace
|
70 |
+
*
|
71 |
+
* @return Mage_Checkout_Model_Session
|
72 |
+
*/
|
73 |
+
protected function _getCheckout()
|
74 |
+
{
|
75 |
+
return Mage::getSingleton('checkout/session');
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Get current quote
|
80 |
+
*
|
81 |
+
* @return Mage_Sales_Model_Quote
|
82 |
+
*/
|
83 |
+
public function getQuote()
|
84 |
+
{
|
85 |
+
return $this->_getCheckout()->getQuote();
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* HomePay is only active if 'EURO' is currency
|
90 |
+
*
|
91 |
+
* @param string $currencyCode
|
92 |
+
* @return bool
|
93 |
+
*/
|
94 |
+
public function canUseForCurrency($currencyCode)
|
95 |
+
{
|
96 |
+
if ($currencyCode !== "EUR") {
|
97 |
+
return false;
|
98 |
+
}
|
99 |
+
|
100 |
+
return parent::canUseForCurrency($currencyCode);
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Redirects the client on click 'Place Order' to selected HomePay bank
|
105 |
+
*
|
106 |
+
* @return string
|
107 |
+
*/
|
108 |
+
public function getOrderPlaceRedirectUrl()
|
109 |
+
{
|
110 |
+
return Mage::getUrl(
|
111 |
+
'ingpsp/homepay/payment',
|
112 |
+
array(
|
113 |
+
'_secure' => true,
|
114 |
+
'_query' => array(),
|
115 |
+
)
|
116 |
+
);
|
117 |
+
}
|
118 |
+
}
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Model_Klarna extends Mage_Payment_Model_Method_Abstract
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_Klarna
|
25 |
+
*/
|
26 |
+
protected $_klarna;
|
27 |
+
|
28 |
+
protected $_code = 'ingpsp_klarna';
|
29 |
+
protected $_paymentMethod = 'Klarna';
|
30 |
+
protected $_isGateway = true;
|
31 |
+
protected $_canAuthorize = true;
|
32 |
+
protected $_canUseCheckout = true;
|
33 |
+
protected $_canUseInternal = true;
|
34 |
+
protected $_canUseForMultishipping = false;
|
35 |
+
protected $_canRefund = true;
|
36 |
+
protected $_canRefundInvoicePartial = false;
|
37 |
+
protected $_canCapture = false;
|
38 |
+
|
39 |
+
// Payment flags
|
40 |
+
const PAYMENT_FLAG_PENDING = "Payment is pending";
|
41 |
+
const PAYMENT_FLAG_COMPLETED = "Payment is completed";
|
42 |
+
const PAYMENT_FLAG_CANCELLED = "Payment is cancelled";
|
43 |
+
const PAYMENT_FLAG_ERROR = "Payment failed with an error";
|
44 |
+
const PAYMENT_FLAG_FRAUD = "Amounts don't match. Possible fraud";
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Build constructor
|
48 |
+
*/
|
49 |
+
public function __construct()
|
50 |
+
{
|
51 |
+
parent::_construct();
|
52 |
+
$this->_klarna = Mage::helper('ingpsp/klarna');
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @param Mage_Sales_Model_Quote|null $quote
|
57 |
+
* @return bool
|
58 |
+
*/
|
59 |
+
public function isAvailable($quote = null)
|
60 |
+
{
|
61 |
+
if (Mage::getStoreConfig('payment/ingpsp/apikey', $quote ? $quote->getStoreId() : null)) {
|
62 |
+
return parent::isAvailable($quote);
|
63 |
+
}
|
64 |
+
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Get checkout session namespace
|
70 |
+
*
|
71 |
+
* @return Mage_Checkout_Model_Session
|
72 |
+
*/
|
73 |
+
protected function _getCheckout()
|
74 |
+
{
|
75 |
+
return Mage::getSingleton('checkout/session');
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Get current quote
|
80 |
+
*
|
81 |
+
* @return Mage_Sales_Model_Quote
|
82 |
+
*/
|
83 |
+
public function getQuote()
|
84 |
+
{
|
85 |
+
return $this->_getCheckout()->getQuote();
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* PayPal is only active if 'EURO' is currency
|
90 |
+
*
|
91 |
+
* @param string $currencyCode
|
92 |
+
* @return bool
|
93 |
+
*/
|
94 |
+
public function canUseForCurrency($currencyCode)
|
95 |
+
{
|
96 |
+
if ($currencyCode !== "EUR") {
|
97 |
+
return false;
|
98 |
+
}
|
99 |
+
|
100 |
+
return parent::canUseForCurrency($currencyCode);
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Redirects the client on click 'Place Order' to selected PayPal bank
|
105 |
+
*
|
106 |
+
* @return string
|
107 |
+
*/
|
108 |
+
public function getOrderPlaceRedirectUrl()
|
109 |
+
{
|
110 |
+
return Mage::getUrl(
|
111 |
+
'ingpsp/klarna/payment',
|
112 |
+
array(
|
113 |
+
'_secure' => true,
|
114 |
+
'_query' => array(),
|
115 |
+
)
|
116 |
+
);
|
117 |
+
}
|
118 |
+
}
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -25,7 +25,11 @@ class ING_PSP_Model_Observer
|
|
25 |
'ingpsp_banktransfer',
|
26 |
'ingpsp_creditcard',
|
27 |
'ingpsp_bancontact',
|
28 |
-
'ingpsp_cashondelivery'
|
|
|
|
|
|
|
|
|
29 |
];
|
30 |
|
31 |
/**
|
@@ -52,9 +56,8 @@ class ING_PSP_Model_Observer
|
|
52 |
*/
|
53 |
public function checkPaymentMethodStatus(Varien_Event_Observer $observer)
|
54 |
{
|
55 |
-
$allowedProducts = $this->getActiveINGProducts();
|
56 |
$config = $observer->getConfig();
|
57 |
-
|
58 |
foreach ($this->ing_modules AS $product) {
|
59 |
$ingModule = $config->getNode('sections/payment/groups/'.$product);
|
60 |
if (in_array(str_replace('ingpsp_', '', $product), $allowedProducts)) {
|
@@ -62,11 +65,13 @@ class ING_PSP_Model_Observer
|
|
62 |
$ingModule->show_in_website = 1;
|
63 |
$ingModule->show_in_store = 1;
|
64 |
$ingModule->active = 1;
|
|
|
65 |
} else {
|
66 |
$ingModule->show_in_default = 0;
|
67 |
$ingModule->show_in_website = 0;
|
68 |
$ingModule->show_in_store = 0;
|
69 |
$ingModule->active = 0;
|
|
|
70 |
}
|
71 |
$ingModule->saveXML();
|
72 |
}
|
@@ -82,17 +87,14 @@ class ING_PSP_Model_Observer
|
|
82 |
*/
|
83 |
public function paymentMethodIsActive(Varien_Event_Observer $observer)
|
84 |
{
|
85 |
-
$allowedProducts = $this->getActiveINGProducts();
|
86 |
$event = $observer->getEvent();
|
87 |
$method = $event->getMethodInstance();
|
88 |
$result = $event->getResult();
|
89 |
|
90 |
-
if (in_array($method->getCode(), $this->ing_modules)
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
$result->isAvailable = false;
|
95 |
-
}
|
96 |
}
|
97 |
|
98 |
return $this;
|
@@ -107,15 +109,47 @@ class ING_PSP_Model_Observer
|
|
107 |
{
|
108 |
require_once(Mage::getBaseDir('lib').DS.'Ing'.DS.'Services'.DS.'ing-php'.DS.'vendor'.DS.'autoload.php');
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
|
|
115 |
|
116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
}
|
118 |
|
119 |
-
return
|
120 |
}
|
121 |
}
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
25 |
'ingpsp_banktransfer',
|
26 |
'ingpsp_creditcard',
|
27 |
'ingpsp_bancontact',
|
28 |
+
'ingpsp_cashondelivery',
|
29 |
+
'ingpsp_klarna',
|
30 |
+
'ingpsp_paypal',
|
31 |
+
'ingpsp_homepay',
|
32 |
+
'ingpsp_sofort',
|
33 |
];
|
34 |
|
35 |
/**
|
56 |
*/
|
57 |
public function checkPaymentMethodStatus(Varien_Event_Observer $observer)
|
58 |
{
|
|
|
59 |
$config = $observer->getConfig();
|
60 |
+
$allowedProducts = $this->getActiveINGProducts();
|
61 |
foreach ($this->ing_modules AS $product) {
|
62 |
$ingModule = $config->getNode('sections/payment/groups/'.$product);
|
63 |
if (in_array(str_replace('ingpsp_', '', $product), $allowedProducts)) {
|
65 |
$ingModule->show_in_website = 1;
|
66 |
$ingModule->show_in_store = 1;
|
67 |
$ingModule->active = 1;
|
68 |
+
Mage::getConfig()->saveConfig('payment/'.$product.'/active', 1);
|
69 |
} else {
|
70 |
$ingModule->show_in_default = 0;
|
71 |
$ingModule->show_in_website = 0;
|
72 |
$ingModule->show_in_store = 0;
|
73 |
$ingModule->active = 0;
|
74 |
+
Mage::getConfig()->saveConfig('payment/'.$product.'/active', 0);
|
75 |
}
|
76 |
$ingModule->saveXML();
|
77 |
}
|
87 |
*/
|
88 |
public function paymentMethodIsActive(Varien_Event_Observer $observer)
|
89 |
{
|
|
|
90 |
$event = $observer->getEvent();
|
91 |
$method = $event->getMethodInstance();
|
92 |
$result = $event->getResult();
|
93 |
|
94 |
+
if (in_array($method->getCode(), $this->ing_modules)
|
95 |
+
&& $method->getCode() == 'ingpsp_klarna'
|
96 |
+
) {
|
97 |
+
$result->isAvailable = $this->ipAllowed();
|
|
|
|
|
98 |
}
|
99 |
|
100 |
return $this;
|
109 |
{
|
110 |
require_once(Mage::getBaseDir('lib').DS.'Ing'.DS.'Services'.DS.'ing-php'.DS.'vendor'.DS.'autoload.php');
|
111 |
|
112 |
+
try {
|
113 |
+
if (Mage::getStoreConfig("payment/ingpsp/apikey")) {
|
114 |
+
$ingAPI = \GingerPayments\Payment\Ginger::createClient(
|
115 |
+
Mage::getStoreConfig("payment/ingpsp/apikey"),
|
116 |
+
Mage::getStoreConfig("payment/ingpsp/product")
|
117 |
+
);
|
118 |
|
119 |
+
if ($ingAPI->isInTestMode()) {
|
120 |
+
return [
|
121 |
+
'klarna',
|
122 |
+
'banktransfer',
|
123 |
+
'ideal',
|
124 |
+
'cashondelivery',
|
125 |
+
'sofort'
|
126 |
+
];
|
127 |
+
}
|
128 |
+
return $ingAPI->getAllowedProducts();
|
129 |
+
}
|
130 |
+
} catch (\Exception $exception) {
|
131 |
+
Mage::log($exception);
|
132 |
+
Mage::getSingleton('core/session')->addError($exception->getMessage());
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Function checks if payment method is allowed for current IP.
|
138 |
+
*
|
139 |
+
* @return bool
|
140 |
+
*/
|
141 |
+
protected function ipAllowed()
|
142 |
+
{
|
143 |
+
$ipFilterList = Mage::getStoreConfig("payment/ingpsp_klarna/ip_filter");
|
144 |
+
|
145 |
+
if (strlen($ipFilterList) > 0) {
|
146 |
+
$ipWhitelist = array_map('trim', explode(",", $ipFilterList));
|
147 |
+
|
148 |
+
if (!in_array(Mage::helper('core/http')->getRemoteAddr(), $ipWhitelist)) {
|
149 |
+
return false;
|
150 |
+
}
|
151 |
}
|
152 |
|
153 |
+
return true;
|
154 |
}
|
155 |
}
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Model_Paypal extends Mage_Payment_Model_Method_Abstract
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_PayPal
|
25 |
+
*/
|
26 |
+
protected $_PayPal;
|
27 |
+
|
28 |
+
protected $_code = 'ingpsp_paypal';
|
29 |
+
protected $_paymentMethod = 'PayPal';
|
30 |
+
protected $_isGateway = true;
|
31 |
+
protected $_canAuthorize = true;
|
32 |
+
protected $_canUseCheckout = true;
|
33 |
+
protected $_canUseInternal = true;
|
34 |
+
protected $_canUseForMultishipping = false;
|
35 |
+
protected $_canRefund = true;
|
36 |
+
protected $_canRefundInvoicePartial = false;
|
37 |
+
protected $_canCapture = false;
|
38 |
+
|
39 |
+
// Payment flags
|
40 |
+
const PAYMENT_FLAG_PENDING = "Payment is pending";
|
41 |
+
const PAYMENT_FLAG_COMPLETED = "Payment is completed";
|
42 |
+
const PAYMENT_FLAG_CANCELLED = "Payment is cancelled";
|
43 |
+
const PAYMENT_FLAG_ERROR = "Payment failed with an error";
|
44 |
+
const PAYMENT_FLAG_FRAUD = "Amounts don't match. Possible fraud";
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Build constructor
|
48 |
+
*/
|
49 |
+
public function __construct()
|
50 |
+
{
|
51 |
+
parent::_construct();
|
52 |
+
$this->_PayPal = Mage::helper('ingpsp/paypal');
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @param Mage_Sales_Model_Quote|null $quote
|
57 |
+
* @return bool
|
58 |
+
*/
|
59 |
+
public function isAvailable($quote = null)
|
60 |
+
{
|
61 |
+
if (Mage::getStoreConfig('payment/ingpsp/apikey', $quote ? $quote->getStoreId() : null)) {
|
62 |
+
return parent::isAvailable($quote);
|
63 |
+
}
|
64 |
+
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Get checkout session namespace
|
70 |
+
*
|
71 |
+
* @return Mage_Checkout_Model_Session
|
72 |
+
*/
|
73 |
+
protected function _getCheckout()
|
74 |
+
{
|
75 |
+
return Mage::getSingleton('checkout/session');
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Get current quote
|
80 |
+
*
|
81 |
+
* @return Mage_Sales_Model_Quote
|
82 |
+
*/
|
83 |
+
public function getQuote()
|
84 |
+
{
|
85 |
+
return $this->_getCheckout()->getQuote();
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* PayPal is only active if 'EURO' is currency
|
90 |
+
*
|
91 |
+
* @param string $currencyCode
|
92 |
+
* @return bool
|
93 |
+
*/
|
94 |
+
public function canUseForCurrency($currencyCode)
|
95 |
+
{
|
96 |
+
if ($currencyCode !== "EUR") {
|
97 |
+
return false;
|
98 |
+
}
|
99 |
+
|
100 |
+
return parent::canUseForCurrency($currencyCode);
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Redirects the client on click 'Place Order' to selected PayPal bank
|
105 |
+
*
|
106 |
+
* @return string
|
107 |
+
*/
|
108 |
+
public function getOrderPlaceRedirectUrl()
|
109 |
+
{
|
110 |
+
return Mage::getUrl(
|
111 |
+
'ingpsp/paypal/payment',
|
112 |
+
array(
|
113 |
+
'_secure' => true,
|
114 |
+
'_query' => array(),
|
115 |
+
)
|
116 |
+
);
|
117 |
+
}
|
118 |
+
}
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Model_Sofort extends Mage_Payment_Model_Method_Abstract
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_Sofort
|
25 |
+
*/
|
26 |
+
protected $_sofort;
|
27 |
+
|
28 |
+
protected $_code = 'ingpsp_sofort';
|
29 |
+
protected $_paymentMethod = 'SOFORT';
|
30 |
+
protected $_isGateway = true;
|
31 |
+
protected $_canAuthorize = true;
|
32 |
+
protected $_canUseCheckout = true;
|
33 |
+
protected $_canUseInternal = true;
|
34 |
+
protected $_canUseForMultishipping = false;
|
35 |
+
protected $_canRefund = true;
|
36 |
+
protected $_canRefundInvoicePartial = false;
|
37 |
+
protected $_canCapture = false;
|
38 |
+
|
39 |
+
// Payment flags
|
40 |
+
const PAYMENT_FLAG_PENDING = "Payment is pending";
|
41 |
+
const PAYMENT_FLAG_COMPLETED = "Payment is completed";
|
42 |
+
const PAYMENT_FLAG_CANCELLED = "Payment is cancelled";
|
43 |
+
const PAYMENT_FLAG_ERROR = "Payment failed with an error";
|
44 |
+
const PAYMENT_FLAG_FRAUD = "Amounts don't match. Possible fraud";
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Build constructor
|
48 |
+
*/
|
49 |
+
public function __construct()
|
50 |
+
{
|
51 |
+
parent::_construct();
|
52 |
+
$this->_sofort = Mage::helper('ingpsp/sofort');
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @param Mage_Sales_Model_Quote|null $quote
|
57 |
+
* @return bool
|
58 |
+
*/
|
59 |
+
public function isAvailable($quote = null)
|
60 |
+
{
|
61 |
+
if (Mage::getStoreConfig('payment/ingpsp/apikey', $quote ? $quote->getStoreId() : null)) {
|
62 |
+
return parent::isAvailable($quote);
|
63 |
+
}
|
64 |
+
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Get checkout session namespace
|
70 |
+
*
|
71 |
+
* @return Mage_Checkout_Model_Session
|
72 |
+
*/
|
73 |
+
protected function _getCheckout()
|
74 |
+
{
|
75 |
+
return Mage::getSingleton('checkout/session');
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Get current quote
|
80 |
+
*
|
81 |
+
* @return Mage_Sales_Model_Quote
|
82 |
+
*/
|
83 |
+
public function getQuote()
|
84 |
+
{
|
85 |
+
return $this->_getCheckout()->getQuote();
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* PayPal is only active if 'EURO' is currency
|
90 |
+
*
|
91 |
+
* @param string $currencyCode
|
92 |
+
* @return bool
|
93 |
+
*/
|
94 |
+
public function canUseForCurrency($currencyCode)
|
95 |
+
{
|
96 |
+
if ($currencyCode !== "EUR") {
|
97 |
+
return false;
|
98 |
+
}
|
99 |
+
|
100 |
+
return parent::canUseForCurrency($currencyCode);
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Redirects the client on click 'Place Order' to selected PayPal bank
|
105 |
+
*
|
106 |
+
* @return string
|
107 |
+
*/
|
108 |
+
public function getOrderPlaceRedirectUrl()
|
109 |
+
{
|
110 |
+
return Mage::getUrl(
|
111 |
+
'ingpsp/sofort/payment',
|
112 |
+
array(
|
113 |
+
'_secure' => true,
|
114 |
+
'_query' => array(),
|
115 |
+
)
|
116 |
+
);
|
117 |
+
}
|
118 |
+
}
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.6
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_HomePayController extends Mage_Core_Controller_Front_Action
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_HomePay
|
25 |
+
*/
|
26 |
+
protected $_homepay;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
30 |
+
*/
|
31 |
+
protected $_read;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
35 |
+
*/
|
36 |
+
protected $_write;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Get CreditCard core
|
40 |
+
* Give $_write mage writing resource
|
41 |
+
* Give $_read mage reading resource
|
42 |
+
*/
|
43 |
+
public function _construct()
|
44 |
+
{
|
45 |
+
$this->_homepay = Mage::helper('ingpsp/homepay');
|
46 |
+
$this->_helper = Mage::helper('ingpsp');
|
47 |
+
$this->_coreHttp = Mage::helper('core/http');
|
48 |
+
|
49 |
+
$this->_read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
50 |
+
$this->_write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
51 |
+
|
52 |
+
parent::_construct();
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Gets the current checkout session with order information
|
57 |
+
*
|
58 |
+
* @return Mage_Checkout_Model_Session
|
59 |
+
*/
|
60 |
+
protected function _getCheckout()
|
61 |
+
{
|
62 |
+
return Mage::getSingleton('checkout/session');
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Creates the order and sets the redirect url
|
67 |
+
*/
|
68 |
+
public function paymentAction()
|
69 |
+
{
|
70 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->_getCheckout()->last_real_order_id);
|
71 |
+
|
72 |
+
try {
|
73 |
+
$amount = $order->getGrandTotal();
|
74 |
+
$orderId = $order->getIncrementId();
|
75 |
+
$description = str_replace('%', $orderId,
|
76 |
+
Mage::getStoreConfig("payment/ingpsp_homepay/description", $order->getStoreId())
|
77 |
+
);
|
78 |
+
$currency = $order->getOrderCurrencyCode();
|
79 |
+
$customer = $this->_getCustomerData($order);
|
80 |
+
$returnUrl = Mage::getUrl('ingpsp/homepay/return');
|
81 |
+
|
82 |
+
if ($this->_homepay->createOrder($orderId, $amount, $currency, $description, $returnUrl, $customer)) {
|
83 |
+
if (!$order->getId()) {
|
84 |
+
Mage::log('Geen order voor verwerking gevonden');
|
85 |
+
Mage::throwException('Geen order voor verwerking gevonden');
|
86 |
+
}
|
87 |
+
|
88 |
+
$payment = $order->getPayment();
|
89 |
+
|
90 |
+
if (!$payment->getId()) {
|
91 |
+
$payment = Mage::getModel('sales/order_payment')->setId(null);
|
92 |
+
}
|
93 |
+
|
94 |
+
$payment->setIsTransactionClosed(false)
|
95 |
+
->setIngOrderId($this->_homepay->getOrderId())
|
96 |
+
->setIngIdealIssuerId(null);
|
97 |
+
|
98 |
+
$order->setPayment($payment);
|
99 |
+
$order->setIngOrderId($this->_homepay->getOrderId())
|
100 |
+
->setIngIdealIssuerId(null);
|
101 |
+
$order->save();
|
102 |
+
|
103 |
+
$payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
104 |
+
$pendingMessage = Mage::helper('ingpsp')->__(ING_PSP_Model_Banktransfer::PAYMENT_FLAG_PENDING);
|
105 |
+
|
106 |
+
if ($order->getData('ing_order_id')) {
|
107 |
+
$pendingMessage .= '. '.'ING Order ID: '.$order->getData('ing_order_id');
|
108 |
+
}
|
109 |
+
|
110 |
+
$order->setState(
|
111 |
+
Mage_Sales_Model_Order::STATE_PROCESSING,
|
112 |
+
Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,
|
113 |
+
$pendingMessage,
|
114 |
+
false
|
115 |
+
);
|
116 |
+
|
117 |
+
$order->save();
|
118 |
+
|
119 |
+
Mage::log("Issuer url redirect: ".$this->_homepay->getPaymentUrl());
|
120 |
+
$this->_redirectUrl($this->_homepay->getPaymentUrl());
|
121 |
+
}
|
122 |
+
} catch (Exception $e) {
|
123 |
+
Mage::log($e);
|
124 |
+
Mage::throwException(
|
125 |
+
"Could not start transaction. Contact the owner.<br />
|
126 |
+
Error message: ".$this->_homepay->getErrorMessage()
|
127 |
+
);
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Customer returning with an order_id
|
133 |
+
* Depending on the order state redirected to the corresponding page
|
134 |
+
*/
|
135 |
+
public function returnAction()
|
136 |
+
{
|
137 |
+
$orderId = Mage::app()->getRequest()->getParam('order_id');
|
138 |
+
|
139 |
+
try {
|
140 |
+
if (!empty($orderId)) {
|
141 |
+
$ingOrderDetails = $this->_homepay->getOrderDetails($orderId);
|
142 |
+
|
143 |
+
$paymentStatus = isset($ingOrderDetails['status']) ? $ingOrderDetails['status'] : null;
|
144 |
+
|
145 |
+
if ($paymentStatus == "completed") {
|
146 |
+
// Redirect to success page
|
147 |
+
$this->_redirect('checkout/onepage/success', array('_secure' => true));
|
148 |
+
} else {
|
149 |
+
$this->_restoreCart();
|
150 |
+
|
151 |
+
// Redirect to failure page
|
152 |
+
$this->_redirect('checkout/onepage/failure', array('_secure' => true));
|
153 |
+
}
|
154 |
+
}
|
155 |
+
} catch (Exception $e) {
|
156 |
+
$this->_restoreCart();
|
157 |
+
|
158 |
+
Mage::log($e);
|
159 |
+
$this->_redirectUrl(Mage::getBaseUrl());
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
protected function _restoreCart()
|
164 |
+
{
|
165 |
+
$session = Mage::getSingleton('checkout/session');
|
166 |
+
$orderId = $session->getLastRealOrderId();
|
167 |
+
if (!empty($orderId)) {
|
168 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
169 |
+
}
|
170 |
+
$quoteId = $order->getQuoteId();
|
171 |
+
|
172 |
+
$quote = Mage::getModel('sales/quote')->load($quoteId)->setIsActive(true)->save();
|
173 |
+
|
174 |
+
Mage::getSingleton('checkout/session')->replaceQuote($quote);
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* @param Mage_Sales_Model_Order $order
|
179 |
+
* @param float $orderAmount
|
180 |
+
*/
|
181 |
+
protected function _setAmountPaid(Mage_Sales_Model_Order $order, $orderAmount)
|
182 |
+
{
|
183 |
+
// set the amounts paid
|
184 |
+
$currentBase = Mage::app()->getStore()->getBaseCurrencyCode();
|
185 |
+
$currentStore = Mage::app()->getStore()->getCurrentCurrencyCode();
|
186 |
+
|
187 |
+
$amountBase = Mage::helper('directory')->currencyConvert($orderAmount, 'EUR', $currentBase);
|
188 |
+
$amountStore = Mage::helper('directory')->currencyConvert($orderAmount, 'EUR', $currentStore);
|
189 |
+
|
190 |
+
$order->setBaseTotalPaid($amountBase);
|
191 |
+
$order->setTotalPaid($amountStore);
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* @param Mage_Sales_Model_Order $order
|
196 |
+
* @param null|string $transactionId
|
197 |
+
* @return bool
|
198 |
+
*/
|
199 |
+
protected function _savePaidInvoice(Mage_Sales_Model_Order $order, $transactionId = null)
|
200 |
+
{
|
201 |
+
$invoice = $order->prepareInvoice()
|
202 |
+
->register()
|
203 |
+
->setTransactionId($transactionId)
|
204 |
+
->pay();
|
205 |
+
|
206 |
+
Mage::getModel('core/resource_transaction')
|
207 |
+
->addObject($invoice)
|
208 |
+
->addObject($invoice->getOrder())
|
209 |
+
->save();
|
210 |
+
|
211 |
+
if (Mage::getStoreConfig("payment/ingpsp_homepay/send_invoice_mail", $order->getStoreId())) {
|
212 |
+
$invoice->sendEmail();
|
213 |
+
}
|
214 |
+
|
215 |
+
return true;
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Format price with currency sign
|
220 |
+
*
|
221 |
+
* @param Mage_Sales_Model_Order $order
|
222 |
+
* @param float $amount
|
223 |
+
* @return string
|
224 |
+
*/
|
225 |
+
protected function _formatPrice($order, $amount)
|
226 |
+
{
|
227 |
+
return $order->getBaseCurrency()->formatTxt($amount);
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
* @param Mage_Sales_Model_Order $order
|
232 |
+
* @return array
|
233 |
+
*/
|
234 |
+
protected function _getCustomerData(Mage_Sales_Model_Order $order)
|
235 |
+
{
|
236 |
+
$billingAddress = $order->getBillingAddress();
|
237 |
+
|
238 |
+
list($address, $houseNumber) = $this->_helper->parseAddress($billingAddress->getStreetFull());
|
239 |
+
|
240 |
+
return GingerPayments\Payment\Common\ArrayFunctions::withoutNullValues([
|
241 |
+
'merchant_customer_id' => $order->getCustomerId(),
|
242 |
+
'email_address' => $order->getCustomerEmail(),
|
243 |
+
'first_name' => $order->getCustomerFirstname(),
|
244 |
+
'last_name' => $order->getCustomerLastname(),
|
245 |
+
'address_type' => 'billing',
|
246 |
+
'address' => trim($billingAddress->getCity()).' '.trim($address),
|
247 |
+
'postal_code' => $billingAddress->getPostcode(),
|
248 |
+
'housenumber' => $houseNumber,
|
249 |
+
'country' => $billingAddress->getCountryId(),
|
250 |
+
'phone_numbers' => [$billingAddress->getTelephone()],
|
251 |
+
'user_agent' => $this->_coreHttp->getHttpUserAgent(),
|
252 |
+
'referrer' => $this->_coreHttp->getHttpReferer(),
|
253 |
+
'ip_address' => $this->_coreHttp->getRemoteAddr(),
|
254 |
+
'forwarded_ip' => $this->getRequest()->getServer('HTTP_X_FORWARDED_FOR'),
|
255 |
+
'gender' => $order->getCustomerGender() ? ('1' ? 'male' : ('2' ? 'female' : null)) : null,
|
256 |
+
'birth_date' => $order->getCustomerDob(),
|
257 |
+
'locale' => Mage::app()->getLocale()->getLocaleCode(),
|
258 |
+
]);
|
259 |
+
}
|
260 |
+
}
|
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_HomepayController extends Mage_Core_Controller_Front_Action
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_HomePay
|
25 |
+
*/
|
26 |
+
protected $_homepay;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
30 |
+
*/
|
31 |
+
protected $_read;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
35 |
+
*/
|
36 |
+
protected $_write;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Get CreditCard core
|
40 |
+
* Give $_write mage writing resource
|
41 |
+
* Give $_read mage reading resource
|
42 |
+
*/
|
43 |
+
public function _construct()
|
44 |
+
{
|
45 |
+
$this->_homepay = Mage::helper('ingpsp/homepay');
|
46 |
+
$this->_helper = Mage::helper('ingpsp');
|
47 |
+
$this->_coreHttp = Mage::helper('core/http');
|
48 |
+
|
49 |
+
$this->_read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
50 |
+
$this->_write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
51 |
+
|
52 |
+
parent::_construct();
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Gets the current checkout session with order information
|
57 |
+
*
|
58 |
+
* @return Mage_Checkout_Model_Session
|
59 |
+
*/
|
60 |
+
protected function _getCheckout()
|
61 |
+
{
|
62 |
+
return Mage::getSingleton('checkout/session');
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Creates the order and sets the redirect url
|
67 |
+
*/
|
68 |
+
public function paymentAction()
|
69 |
+
{
|
70 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->_getCheckout()->last_real_order_id);
|
71 |
+
|
72 |
+
try {
|
73 |
+
$amount = $order->getGrandTotal();
|
74 |
+
$orderId = $order->getIncrementId();
|
75 |
+
$description = str_replace('%', $orderId,
|
76 |
+
Mage::getStoreConfig("payment/ingpsp_homepay/description", $order->getStoreId())
|
77 |
+
);
|
78 |
+
$currency = $order->getOrderCurrencyCode();
|
79 |
+
$customer = $this->_getCustomerData($order);
|
80 |
+
$returnUrl = Mage::getUrl('ingpsp/homepay/return');
|
81 |
+
|
82 |
+
if ($this->_homepay->createOrder($orderId, $amount, $currency, $description, $returnUrl, $customer)) {
|
83 |
+
if (!$order->getId()) {
|
84 |
+
Mage::log('Geen order voor verwerking gevonden');
|
85 |
+
Mage::throwException('Geen order voor verwerking gevonden');
|
86 |
+
}
|
87 |
+
|
88 |
+
$payment = $order->getPayment();
|
89 |
+
|
90 |
+
if (!$payment->getId()) {
|
91 |
+
$payment = Mage::getModel('sales/order_payment')->setId(null);
|
92 |
+
}
|
93 |
+
|
94 |
+
$payment->setIsTransactionClosed(false)
|
95 |
+
->setIngOrderId($this->_homepay->getOrderId())
|
96 |
+
->setIngIdealIssuerId(null);
|
97 |
+
|
98 |
+
$order->setPayment($payment);
|
99 |
+
$order->setIngOrderId($this->_homepay->getOrderId())
|
100 |
+
->setIngIdealIssuerId(null);
|
101 |
+
$order->save();
|
102 |
+
|
103 |
+
$payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
104 |
+
$pendingMessage = Mage::helper('ingpsp')->__(ING_PSP_Model_Banktransfer::PAYMENT_FLAG_PENDING);
|
105 |
+
|
106 |
+
if ($order->getData('ing_order_id')) {
|
107 |
+
$pendingMessage .= '. '.'ING Order ID: '.$order->getData('ing_order_id');
|
108 |
+
}
|
109 |
+
|
110 |
+
$order->setState(
|
111 |
+
Mage_Sales_Model_Order::STATE_PROCESSING,
|
112 |
+
Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,
|
113 |
+
$pendingMessage,
|
114 |
+
false
|
115 |
+
);
|
116 |
+
|
117 |
+
$order->save();
|
118 |
+
|
119 |
+
Mage::log("Issuer url redirect: ".$this->_homepay->getPaymentUrl());
|
120 |
+
$this->_redirectUrl($this->_homepay->getPaymentUrl());
|
121 |
+
}
|
122 |
+
} catch (Exception $e) {
|
123 |
+
Mage::log($e);
|
124 |
+
Mage::throwException(
|
125 |
+
"Could not start transaction. Contact the owner.<br />
|
126 |
+
Error message: ".$this->_homepay->getErrorMessage()
|
127 |
+
);
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Customer returning with an order_id
|
133 |
+
* Depending on the order state redirected to the corresponding page
|
134 |
+
*/
|
135 |
+
public function returnAction()
|
136 |
+
{
|
137 |
+
$orderId = Mage::app()->getRequest()->getParam('order_id');
|
138 |
+
|
139 |
+
try {
|
140 |
+
if (!empty($orderId)) {
|
141 |
+
$ingOrderDetails = $this->_homepay->getOrderDetails($orderId);
|
142 |
+
|
143 |
+
$paymentStatus = isset($ingOrderDetails['status']) ? $ingOrderDetails['status'] : null;
|
144 |
+
|
145 |
+
if ($paymentStatus == "completed") {
|
146 |
+
// Redirect to success page
|
147 |
+
$this->_redirect('checkout/onepage/success', array('_secure' => true));
|
148 |
+
} else {
|
149 |
+
$this->_restoreCart();
|
150 |
+
|
151 |
+
// Redirect to failure page
|
152 |
+
$this->_redirect('checkout/onepage/failure', array('_secure' => true));
|
153 |
+
}
|
154 |
+
}
|
155 |
+
} catch (Exception $e) {
|
156 |
+
$this->_restoreCart();
|
157 |
+
|
158 |
+
Mage::log($e);
|
159 |
+
$this->_redirectUrl(Mage::getBaseUrl());
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
protected function _restoreCart()
|
164 |
+
{
|
165 |
+
$session = Mage::getSingleton('checkout/session');
|
166 |
+
$orderId = $session->getLastRealOrderId();
|
167 |
+
if (!empty($orderId)) {
|
168 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
169 |
+
}
|
170 |
+
$quoteId = $order->getQuoteId();
|
171 |
+
|
172 |
+
$quote = Mage::getModel('sales/quote')->load($quoteId)->setIsActive(true)->save();
|
173 |
+
|
174 |
+
Mage::getSingleton('checkout/session')->replaceQuote($quote);
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* @param Mage_Sales_Model_Order $order
|
179 |
+
* @param float $orderAmount
|
180 |
+
*/
|
181 |
+
protected function _setAmountPaid(Mage_Sales_Model_Order $order, $orderAmount)
|
182 |
+
{
|
183 |
+
// set the amounts paid
|
184 |
+
$currentBase = Mage::app()->getStore()->getBaseCurrencyCode();
|
185 |
+
$currentStore = Mage::app()->getStore()->getCurrentCurrencyCode();
|
186 |
+
|
187 |
+
$amountBase = Mage::helper('directory')->currencyConvert($orderAmount, 'EUR', $currentBase);
|
188 |
+
$amountStore = Mage::helper('directory')->currencyConvert($orderAmount, 'EUR', $currentStore);
|
189 |
+
|
190 |
+
$order->setBaseTotalPaid($amountBase);
|
191 |
+
$order->setTotalPaid($amountStore);
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* @param Mage_Sales_Model_Order $order
|
196 |
+
* @param null|string $transactionId
|
197 |
+
* @return bool
|
198 |
+
*/
|
199 |
+
protected function _savePaidInvoice(Mage_Sales_Model_Order $order, $transactionId = null)
|
200 |
+
{
|
201 |
+
$invoice = $order->prepareInvoice()
|
202 |
+
->register()
|
203 |
+
->setTransactionId($transactionId)
|
204 |
+
->pay();
|
205 |
+
|
206 |
+
Mage::getModel('core/resource_transaction')
|
207 |
+
->addObject($invoice)
|
208 |
+
->addObject($invoice->getOrder())
|
209 |
+
->save();
|
210 |
+
|
211 |
+
if (Mage::getStoreConfig("payment/ingpsp_homepay/send_invoice_mail", $order->getStoreId())) {
|
212 |
+
$invoice->sendEmail();
|
213 |
+
}
|
214 |
+
|
215 |
+
return true;
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Format price with currency sign
|
220 |
+
*
|
221 |
+
* @param Mage_Sales_Model_Order $order
|
222 |
+
* @param float $amount
|
223 |
+
* @return string
|
224 |
+
*/
|
225 |
+
protected function _formatPrice($order, $amount)
|
226 |
+
{
|
227 |
+
return $order->getBaseCurrency()->formatTxt($amount);
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
* @param Mage_Sales_Model_Order $order
|
232 |
+
* @return array
|
233 |
+
*/
|
234 |
+
protected function _getCustomerData(Mage_Sales_Model_Order $order)
|
235 |
+
{
|
236 |
+
$billingAddress = $order->getBillingAddress();
|
237 |
+
|
238 |
+
list($address, $houseNumber) = $this->_helper->parseAddress($billingAddress->getStreetFull());
|
239 |
+
|
240 |
+
return GingerPayments\Payment\Common\ArrayFunctions::withoutNullValues([
|
241 |
+
'merchant_customer_id' => $order->getCustomerId(),
|
242 |
+
'email_address' => $order->getCustomerEmail(),
|
243 |
+
'first_name' => $order->getCustomerFirstname(),
|
244 |
+
'last_name' => $order->getCustomerLastname(),
|
245 |
+
'address_type' => 'billing',
|
246 |
+
'address' => trim($billingAddress->getCity()).' '.trim($address),
|
247 |
+
'postal_code' => $billingAddress->getPostcode(),
|
248 |
+
'housenumber' => $houseNumber,
|
249 |
+
'country' => $billingAddress->getCountryId(),
|
250 |
+
'phone_numbers' => [$billingAddress->getTelephone()],
|
251 |
+
'user_agent' => $this->_coreHttp->getHttpUserAgent(),
|
252 |
+
'referrer' => $this->_coreHttp->getHttpReferer(),
|
253 |
+
'ip_address' => $this->_coreHttp->getRemoteAddr(),
|
254 |
+
'forwarded_ip' => $this->getRequest()->getServer('HTTP_X_FORWARDED_FOR'),
|
255 |
+
'gender' => $order->getCustomerGender() ? ('1' ? 'male' : ('2' ? 'female' : null)) : null,
|
256 |
+
'birth_date' => $order->getCustomerDob(),
|
257 |
+
'locale' => Mage::app()->getLocale()->getLocaleCode(),
|
258 |
+
]);
|
259 |
+
}
|
260 |
+
}
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -129,7 +129,6 @@ class ING_PSP_IdealController extends Mage_Core_Controller_Front_Action
|
|
129 |
$this->_redirectUrl($this->_ideal->getPaymentUrl());
|
130 |
}
|
131 |
} catch (Exception $e) {
|
132 |
-
die($e->getMessage());
|
133 |
Mage::log($e);
|
134 |
Mage::throwException(
|
135 |
"Could not start transaction. Contact the owner.<br />
|
2 |
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
129 |
$this->_redirectUrl($this->_ideal->getPaymentUrl());
|
130 |
}
|
131 |
} catch (Exception $e) {
|
|
|
132 |
Mage::log($e);
|
133 |
Mage::throwException(
|
134 |
"Could not start transaction. Contact the owner.<br />
|
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_KlarnaController extends Mage_Core_Controller_Front_Action
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_Klarna
|
25 |
+
*/
|
26 |
+
protected $_klarna;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @var ING_PSP_Helper_Data
|
30 |
+
*/
|
31 |
+
protected $_helper;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var Mage_Core_Helper_Http
|
35 |
+
*/
|
36 |
+
protected $_coreHttp;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
40 |
+
*/
|
41 |
+
protected $_read;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
45 |
+
*/
|
46 |
+
protected $_write;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Get iDEAL core
|
50 |
+
* Give $_write mage writing resource
|
51 |
+
* Give $_read mage reading resource
|
52 |
+
*/
|
53 |
+
public function _construct()
|
54 |
+
{
|
55 |
+
$this->_klarna = Mage::helper('ingpsp/klarna');
|
56 |
+
$this->_helper = Mage::helper('ingpsp');
|
57 |
+
$this->_coreHttp = Mage::helper('core/http');
|
58 |
+
|
59 |
+
$this->_read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
60 |
+
$this->_write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
61 |
+
|
62 |
+
parent::_construct();
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Create the order and sets the redirect url
|
67 |
+
*
|
68 |
+
* @return void
|
69 |
+
*/
|
70 |
+
public function paymentAction()
|
71 |
+
{
|
72 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->_getCheckout()->last_real_order_id);
|
73 |
+
|
74 |
+
try {
|
75 |
+
$amount = $order->getGrandTotal();
|
76 |
+
$orderId = $order->getIncrementId();
|
77 |
+
$description = str_replace('%', $orderId,
|
78 |
+
Mage::getStoreConfig("payment/ingpsp_klarna/description", $order->getStoreId())
|
79 |
+
);
|
80 |
+
$currency = $order->getOrderCurrencyCode();
|
81 |
+
$customer = $this->_getCustomerData($order);
|
82 |
+
$orderLines = $this->getOrderLines($order);
|
83 |
+
|
84 |
+
if ($this->_klarna->createOrder($orderId, $amount, $currency, $description, $customer, $orderLines)) {
|
85 |
+
if (!$order->getId()) {
|
86 |
+
Mage::throwException('No order found!');
|
87 |
+
}
|
88 |
+
|
89 |
+
$payment = $order->getPayment();
|
90 |
+
|
91 |
+
if (!$payment->getId()) {
|
92 |
+
$payment = Mage::getModel('sales/order_payment')->setId(null);
|
93 |
+
}
|
94 |
+
|
95 |
+
$payment->setIsTransactionClosed(false)->setIngOrderId($this->_klarna->getOrderId());
|
96 |
+
$payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
|
97 |
+
$order->setPayment($payment);
|
98 |
+
$order->setIngOrderId($this->_klarna->getOrderId());
|
99 |
+
$order->save();
|
100 |
+
|
101 |
+
$pendingMessage = Mage::helper('ingpsp')->__(ING_PSP_Model_Klarna::PAYMENT_FLAG_PENDING);
|
102 |
+
if ($order->getData('ing_order_id')) {
|
103 |
+
$pendingMessage .= '. '.'ING Order ID: '.$order->getData('ing_order_id');
|
104 |
+
}
|
105 |
+
|
106 |
+
$order->setState(
|
107 |
+
Mage_Sales_Model_Order::STATE_PROCESSING,
|
108 |
+
Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,
|
109 |
+
$pendingMessage,
|
110 |
+
false
|
111 |
+
);
|
112 |
+
$order->save();
|
113 |
+
|
114 |
+
if (Mage::getStoreConfig("payment/ingpsp_klarna/send_order_mail", $order->getStoreId())) {
|
115 |
+
if (!$order->getEmailSent()) {
|
116 |
+
$order->setEmailSent(true);
|
117 |
+
$order->sendNewOrderEmail();
|
118 |
+
$order->save();
|
119 |
+
}
|
120 |
+
}
|
121 |
+
$this->_redirect('checkout/onepage/success', array('_secure' => true));
|
122 |
+
} else {
|
123 |
+
$this->_restoreCart();
|
124 |
+
if ($this->_klarna->getErrorMessage()) {
|
125 |
+
Mage::getSingleton('core/session')->addError($this->_klarna->getErrorMessage());
|
126 |
+
$this->_redirect('checkout/onepage', array('_secure' => true));
|
127 |
+
} else {
|
128 |
+
Mage::getSingleton('core/session')->addError(
|
129 |
+
$this->__('
|
130 |
+
Unfortunately, we can not currently accept your purchase with Klarna.
|
131 |
+
Please choose another payment option to complete your order.
|
132 |
+
We apologize for the inconvenience.'
|
133 |
+
)
|
134 |
+
);
|
135 |
+
$this->_redirect('checkout/onepage/failure', array('_secure' => true));
|
136 |
+
}
|
137 |
+
}
|
138 |
+
} catch (Exception $e) {
|
139 |
+
Mage::log($e);
|
140 |
+
Mage::throwException(
|
141 |
+
"Could not start transaction. Contact the owner.<br />
|
142 |
+
Error message: ".$this->_klarna->getErrorMessage().$e->getMessage()
|
143 |
+
);
|
144 |
+
}
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Gets the current checkout session with order information
|
149 |
+
*
|
150 |
+
* @return Mage_Checkout_Model_Session
|
151 |
+
*/
|
152 |
+
protected function _getCheckout()
|
153 |
+
{
|
154 |
+
return Mage::getSingleton('checkout/session');
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* @return void
|
159 |
+
*/
|
160 |
+
protected function _restoreCart()
|
161 |
+
{
|
162 |
+
$session = Mage::getSingleton('checkout/session');
|
163 |
+
$orderId = $session->getLastRealOrderId();
|
164 |
+
if (!empty($orderId)) {
|
165 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
166 |
+
}
|
167 |
+
$quoteId = $order->getQuoteId();
|
168 |
+
|
169 |
+
$quote = Mage::getModel('sales/quote')->load($quoteId)->setIsActive(true)->save();
|
170 |
+
|
171 |
+
Mage::getSingleton('checkout/session')->replaceQuote($quote);
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* @param Mage_Sales_Model_Order $order
|
176 |
+
* @return array
|
177 |
+
*/
|
178 |
+
protected function _getCustomerData(Mage_Sales_Model_Order $order)
|
179 |
+
{
|
180 |
+
$billingAddress = $order->getBillingAddress();
|
181 |
+
list($address, $houseNumber) = $this->_helper->parseAddress($billingAddress->getStreetFull());
|
182 |
+
|
183 |
+
return array(
|
184 |
+
'merchant_customer_id' => $order->getCustomerId(),
|
185 |
+
'email_address' => $order->getCustomerEmail(),
|
186 |
+
'first_name' => $order->getCustomerFirstname(),
|
187 |
+
'last_name' => $order->getCustomerLastname(),
|
188 |
+
'address_type' => 'billing',
|
189 |
+
'address' => trim($billingAddress->getStreetFull())
|
190 |
+
.' '.trim($billingAddress->getPostcode())
|
191 |
+
.' '.trim($billingAddress->getCity()),
|
192 |
+
'postal_code' => $billingAddress->getPostcode(),
|
193 |
+
'housenumber' => $houseNumber,
|
194 |
+
'country' => $billingAddress->getCountryId(),
|
195 |
+
'phone_numbers' => [$billingAddress->getTelephone()],
|
196 |
+
'user_agent' => $this->_coreHttp->getHttpUserAgent(),
|
197 |
+
'referrer' => $this->_coreHttp->getHttpReferer(),
|
198 |
+
'ip_address' => $this->_coreHttp->getRemoteAddr(),
|
199 |
+
'forwarded_ip' => $this->getRequest()->getServer('HTTP_X_FORWARDED_FOR'),
|
200 |
+
'gender' => $order->getCustomerGender() ? ('1' ? 'male' : ('2' ? 'female' : null)) : null,
|
201 |
+
'birthdate' => Mage::getModel('core/date')->date('Y-m-d', strtotime($order->getCustomerDob())),
|
202 |
+
'locale' => Mage::app()->getLocale()->getLocaleCode()
|
203 |
+
);
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* @param $order
|
208 |
+
* @return array
|
209 |
+
*/
|
210 |
+
protected function getOrderLines($order)
|
211 |
+
{
|
212 |
+
$orderLines = [];
|
213 |
+
|
214 |
+
foreach ($order->getAllVisibleItems() as $item) {
|
215 |
+
$orderLines[] = [
|
216 |
+
'url' => $item->getProduct()->getProductUrl(),
|
217 |
+
'name' => $item->getName(),
|
218 |
+
'type' => \GingerPayments\Payment\Order\OrderLine\Type::PHYSICAL,
|
219 |
+
'amount' => ING_PSP_Helper_Data::getAmountInCents(
|
220 |
+
Mage::helper('tax')->getPrice($item->getProduct(), $item->getProduct()->getFinalPrice(), true)
|
221 |
+
),
|
222 |
+
'currency' => \GingerPayments\Payment\Currency::EUR,
|
223 |
+
'quantity' => (int) $item->getQtyOrdered() ? $item->getQtyOrdered() : 1,
|
224 |
+
'image_url' => Mage::getModel('catalog/product_media_config')
|
225 |
+
->getMediaUrl($item->getProduct()->getThumbnail()),
|
226 |
+
'vat_percentage' => ING_PSP_Helper_Data::getAmountInCents($item->getTaxPercent()),
|
227 |
+
'merchant_order_line_id' => $item->getId()
|
228 |
+
];
|
229 |
+
}
|
230 |
+
|
231 |
+
if ($order->getShippingAmount() > 0) {
|
232 |
+
$orderLines[] = $this->getShippingOrderLine($order);
|
233 |
+
}
|
234 |
+
|
235 |
+
return $orderLines;
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* @param $order
|
240 |
+
* @return array
|
241 |
+
*/
|
242 |
+
protected function getShippingOrderLine($order)
|
243 |
+
{
|
244 |
+
return [
|
245 |
+
'name' => $order->getShippingDescription(),
|
246 |
+
'type' => \GingerPayments\Payment\Order\OrderLine\Type::SHIPPING_FEE,
|
247 |
+
'amount' => ING_PSP_Helper_Data::getAmountInCents($order->getShippingInclTax()),
|
248 |
+
'currency' => \GingerPayments\Payment\Currency::EUR,
|
249 |
+
'vat_percentage' => ING_PSP_Helper_Data::getAmountInCents(
|
250 |
+
(100 * $order->getShippingTaxAmount() / $order->getShippingInclTax())
|
251 |
+
),
|
252 |
+
'quantity' => 1,
|
253 |
+
'merchant_order_line_id' => ($order->getTotalItemCount() + 1)
|
254 |
+
];
|
255 |
+
}
|
256 |
+
}
|
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_PaypalController extends Mage_Core_Controller_Front_Action
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_PayPal
|
25 |
+
*/
|
26 |
+
protected $_paypal;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
30 |
+
*/
|
31 |
+
protected $_read;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
35 |
+
*/
|
36 |
+
protected $_write;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Get CreditCard core
|
40 |
+
* Give $_write mage writing resource
|
41 |
+
* Give $_read mage reading resource
|
42 |
+
*/
|
43 |
+
public function _construct()
|
44 |
+
{
|
45 |
+
$this->_paypal = Mage::helper('ingpsp/paypal');
|
46 |
+
$this->_helper = Mage::helper('ingpsp');
|
47 |
+
$this->_coreHttp = Mage::helper('core/http');
|
48 |
+
|
49 |
+
$this->_read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
50 |
+
$this->_write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
51 |
+
|
52 |
+
parent::_construct();
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Gets the current checkout session with order information
|
57 |
+
*
|
58 |
+
* @return Mage_Checkout_Model_Session
|
59 |
+
*/
|
60 |
+
protected function _getCheckout()
|
61 |
+
{
|
62 |
+
return Mage::getSingleton('checkout/session');
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Creates the order and sets the redirect url
|
67 |
+
*/
|
68 |
+
public function paymentAction()
|
69 |
+
{
|
70 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->_getCheckout()->last_real_order_id);
|
71 |
+
|
72 |
+
try {
|
73 |
+
$amount = $order->getGrandTotal();
|
74 |
+
$orderId = $order->getIncrementId();
|
75 |
+
$description = str_replace('%', $orderId,
|
76 |
+
Mage::getStoreConfig("payment/ingpsp_paypal/description", $order->getStoreId())
|
77 |
+
);
|
78 |
+
$currency = $order->getOrderCurrencyCode();
|
79 |
+
$customer = $this->_getCustomerData($order);
|
80 |
+
$returnUrl = Mage::getUrl('ingpsp/paypal/return');
|
81 |
+
|
82 |
+
if ($this->_paypal->createOrder($orderId, $amount, $currency, $description, $returnUrl, $customer)) {
|
83 |
+
if (!$order->getId()) {
|
84 |
+
Mage::log('Geen order voor verwerking gevonden');
|
85 |
+
Mage::throwException('Geen order voor verwerking gevonden');
|
86 |
+
}
|
87 |
+
|
88 |
+
$payment = $order->getPayment();
|
89 |
+
|
90 |
+
if (!$payment->getId()) {
|
91 |
+
$payment = Mage::getModel('sales/order_payment')->setId(null);
|
92 |
+
}
|
93 |
+
|
94 |
+
$payment->setIsTransactionClosed(false)
|
95 |
+
->setIngOrderId($this->_paypal->getOrderId())
|
96 |
+
->setIngIdealIssuerId(null);
|
97 |
+
|
98 |
+
$order->setPayment($payment);
|
99 |
+
$order->setIngOrderId($this->_paypal->getOrderId())
|
100 |
+
->setIngIdealIssuerId(null);
|
101 |
+
$order->save();
|
102 |
+
|
103 |
+
$payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
104 |
+
$pendingMessage = Mage::helper('ingpsp')->__(ING_PSP_Model_Banktransfer::PAYMENT_FLAG_PENDING);
|
105 |
+
|
106 |
+
if ($order->getData('ing_order_id')) {
|
107 |
+
$pendingMessage .= '. '.'ING Order ID: '.$order->getData('ing_order_id');
|
108 |
+
}
|
109 |
+
|
110 |
+
$order->setState(
|
111 |
+
Mage_Sales_Model_Order::STATE_PROCESSING,
|
112 |
+
Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,
|
113 |
+
$pendingMessage,
|
114 |
+
false
|
115 |
+
);
|
116 |
+
|
117 |
+
$order->save();
|
118 |
+
|
119 |
+
Mage::log("Issuer url redirect: ".$this->_paypal->getPaymentUrl());
|
120 |
+
$this->_redirectUrl($this->_paypal->getPaymentUrl());
|
121 |
+
}
|
122 |
+
} catch (Exception $e) {
|
123 |
+
Mage::log($e);
|
124 |
+
Mage::throwException(
|
125 |
+
"Could not start transaction. Contact the owner.<br />
|
126 |
+
Error message: ".$this->_paypal->getErrorMessage()
|
127 |
+
);
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Customer returning with an order_id
|
133 |
+
* Depending on the order state redirected to the corresponding page
|
134 |
+
*/
|
135 |
+
public function returnAction()
|
136 |
+
{
|
137 |
+
$orderId = Mage::app()->getRequest()->getParam('order_id');
|
138 |
+
|
139 |
+
try {
|
140 |
+
if (!empty($orderId)) {
|
141 |
+
$ingOrderDetails = $this->_paypal->getOrderDetails($orderId);
|
142 |
+
|
143 |
+
$paymentStatus = isset($ingOrderDetails['status']) ? $ingOrderDetails['status'] : null;
|
144 |
+
|
145 |
+
if ($paymentStatus == "completed") {
|
146 |
+
// Redirect to success page
|
147 |
+
$this->_redirect('checkout/onepage/success', array('_secure' => true));
|
148 |
+
} else {
|
149 |
+
$this->_restoreCart();
|
150 |
+
|
151 |
+
// Redirect to failure page
|
152 |
+
$this->_redirect('checkout/onepage/failure', array('_secure' => true));
|
153 |
+
}
|
154 |
+
}
|
155 |
+
} catch (Exception $e) {
|
156 |
+
$this->_restoreCart();
|
157 |
+
|
158 |
+
Mage::log($e);
|
159 |
+
$this->_redirectUrl(Mage::getBaseUrl());
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
protected function _restoreCart()
|
164 |
+
{
|
165 |
+
$session = Mage::getSingleton('checkout/session');
|
166 |
+
$orderId = $session->getLastRealOrderId();
|
167 |
+
if (!empty($orderId)) {
|
168 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
169 |
+
}
|
170 |
+
$quoteId = $order->getQuoteId();
|
171 |
+
|
172 |
+
$quote = Mage::getModel('sales/quote')->load($quoteId)->setIsActive(true)->save();
|
173 |
+
|
174 |
+
Mage::getSingleton('checkout/session')->replaceQuote($quote);
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* @param Mage_Sales_Model_Order $order
|
179 |
+
* @param float $orderAmount
|
180 |
+
*/
|
181 |
+
protected function _setAmountPaid(Mage_Sales_Model_Order $order, $orderAmount)
|
182 |
+
{
|
183 |
+
// set the amounts paid
|
184 |
+
$currentBase = Mage::app()->getStore()->getBaseCurrencyCode();
|
185 |
+
$currentStore = Mage::app()->getStore()->getCurrentCurrencyCode();
|
186 |
+
|
187 |
+
$amountBase = Mage::helper('directory')->currencyConvert($orderAmount, 'EUR', $currentBase);
|
188 |
+
$amountStore = Mage::helper('directory')->currencyConvert($orderAmount, 'EUR', $currentStore);
|
189 |
+
|
190 |
+
$order->setBaseTotalPaid($amountBase);
|
191 |
+
$order->setTotalPaid($amountStore);
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* @param Mage_Sales_Model_Order $order
|
196 |
+
* @param null|string $transactionId
|
197 |
+
* @return bool
|
198 |
+
*/
|
199 |
+
protected function _savePaidInvoice(Mage_Sales_Model_Order $order, $transactionId = null)
|
200 |
+
{
|
201 |
+
$invoice = $order->prepareInvoice()
|
202 |
+
->register()
|
203 |
+
->setTransactionId($transactionId)
|
204 |
+
->pay();
|
205 |
+
|
206 |
+
Mage::getModel('core/resource_transaction')
|
207 |
+
->addObject($invoice)
|
208 |
+
->addObject($invoice->getOrder())
|
209 |
+
->save();
|
210 |
+
|
211 |
+
if (Mage::getStoreConfig("payment/ingpsp_paypal/send_invoice_mail", $order->getStoreId())) {
|
212 |
+
$invoice->sendEmail();
|
213 |
+
}
|
214 |
+
|
215 |
+
return true;
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Format price with currency sign
|
220 |
+
*
|
221 |
+
* @param Mage_Sales_Model_Order $order
|
222 |
+
* @param float $amount
|
223 |
+
* @return string
|
224 |
+
*/
|
225 |
+
protected function _formatPrice($order, $amount)
|
226 |
+
{
|
227 |
+
return $order->getBaseCurrency()->formatTxt($amount);
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
* @param Mage_Sales_Model_Order $order
|
232 |
+
* @return array
|
233 |
+
*/
|
234 |
+
protected function _getCustomerData(Mage_Sales_Model_Order $order)
|
235 |
+
{
|
236 |
+
$billingAddress = $order->getBillingAddress();
|
237 |
+
|
238 |
+
list($address, $houseNumber) = $this->_helper->parseAddress($billingAddress->getStreetFull());
|
239 |
+
|
240 |
+
return GingerPayments\Payment\Common\ArrayFunctions::withoutNullValues([
|
241 |
+
'merchant_customer_id' => $order->getCustomerId(),
|
242 |
+
'email_address' => $order->getCustomerEmail(),
|
243 |
+
'first_name' => $order->getCustomerFirstname(),
|
244 |
+
'last_name' => $order->getCustomerLastname(),
|
245 |
+
'address_type' => 'billing',
|
246 |
+
'address' => trim($billingAddress->getCity()).' '.trim($address),
|
247 |
+
'postal_code' => $billingAddress->getPostcode(),
|
248 |
+
'housenumber' => $houseNumber,
|
249 |
+
'country' => $billingAddress->getCountryId(),
|
250 |
+
'phone_numbers' => [$billingAddress->getTelephone()],
|
251 |
+
'user_agent' => $this->_coreHttp->getHttpUserAgent(),
|
252 |
+
'referrer' => $this->_coreHttp->getHttpReferer(),
|
253 |
+
'ip_address' => $this->_coreHttp->getRemoteAddr(),
|
254 |
+
'forwarded_ip' => $this->getRequest()->getServer('HTTP_X_FORWARDED_FOR'),
|
255 |
+
'gender' => $order->getCustomerGender() ? ('1' ? 'male' : ('2' ? 'female' : null)) : null,
|
256 |
+
'birth_date' => $order->getCustomerDob(),
|
257 |
+
'locale' => Mage::app()->getLocale()->getLocaleCode(),
|
258 |
+
]);
|
259 |
+
}
|
260 |
+
}
|
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_SofortController extends Mage_Core_Controller_Front_Action
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_Sofort
|
25 |
+
*/
|
26 |
+
protected $_sofort;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
30 |
+
*/
|
31 |
+
protected $_read;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
35 |
+
*/
|
36 |
+
protected $_write;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Get CreditCard core
|
40 |
+
* Give $_write mage writing resource
|
41 |
+
* Give $_read mage reading resource
|
42 |
+
*/
|
43 |
+
public function _construct()
|
44 |
+
{
|
45 |
+
$this->_sofort = Mage::helper('ingpsp/sofort');
|
46 |
+
$this->_helper = Mage::helper('ingpsp');
|
47 |
+
$this->_coreHttp = Mage::helper('core/http');
|
48 |
+
|
49 |
+
$this->_read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
50 |
+
$this->_write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
51 |
+
|
52 |
+
parent::_construct();
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Gets the current checkout session with order information
|
57 |
+
*
|
58 |
+
* @return Mage_Checkout_Model_Session
|
59 |
+
*/
|
60 |
+
protected function _getCheckout()
|
61 |
+
{
|
62 |
+
return Mage::getSingleton('checkout/session');
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Creates the order and sets the redirect url
|
67 |
+
*/
|
68 |
+
public function paymentAction()
|
69 |
+
{
|
70 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->_getCheckout()->last_real_order_id);
|
71 |
+
|
72 |
+
try {
|
73 |
+
$amount = $order->getGrandTotal();
|
74 |
+
$orderId = $order->getIncrementId();
|
75 |
+
$description = str_replace('%', $orderId,
|
76 |
+
Mage::getStoreConfig("payment/ingpsp_sofort/description", $order->getStoreId())
|
77 |
+
);
|
78 |
+
$currency = $order->getOrderCurrencyCode();
|
79 |
+
$customer = $this->_getCustomerData($order);
|
80 |
+
$returnUrl = Mage::getUrl('ingpsp/sofort/return');
|
81 |
+
|
82 |
+
if ($this->_sofort->createOrder($orderId, $amount, $currency, $description, $returnUrl, $customer)) {
|
83 |
+
if (!$order->getId()) {
|
84 |
+
Mage::log('Geen order voor verwerking gevonden');
|
85 |
+
Mage::throwException('Geen order voor verwerking gevonden');
|
86 |
+
}
|
87 |
+
|
88 |
+
$payment = $order->getPayment();
|
89 |
+
|
90 |
+
if (!$payment->getId()) {
|
91 |
+
$payment = Mage::getModel('sales/order_payment')->setId(null);
|
92 |
+
}
|
93 |
+
|
94 |
+
$payment->setIsTransactionClosed(false)
|
95 |
+
->setIngOrderId($this->_sofort->getOrderId())
|
96 |
+
->setIngIdealIssuerId(null);
|
97 |
+
|
98 |
+
$order->setPayment($payment);
|
99 |
+
$order->setIngOrderId($this->_sofort->getOrderId())
|
100 |
+
->setIngIdealIssuerId(null);
|
101 |
+
$order->save();
|
102 |
+
|
103 |
+
$payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
104 |
+
$pendingMessage = Mage::helper('ingpsp')->__(ING_PSP_Model_Banktransfer::PAYMENT_FLAG_PENDING);
|
105 |
+
|
106 |
+
if ($order->getData('ing_order_id')) {
|
107 |
+
$pendingMessage .= '. '.'ING Order ID: '.$order->getData('ing_order_id');
|
108 |
+
}
|
109 |
+
|
110 |
+
$order->setState(
|
111 |
+
Mage_Sales_Model_Order::STATE_PROCESSING,
|
112 |
+
Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,
|
113 |
+
$pendingMessage,
|
114 |
+
false
|
115 |
+
);
|
116 |
+
|
117 |
+
$order->save();
|
118 |
+
|
119 |
+
Mage::log("Issuer url redirect: ".$this->_sofort->getPaymentUrl());
|
120 |
+
$this->_redirectUrl($this->_sofort->getPaymentUrl());
|
121 |
+
}
|
122 |
+
} catch (Exception $e) {
|
123 |
+
Mage::log($e);
|
124 |
+
Mage::throwException(
|
125 |
+
"Could not start transaction. Contact the owner.<br />
|
126 |
+
Error message: ".$this->_sofort->getErrorMessage()
|
127 |
+
);
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Customer returning with an order_id
|
133 |
+
* Depending on the order state redirected to the corresponding page
|
134 |
+
*/
|
135 |
+
public function returnAction()
|
136 |
+
{
|
137 |
+
$orderId = Mage::app()->getRequest()->getParam('order_id');
|
138 |
+
|
139 |
+
try {
|
140 |
+
if (!empty($orderId)) {
|
141 |
+
$ingOrderDetails = $this->_sofort->getOrderDetails($orderId);
|
142 |
+
|
143 |
+
$paymentStatus = isset($ingOrderDetails['status']) ? $ingOrderDetails['status'] : null;
|
144 |
+
|
145 |
+
if ($paymentStatus == "completed") {
|
146 |
+
// Redirect to success page
|
147 |
+
$this->_redirect('checkout/onepage/success', array('_secure' => true));
|
148 |
+
} else {
|
149 |
+
$this->_restoreCart();
|
150 |
+
|
151 |
+
// Redirect to failure page
|
152 |
+
$this->_redirect('checkout/onepage/failure', array('_secure' => true));
|
153 |
+
}
|
154 |
+
}
|
155 |
+
} catch (Exception $e) {
|
156 |
+
$this->_restoreCart();
|
157 |
+
|
158 |
+
Mage::log($e);
|
159 |
+
$this->_redirectUrl(Mage::getBaseUrl());
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
protected function _restoreCart()
|
164 |
+
{
|
165 |
+
$session = Mage::getSingleton('checkout/session');
|
166 |
+
$orderId = $session->getLastRealOrderId();
|
167 |
+
if (!empty($orderId)) {
|
168 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
169 |
+
}
|
170 |
+
$quoteId = $order->getQuoteId();
|
171 |
+
|
172 |
+
$quote = Mage::getModel('sales/quote')->load($quoteId)->setIsActive(true)->save();
|
173 |
+
|
174 |
+
Mage::getSingleton('checkout/session')->replaceQuote($quote);
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* @param Mage_Sales_Model_Order $order
|
179 |
+
* @param float $orderAmount
|
180 |
+
*/
|
181 |
+
protected function _setAmountPaid(Mage_Sales_Model_Order $order, $orderAmount)
|
182 |
+
{
|
183 |
+
// set the amounts paid
|
184 |
+
$currentBase = Mage::app()->getStore()->getBaseCurrencyCode();
|
185 |
+
$currentStore = Mage::app()->getStore()->getCurrentCurrencyCode();
|
186 |
+
|
187 |
+
$amountBase = Mage::helper('directory')->currencyConvert($orderAmount, 'EUR', $currentBase);
|
188 |
+
$amountStore = Mage::helper('directory')->currencyConvert($orderAmount, 'EUR', $currentStore);
|
189 |
+
|
190 |
+
$order->setBaseTotalPaid($amountBase);
|
191 |
+
$order->setTotalPaid($amountStore);
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* @param Mage_Sales_Model_Order $order
|
196 |
+
* @param null|string $transactionId
|
197 |
+
* @return bool
|
198 |
+
*/
|
199 |
+
protected function _savePaidInvoice(Mage_Sales_Model_Order $order, $transactionId = null)
|
200 |
+
{
|
201 |
+
$invoice = $order->prepareInvoice()
|
202 |
+
->register()
|
203 |
+
->setTransactionId($transactionId)
|
204 |
+
->pay();
|
205 |
+
|
206 |
+
Mage::getModel('core/resource_transaction')
|
207 |
+
->addObject($invoice)
|
208 |
+
->addObject($invoice->getOrder())
|
209 |
+
->save();
|
210 |
+
|
211 |
+
if (Mage::getStoreConfig("payment/ingpsp_sofort/send_invoice_mail", $order->getStoreId())) {
|
212 |
+
$invoice->sendEmail();
|
213 |
+
}
|
214 |
+
|
215 |
+
return true;
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Format price with currency sign
|
220 |
+
*
|
221 |
+
* @param Mage_Sales_Model_Order $order
|
222 |
+
* @param float $amount
|
223 |
+
* @return string
|
224 |
+
*/
|
225 |
+
protected function _formatPrice($order, $amount)
|
226 |
+
{
|
227 |
+
return $order->getBaseCurrency()->formatTxt($amount);
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
* @param Mage_Sales_Model_Order $order
|
232 |
+
* @return array
|
233 |
+
*/
|
234 |
+
protected function _getCustomerData(Mage_Sales_Model_Order $order)
|
235 |
+
{
|
236 |
+
$billingAddress = $order->getBillingAddress();
|
237 |
+
|
238 |
+
list($address, $houseNumber) = $this->_helper->parseAddress($billingAddress->getStreetFull());
|
239 |
+
|
240 |
+
return GingerPayments\Payment\Common\ArrayFunctions::withoutNullValues([
|
241 |
+
'merchant_customer_id' => $order->getCustomerId(),
|
242 |
+
'email_address' => $order->getCustomerEmail(),
|
243 |
+
'first_name' => $order->getCustomerFirstname(),
|
244 |
+
'last_name' => $order->getCustomerLastname(),
|
245 |
+
'address_type' => 'billing',
|
246 |
+
'address' => trim($billingAddress->getCity()).' '.trim($address),
|
247 |
+
'postal_code' => $billingAddress->getPostcode(),
|
248 |
+
'housenumber' => $houseNumber,
|
249 |
+
'country' => $billingAddress->getCountryId(),
|
250 |
+
'phone_numbers' => [$billingAddress->getTelephone()],
|
251 |
+
'user_agent' => $this->_coreHttp->getHttpUserAgent(),
|
252 |
+
'referrer' => $this->_coreHttp->getHttpReferer(),
|
253 |
+
'ip_address' => $this->_coreHttp->getRemoteAddr(),
|
254 |
+
'forwarded_ip' => $this->getRequest()->getServer('HTTP_X_FORWARDED_FOR'),
|
255 |
+
'gender' => $order->getCustomerGender() ? ('1' ? 'male' : ('2' ? 'female' : null)) : null,
|
256 |
+
'birth_date' => $order->getCustomerDob(),
|
257 |
+
'locale' => Mage::app()->getLocale()->getLocaleCode(),
|
258 |
+
]);
|
259 |
+
}
|
260 |
+
}
|
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
-->
|
19 |
<config>
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
-->
|
19 |
<config>
|
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,14 +12,14 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
-->
|
19 |
<config>
|
20 |
<modules>
|
21 |
<ING_PSP>
|
22 |
-
<version>1.1.
|
23 |
</ING_PSP>
|
24 |
</modules>
|
25 |
<global>
|
@@ -242,6 +242,54 @@
|
|
242 |
<specificcountry>NL</specificcountry>
|
243 |
<sort_order>105</sort_order>
|
244 |
</ingpsp_bancontact>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
</payment>
|
246 |
</default>
|
247 |
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
-->
|
19 |
<config>
|
20 |
<modules>
|
21 |
<ING_PSP>
|
22 |
+
<version>1.1.7</version>
|
23 |
</ING_PSP>
|
24 |
</modules>
|
25 |
<global>
|
242 |
<specificcountry>NL</specificcountry>
|
243 |
<sort_order>105</sort_order>
|
244 |
</ingpsp_bancontact>
|
245 |
+
<ingpsp_paypal>
|
246 |
+
<group>ingpsp</group>
|
247 |
+
<active>1</active>
|
248 |
+
<title>PayPal</title>
|
249 |
+
<description>PayPal</description>
|
250 |
+
<model>ingpsp/paypal</model>
|
251 |
+
<title>PayPal</title>
|
252 |
+
<currency>EUR</currency>
|
253 |
+
<allowspecific>1</allowspecific>
|
254 |
+
<specificcountry>NL</specificcountry>
|
255 |
+
<sort_order>106</sort_order>
|
256 |
+
</ingpsp_paypal>
|
257 |
+
<ingpsp_klarna>
|
258 |
+
<group>ingpsp</group>
|
259 |
+
<active>1</active>
|
260 |
+
<title>Klarna</title>
|
261 |
+
<description>Klarna</description>
|
262 |
+
<model>ingpsp/klarna</model>
|
263 |
+
<title>Klarna</title>
|
264 |
+
<currency>EUR</currency>
|
265 |
+
<allowspecific>1</allowspecific>
|
266 |
+
<specificcountry>NL</specificcountry>
|
267 |
+
<sort_order>107</sort_order>
|
268 |
+
</ingpsp_klarna>
|
269 |
+
<ingpsp_sofort>
|
270 |
+
<group>ingpsp</group>
|
271 |
+
<active>1</active>
|
272 |
+
<title>SOFORT</title>
|
273 |
+
<description>SOFORT</description>
|
274 |
+
<model>ingpsp/sofort</model>
|
275 |
+
<title>SOFORT</title>
|
276 |
+
<currency>EUR</currency>
|
277 |
+
<allowspecific>1</allowspecific>
|
278 |
+
<specificcountry>NL</specificcountry>
|
279 |
+
<sort_order>107</sort_order>
|
280 |
+
</ingpsp_sofort>
|
281 |
+
<ingpsp_homepay>
|
282 |
+
<group>ingpsp</group>
|
283 |
+
<active>1</active>
|
284 |
+
<title>HomePay</title>
|
285 |
+
<description>HomePay</description>
|
286 |
+
<model>ingpsp/homepay</model>
|
287 |
+
<title>HomePay</title>
|
288 |
+
<currency>EUR</currency>
|
289 |
+
<allowspecific>1</allowspecific>
|
290 |
+
<specificcountry>NL</specificcountry>
|
291 |
+
<sort_order>108</sort_order>
|
292 |
+
</ingpsp_homepay>
|
293 |
</payment>
|
294 |
</default>
|
295 |
</config>
|
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
-->
|
@@ -23,7 +23,7 @@
|
|
23 |
<groups>
|
24 |
<ingpsp translate="label comment">
|
25 |
<label>ING PSP - Settings</label>
|
26 |
-
<expanded>
|
27 |
<sort_order>116</sort_order>
|
28 |
<frontend_type>text</frontend_type>
|
29 |
<show_in_default>1</show_in_default>
|
@@ -31,7 +31,7 @@
|
|
31 |
<show_in_store>1</show_in_store>
|
32 |
<fields>
|
33 |
<version>
|
34 |
-
<label>v1.1.
|
35 |
<sort_order>1</sort_order>
|
36 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
37 |
<frontend_type>label</frontend_type>
|
@@ -41,25 +41,35 @@
|
|
41 |
</version>
|
42 |
<apikey translate="label">
|
43 |
<label>API Key</label>
|
44 |
-
<frontend_type>text</frontend_type>
|
45 |
<sort_order>2</sort_order>
|
|
|
46 |
<show_in_default>1</show_in_default>
|
47 |
<show_in_website>1</show_in_website>
|
48 |
<show_in_store>1</show_in_store>
|
49 |
<validate>required-entry validate-alphanum</validate>
|
50 |
</apikey>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
<product translate="label">
|
52 |
<label>Product</label>
|
|
|
53 |
<frontend_type>select</frontend_type>
|
54 |
<source_model>ing_psp/system_config_source_dropdown_values</source_model>
|
55 |
-
<sort_order>3</sort_order>
|
56 |
<show_in_default>1</show_in_default>
|
57 |
<show_in_website>1</show_in_website>
|
58 |
<show_in_store>1</show_in_store>
|
59 |
</product>
|
60 |
<webhook translate="label">
|
61 |
<label>Webhook URL</label>
|
62 |
-
<sort_order>
|
63 |
<frontend_type>select</frontend_type>
|
64 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
65 |
<show_in_default>1</show_in_default>
|
@@ -69,7 +79,7 @@
|
|
69 |
</webhook>
|
70 |
<bundle_cacert translate="label">
|
71 |
<label>Bundle CA.cert file</label>
|
72 |
-
<sort_order>
|
73 |
<frontend_type>select</frontend_type>
|
74 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
75 |
<show_in_default>1</show_in_default>
|
@@ -81,7 +91,7 @@
|
|
81 |
</ingpsp>
|
82 |
<ingpsp_ideal translate="label comment" module="ingpsp">
|
83 |
<label>ING PSP - iDEAL</label>
|
84 |
-
<expanded>
|
85 |
<sort_order>117</sort_order>
|
86 |
<frontend_type>text</frontend_type>
|
87 |
<show_in_default>1</show_in_default>
|
@@ -167,7 +177,7 @@
|
|
167 |
</ingpsp_ideal>
|
168 |
<ingpsp_banktransfer translate="label comment" module="ingpsp">
|
169 |
<label>ING PSP - Banktransfer</label>
|
170 |
-
<expanded>
|
171 |
<sort_order>118</sort_order>
|
172 |
<frontend_type>text</frontend_type>
|
173 |
<show_in_default>1</show_in_default>
|
@@ -253,7 +263,7 @@
|
|
253 |
</ingpsp_banktransfer>
|
254 |
<ingpsp_creditcard translate="label comment" module="ingpsp">
|
255 |
<label>ING PSP - Mastercard, VISA, Maestro of V PAY</label>
|
256 |
-
<expanded>
|
257 |
<sort_order>119</sort_order>
|
258 |
<frontend_type>text</frontend_type>
|
259 |
<show_in_default>1</show_in_default>
|
@@ -339,7 +349,7 @@
|
|
339 |
</ingpsp_creditcard>
|
340 |
<ingpsp_cashondelivery translate="label comment" module="ingpsp">
|
341 |
<label>ING PSP - Cashondelivery</label>
|
342 |
-
<expanded>
|
343 |
<sort_order>120</sort_order>
|
344 |
<frontend_type>text</frontend_type>
|
345 |
<show_in_default>1</show_in_default>
|
@@ -425,7 +435,7 @@
|
|
425 |
</ingpsp_cashondelivery>
|
426 |
<ingpsp_bancontact translate="label comment" module="ingpsp">
|
427 |
<label>ING PSP - Bancontact</label>
|
428 |
-
<expanded>
|
429 |
<sort_order>121</sort_order>
|
430 |
<frontend_type>text</frontend_type>
|
431 |
<show_in_default>1</show_in_default>
|
@@ -509,6 +519,361 @@
|
|
509 |
</sort_order>
|
510 |
</fields>
|
511 |
</ingpsp_bancontact>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
512 |
</groups>
|
513 |
</payment>
|
514 |
</sections>
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
-->
|
23 |
<groups>
|
24 |
<ingpsp translate="label comment">
|
25 |
<label>ING PSP - Settings</label>
|
26 |
+
<expanded>0</expanded>
|
27 |
<sort_order>116</sort_order>
|
28 |
<frontend_type>text</frontend_type>
|
29 |
<show_in_default>1</show_in_default>
|
31 |
<show_in_store>1</show_in_store>
|
32 |
<fields>
|
33 |
<version>
|
34 |
+
<label>v1.1.7</label>
|
35 |
<sort_order>1</sort_order>
|
36 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
37 |
<frontend_type>label</frontend_type>
|
41 |
</version>
|
42 |
<apikey translate="label">
|
43 |
<label>API Key</label>
|
|
|
44 |
<sort_order>2</sort_order>
|
45 |
+
<frontend_type>text</frontend_type>
|
46 |
<show_in_default>1</show_in_default>
|
47 |
<show_in_website>1</show_in_website>
|
48 |
<show_in_store>1</show_in_store>
|
49 |
<validate>required-entry validate-alphanum</validate>
|
50 |
</apikey>
|
51 |
+
<test_apikey translate="label">
|
52 |
+
<label>Test API Key</label>
|
53 |
+
<sort_order>3</sort_order>
|
54 |
+
<frontend_type>text</frontend_type>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
<validate>validate-alphanum</validate>
|
59 |
+
<comment>Used for testing Klarna payment method.</comment>
|
60 |
+
</test_apikey>
|
61 |
<product translate="label">
|
62 |
<label>Product</label>
|
63 |
+
<sort_order>4</sort_order>
|
64 |
<frontend_type>select</frontend_type>
|
65 |
<source_model>ing_psp/system_config_source_dropdown_values</source_model>
|
|
|
66 |
<show_in_default>1</show_in_default>
|
67 |
<show_in_website>1</show_in_website>
|
68 |
<show_in_store>1</show_in_store>
|
69 |
</product>
|
70 |
<webhook translate="label">
|
71 |
<label>Webhook URL</label>
|
72 |
+
<sort_order>5</sort_order>
|
73 |
<frontend_type>select</frontend_type>
|
74 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
75 |
<show_in_default>1</show_in_default>
|
79 |
</webhook>
|
80 |
<bundle_cacert translate="label">
|
81 |
<label>Bundle CA.cert file</label>
|
82 |
+
<sort_order>6</sort_order>
|
83 |
<frontend_type>select</frontend_type>
|
84 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
85 |
<show_in_default>1</show_in_default>
|
91 |
</ingpsp>
|
92 |
<ingpsp_ideal translate="label comment" module="ingpsp">
|
93 |
<label>ING PSP - iDEAL</label>
|
94 |
+
<expanded>0</expanded>
|
95 |
<sort_order>117</sort_order>
|
96 |
<frontend_type>text</frontend_type>
|
97 |
<show_in_default>1</show_in_default>
|
177 |
</ingpsp_ideal>
|
178 |
<ingpsp_banktransfer translate="label comment" module="ingpsp">
|
179 |
<label>ING PSP - Banktransfer</label>
|
180 |
+
<expanded>0</expanded>
|
181 |
<sort_order>118</sort_order>
|
182 |
<frontend_type>text</frontend_type>
|
183 |
<show_in_default>1</show_in_default>
|
263 |
</ingpsp_banktransfer>
|
264 |
<ingpsp_creditcard translate="label comment" module="ingpsp">
|
265 |
<label>ING PSP - Mastercard, VISA, Maestro of V PAY</label>
|
266 |
+
<expanded>0</expanded>
|
267 |
<sort_order>119</sort_order>
|
268 |
<frontend_type>text</frontend_type>
|
269 |
<show_in_default>1</show_in_default>
|
349 |
</ingpsp_creditcard>
|
350 |
<ingpsp_cashondelivery translate="label comment" module="ingpsp">
|
351 |
<label>ING PSP - Cashondelivery</label>
|
352 |
+
<expanded>0</expanded>
|
353 |
<sort_order>120</sort_order>
|
354 |
<frontend_type>text</frontend_type>
|
355 |
<show_in_default>1</show_in_default>
|
435 |
</ingpsp_cashondelivery>
|
436 |
<ingpsp_bancontact translate="label comment" module="ingpsp">
|
437 |
<label>ING PSP - Bancontact</label>
|
438 |
+
<expanded>0</expanded>
|
439 |
<sort_order>121</sort_order>
|
440 |
<frontend_type>text</frontend_type>
|
441 |
<show_in_default>1</show_in_default>
|
519 |
</sort_order>
|
520 |
</fields>
|
521 |
</ingpsp_bancontact>
|
522 |
+
<ingpsp_paypal translate="label comment" module="ingpsp">
|
523 |
+
<label>ING PSP - PayPal</label>
|
524 |
+
<expanded>0</expanded>
|
525 |
+
<sort_order>122</sort_order>
|
526 |
+
<frontend_type>text</frontend_type>
|
527 |
+
<show_in_default>1</show_in_default>
|
528 |
+
<show_in_website>1</show_in_website>
|
529 |
+
<show_in_store>1</show_in_store>
|
530 |
+
<fields>
|
531 |
+
<active translate="label">
|
532 |
+
<label>Enabled</label>
|
533 |
+
<frontend_type>select</frontend_type>
|
534 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
535 |
+
<sort_order>100</sort_order>
|
536 |
+
<show_in_default>1</show_in_default>
|
537 |
+
<show_in_website>1</show_in_website>
|
538 |
+
<show_in_store>0</show_in_store>
|
539 |
+
</active>
|
540 |
+
<title translate="label">
|
541 |
+
<label>Title</label>
|
542 |
+
<frontend_type>text</frontend_type>
|
543 |
+
<sort_order>150</sort_order>
|
544 |
+
<show_in_default>1</show_in_default>
|
545 |
+
<show_in_website>1</show_in_website>
|
546 |
+
<show_in_store>1</show_in_store>
|
547 |
+
<validate>required-entry</validate>
|
548 |
+
</title>
|
549 |
+
<description translate="label">
|
550 |
+
<label>Description</label>
|
551 |
+
<frontend_type>text</frontend_type>
|
552 |
+
<sort_order>200</sort_order>
|
553 |
+
<show_in_default>1</show_in_default>
|
554 |
+
<show_in_website>1</show_in_website>
|
555 |
+
<show_in_store>1</show_in_store>
|
556 |
+
<validate>required-entry</validate>
|
557 |
+
</description>
|
558 |
+
<specificcountry translate="label">
|
559 |
+
<label>Payment from Specific Countries</label>
|
560 |
+
<sort_order>300</sort_order>
|
561 |
+
<frontend_type>multiselect</frontend_type>
|
562 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
563 |
+
<can_be_empty>1</can_be_empty>
|
564 |
+
<show_in_default>1</show_in_default>
|
565 |
+
<show_in_website>1</show_in_website>
|
566 |
+
<show_in_store>1</show_in_store>
|
567 |
+
</specificcountry>
|
568 |
+
<send_order_mail translate="label">
|
569 |
+
<label>Send order mail</label>
|
570 |
+
<sort_order>400</sort_order>
|
571 |
+
<frontend_type>select</frontend_type>
|
572 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
573 |
+
<show_in_default>1</show_in_default>
|
574 |
+
<show_in_website>1</show_in_website>
|
575 |
+
<show_in_store>1</show_in_store>
|
576 |
+
</send_order_mail>
|
577 |
+
<generate_invoice_upon_completion translate="label">
|
578 |
+
<label>Generate invoice upon succesfull transaction</label>
|
579 |
+
<sort_order>500</sort_order>
|
580 |
+
<frontend_type>select</frontend_type>
|
581 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
582 |
+
<show_in_default>1</show_in_default>
|
583 |
+
<show_in_website>1</show_in_website>
|
584 |
+
<show_in_store>1</show_in_store>
|
585 |
+
</generate_invoice_upon_completion>
|
586 |
+
<send_invoice_mail translate="label">
|
587 |
+
<label>Send invoice mail</label>
|
588 |
+
<sort_order>600</sort_order>
|
589 |
+
<frontend_type>select</frontend_type>
|
590 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
591 |
+
<show_in_default>1</show_in_default>
|
592 |
+
<show_in_website>1</show_in_website>
|
593 |
+
<show_in_store>1</show_in_store>
|
594 |
+
<depends>
|
595 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
596 |
+
</depends>
|
597 |
+
</send_invoice_mail>
|
598 |
+
<sort_order translate="label">
|
599 |
+
<label>Sort order</label>
|
600 |
+
<frontend_type>text</frontend_type>
|
601 |
+
<sort_order>700</sort_order>
|
602 |
+
<show_in_default>1</show_in_default>
|
603 |
+
<show_in_website>1</show_in_website>
|
604 |
+
<show_in_store>1</show_in_store>
|
605 |
+
</sort_order>
|
606 |
+
</fields>
|
607 |
+
</ingpsp_paypal>
|
608 |
+
<ingpsp_klarna translate="label comment" module="ingpsp">
|
609 |
+
<label>ING PSP - Klarna</label>
|
610 |
+
<expanded>0</expanded>
|
611 |
+
<sort_order>123</sort_order>
|
612 |
+
<frontend_type>text</frontend_type>
|
613 |
+
<show_in_default>1</show_in_default>
|
614 |
+
<show_in_website>1</show_in_website>
|
615 |
+
<show_in_store>1</show_in_store>
|
616 |
+
<fields>
|
617 |
+
<active translate="label">
|
618 |
+
<label>Enabled</label>
|
619 |
+
<frontend_type>select</frontend_type>
|
620 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
621 |
+
<sort_order>100</sort_order>
|
622 |
+
<show_in_default>1</show_in_default>
|
623 |
+
<show_in_website>1</show_in_website>
|
624 |
+
<show_in_store>0</show_in_store>
|
625 |
+
</active>
|
626 |
+
<title translate="label">
|
627 |
+
<label>Title</label>
|
628 |
+
<frontend_type>text</frontend_type>
|
629 |
+
<sort_order>150</sort_order>
|
630 |
+
<show_in_default>1</show_in_default>
|
631 |
+
<show_in_website>1</show_in_website>
|
632 |
+
<show_in_store>1</show_in_store>
|
633 |
+
<validate>required-entry</validate>
|
634 |
+
</title>
|
635 |
+
<description translate="label">
|
636 |
+
<label>Description</label>
|
637 |
+
<frontend_type>text</frontend_type>
|
638 |
+
<sort_order>200</sort_order>
|
639 |
+
<show_in_default>1</show_in_default>
|
640 |
+
<show_in_website>1</show_in_website>
|
641 |
+
<show_in_store>1</show_in_store>
|
642 |
+
<validate>required-entry</validate>
|
643 |
+
</description>
|
644 |
+
<specificcountry translate="label">
|
645 |
+
<label>Payment from Specific Countries</label>
|
646 |
+
<sort_order>300</sort_order>
|
647 |
+
<frontend_type>multiselect</frontend_type>
|
648 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
649 |
+
<can_be_empty>1</can_be_empty>
|
650 |
+
<show_in_default>1</show_in_default>
|
651 |
+
<show_in_website>1</show_in_website>
|
652 |
+
<show_in_store>1</show_in_store>
|
653 |
+
</specificcountry>
|
654 |
+
<send_order_mail translate="label">
|
655 |
+
<label>Send order mail</label>
|
656 |
+
<sort_order>400</sort_order>
|
657 |
+
<frontend_type>select</frontend_type>
|
658 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
659 |
+
<show_in_default>1</show_in_default>
|
660 |
+
<show_in_website>1</show_in_website>
|
661 |
+
<show_in_store>1</show_in_store>
|
662 |
+
</send_order_mail>
|
663 |
+
<generate_invoice_upon_completion translate="label">
|
664 |
+
<label>Generate invoice upon succesfull transaction</label>
|
665 |
+
<sort_order>500</sort_order>
|
666 |
+
<frontend_type>select</frontend_type>
|
667 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
668 |
+
<show_in_default>1</show_in_default>
|
669 |
+
<show_in_website>1</show_in_website>
|
670 |
+
<show_in_store>1</show_in_store>
|
671 |
+
</generate_invoice_upon_completion>
|
672 |
+
<send_invoice_mail translate="label">
|
673 |
+
<label>Send invoice mail</label>
|
674 |
+
<sort_order>600</sort_order>
|
675 |
+
<frontend_type>select</frontend_type>
|
676 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
677 |
+
<show_in_default>1</show_in_default>
|
678 |
+
<show_in_website>1</show_in_website>
|
679 |
+
<show_in_store>1</show_in_store>
|
680 |
+
<depends>
|
681 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
682 |
+
</depends>
|
683 |
+
</send_invoice_mail>
|
684 |
+
<sort_order translate="label">
|
685 |
+
<label>Sort order</label>
|
686 |
+
<frontend_type>text</frontend_type>
|
687 |
+
<sort_order>700</sort_order>
|
688 |
+
<show_in_default>1</show_in_default>
|
689 |
+
<show_in_website>1</show_in_website>
|
690 |
+
<show_in_store>1</show_in_store>
|
691 |
+
</sort_order>
|
692 |
+
|
693 |
+
<ip_filter>
|
694 |
+
<label>IP Filtering</label>
|
695 |
+
<frontend_type>text</frontend_type>
|
696 |
+
<sort_order>800</sort_order>
|
697 |
+
<show_in_default>1</show_in_default>
|
698 |
+
<show_in_website>1</show_in_website>
|
699 |
+
<show_in_store>1</show_in_store>
|
700 |
+
<comment>Example: 127.0.0.1, 255.255.255.255</comment>
|
701 |
+
</ip_filter>
|
702 |
+
|
703 |
+
</fields>
|
704 |
+
</ingpsp_klarna>
|
705 |
+
<ingpsp_sofort translate="label comment" module="ingpsp">
|
706 |
+
<label>ING PSP - SOFORT</label>
|
707 |
+
<expanded>0</expanded>
|
708 |
+
<sort_order>123</sort_order>
|
709 |
+
<frontend_type>text</frontend_type>
|
710 |
+
<show_in_default>1</show_in_default>
|
711 |
+
<show_in_website>1</show_in_website>
|
712 |
+
<show_in_store>1</show_in_store>
|
713 |
+
<fields>
|
714 |
+
<active translate="label">
|
715 |
+
<label>Enabled</label>
|
716 |
+
<frontend_type>select</frontend_type>
|
717 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
718 |
+
<sort_order>100</sort_order>
|
719 |
+
<show_in_default>1</show_in_default>
|
720 |
+
<show_in_website>1</show_in_website>
|
721 |
+
<show_in_store>0</show_in_store>
|
722 |
+
</active>
|
723 |
+
<title translate="label">
|
724 |
+
<label>Title</label>
|
725 |
+
<frontend_type>text</frontend_type>
|
726 |
+
<sort_order>150</sort_order>
|
727 |
+
<show_in_default>1</show_in_default>
|
728 |
+
<show_in_website>1</show_in_website>
|
729 |
+
<show_in_store>1</show_in_store>
|
730 |
+
<validate>required-entry</validate>
|
731 |
+
</title>
|
732 |
+
<description translate="label">
|
733 |
+
<label>Description</label>
|
734 |
+
<frontend_type>text</frontend_type>
|
735 |
+
<sort_order>200</sort_order>
|
736 |
+
<show_in_default>1</show_in_default>
|
737 |
+
<show_in_website>1</show_in_website>
|
738 |
+
<show_in_store>1</show_in_store>
|
739 |
+
<validate>required-entry</validate>
|
740 |
+
</description>
|
741 |
+
<specificcountry translate="label">
|
742 |
+
<label>Payment from Specific Countries</label>
|
743 |
+
<sort_order>300</sort_order>
|
744 |
+
<frontend_type>multiselect</frontend_type>
|
745 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
746 |
+
<can_be_empty>1</can_be_empty>
|
747 |
+
<show_in_default>1</show_in_default>
|
748 |
+
<show_in_website>1</show_in_website>
|
749 |
+
<show_in_store>1</show_in_store>
|
750 |
+
</specificcountry>
|
751 |
+
<send_order_mail translate="label">
|
752 |
+
<label>Send order mail</label>
|
753 |
+
<sort_order>400</sort_order>
|
754 |
+
<frontend_type>select</frontend_type>
|
755 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
756 |
+
<show_in_default>1</show_in_default>
|
757 |
+
<show_in_website>1</show_in_website>
|
758 |
+
<show_in_store>1</show_in_store>
|
759 |
+
</send_order_mail>
|
760 |
+
<generate_invoice_upon_completion translate="label">
|
761 |
+
<label>Generate invoice upon succesfull transaction</label>
|
762 |
+
<sort_order>500</sort_order>
|
763 |
+
<frontend_type>select</frontend_type>
|
764 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
765 |
+
<show_in_default>1</show_in_default>
|
766 |
+
<show_in_website>1</show_in_website>
|
767 |
+
<show_in_store>1</show_in_store>
|
768 |
+
</generate_invoice_upon_completion>
|
769 |
+
<send_invoice_mail translate="label">
|
770 |
+
<label>Send invoice mail</label>
|
771 |
+
<sort_order>600</sort_order>
|
772 |
+
<frontend_type>select</frontend_type>
|
773 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
774 |
+
<show_in_default>1</show_in_default>
|
775 |
+
<show_in_website>1</show_in_website>
|
776 |
+
<show_in_store>1</show_in_store>
|
777 |
+
<depends>
|
778 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
779 |
+
</depends>
|
780 |
+
</send_invoice_mail>
|
781 |
+
<sort_order translate="label">
|
782 |
+
<label>Sort order</label>
|
783 |
+
<frontend_type>text</frontend_type>
|
784 |
+
<sort_order>700</sort_order>
|
785 |
+
<show_in_default>1</show_in_default>
|
786 |
+
<show_in_website>1</show_in_website>
|
787 |
+
<show_in_store>1</show_in_store>
|
788 |
+
</sort_order>
|
789 |
+
</fields>
|
790 |
+
</ingpsp_sofort>
|
791 |
+
<ingpsp_homepay translate="label comment" module="ingpsp">
|
792 |
+
<label>ING PSP - HomePay</label>
|
793 |
+
<expanded>0</expanded>
|
794 |
+
<sort_order>122</sort_order>
|
795 |
+
<frontend_type>text</frontend_type>
|
796 |
+
<show_in_default>1</show_in_default>
|
797 |
+
<show_in_website>1</show_in_website>
|
798 |
+
<show_in_store>1</show_in_store>
|
799 |
+
<fields>
|
800 |
+
<active translate="label">
|
801 |
+
<label>Enabled</label>
|
802 |
+
<frontend_type>select</frontend_type>
|
803 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
804 |
+
<sort_order>100</sort_order>
|
805 |
+
<show_in_default>1</show_in_default>
|
806 |
+
<show_in_website>1</show_in_website>
|
807 |
+
<show_in_store>0</show_in_store>
|
808 |
+
</active>
|
809 |
+
<title translate="label">
|
810 |
+
<label>Title</label>
|
811 |
+
<frontend_type>text</frontend_type>
|
812 |
+
<sort_order>150</sort_order>
|
813 |
+
<show_in_default>1</show_in_default>
|
814 |
+
<show_in_website>1</show_in_website>
|
815 |
+
<show_in_store>1</show_in_store>
|
816 |
+
<validate>required-entry</validate>
|
817 |
+
</title>
|
818 |
+
<description translate="label">
|
819 |
+
<label>Description</label>
|
820 |
+
<frontend_type>text</frontend_type>
|
821 |
+
<sort_order>200</sort_order>
|
822 |
+
<show_in_default>1</show_in_default>
|
823 |
+
<show_in_website>1</show_in_website>
|
824 |
+
<show_in_store>1</show_in_store>
|
825 |
+
<validate>required-entry</validate>
|
826 |
+
</description>
|
827 |
+
<specificcountry translate="label">
|
828 |
+
<label>Payment from Specific Countries</label>
|
829 |
+
<sort_order>300</sort_order>
|
830 |
+
<frontend_type>multiselect</frontend_type>
|
831 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
832 |
+
<can_be_empty>1</can_be_empty>
|
833 |
+
<show_in_default>1</show_in_default>
|
834 |
+
<show_in_website>1</show_in_website>
|
835 |
+
<show_in_store>1</show_in_store>
|
836 |
+
</specificcountry>
|
837 |
+
<send_order_mail translate="label">
|
838 |
+
<label>Send order mail</label>
|
839 |
+
<sort_order>400</sort_order>
|
840 |
+
<frontend_type>select</frontend_type>
|
841 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
842 |
+
<show_in_default>1</show_in_default>
|
843 |
+
<show_in_website>1</show_in_website>
|
844 |
+
<show_in_store>1</show_in_store>
|
845 |
+
</send_order_mail>
|
846 |
+
<generate_invoice_upon_completion translate="label">
|
847 |
+
<label>Generate invoice upon succesfull transaction</label>
|
848 |
+
<sort_order>500</sort_order>
|
849 |
+
<frontend_type>select</frontend_type>
|
850 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
851 |
+
<show_in_default>1</show_in_default>
|
852 |
+
<show_in_website>1</show_in_website>
|
853 |
+
<show_in_store>1</show_in_store>
|
854 |
+
</generate_invoice_upon_completion>
|
855 |
+
<send_invoice_mail translate="label">
|
856 |
+
<label>Send invoice mail</label>
|
857 |
+
<sort_order>600</sort_order>
|
858 |
+
<frontend_type>select</frontend_type>
|
859 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
860 |
+
<show_in_default>1</show_in_default>
|
861 |
+
<show_in_website>1</show_in_website>
|
862 |
+
<show_in_store>1</show_in_store>
|
863 |
+
<depends>
|
864 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
865 |
+
</depends>
|
866 |
+
</send_invoice_mail>
|
867 |
+
<sort_order translate="label">
|
868 |
+
<label>Sort order</label>
|
869 |
+
<frontend_type>text</frontend_type>
|
870 |
+
<sort_order>700</sort_order>
|
871 |
+
<show_in_default>1</show_in_default>
|
872 |
+
<show_in_website>1</show_in_website>
|
873 |
+
<show_in_store>1</show_in_store>
|
874 |
+
</sort_order>
|
875 |
+
</fields>
|
876 |
+
</ingpsp_homepay>
|
877 |
</groups>
|
878 |
</payment>
|
879 |
</sections>
|
@@ -0,0 +1,874 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.5
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
-->
|
20 |
+
<config>
|
21 |
+
<sections>
|
22 |
+
<payment>
|
23 |
+
<groups>
|
24 |
+
<ingpsp translate="label comment">
|
25 |
+
<label>ING PSP - Settings</label>
|
26 |
+
<expanded>0</expanded>
|
27 |
+
<sort_order>116</sort_order>
|
28 |
+
<frontend_type>text</frontend_type>
|
29 |
+
<show_in_default>1</show_in_default>
|
30 |
+
<show_in_website>1</show_in_website>
|
31 |
+
<show_in_store>1</show_in_store>
|
32 |
+
<fields>
|
33 |
+
<version>
|
34 |
+
<label>v1.1.5</label>
|
35 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
36 |
+
<frontend_type>label</frontend_type>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>1</show_in_store>
|
40 |
+
</version>
|
41 |
+
<apikey translate="label">
|
42 |
+
<label>API Key</label>
|
43 |
+
<frontend_type>text</frontend_type>
|
44 |
+
<show_in_default>1</show_in_default>
|
45 |
+
<show_in_website>1</show_in_website>
|
46 |
+
<show_in_store>1</show_in_store>
|
47 |
+
<validate>required-entry validate-alphanum</validate>
|
48 |
+
</apikey>
|
49 |
+
<test_apikey translate="label">
|
50 |
+
<label>Test API Key</label>
|
51 |
+
<frontend_type>text</frontend_type>
|
52 |
+
<show_in_default>1</show_in_default>
|
53 |
+
<show_in_website>1</show_in_website>
|
54 |
+
<show_in_store>1</show_in_store>
|
55 |
+
<validate>validate-alphanum</validate>
|
56 |
+
<comment>Used for testing Klarna payment method.</comment>
|
57 |
+
</test_apikey>
|
58 |
+
<product translate="label">
|
59 |
+
<label>Product</label>
|
60 |
+
<frontend_type>select</frontend_type>
|
61 |
+
<source_model>ing_psp/system_config_source_dropdown_values</source_model>
|
62 |
+
<show_in_default>1</show_in_default>
|
63 |
+
<show_in_website>1</show_in_website>
|
64 |
+
<show_in_store>1</show_in_store>
|
65 |
+
</product>
|
66 |
+
<webhook translate="label">
|
67 |
+
<label>Webhook URL</label>
|
68 |
+
<frontend_type>select</frontend_type>
|
69 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
70 |
+
<show_in_default>1</show_in_default>
|
71 |
+
<show_in_website>1</show_in_website>
|
72 |
+
<show_in_store>1</show_in_store>
|
73 |
+
<comment>Include Webhook URL with every order creation</comment>
|
74 |
+
</webhook>
|
75 |
+
<bundle_cacert translate="label">
|
76 |
+
<label>Bundle CA.cert file</label>
|
77 |
+
<frontend_type>select</frontend_type>
|
78 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
79 |
+
<show_in_default>1</show_in_default>
|
80 |
+
<show_in_website>1</show_in_website>
|
81 |
+
<show_in_store>1</show_in_store>
|
82 |
+
<comment>Resolves issue when curl.cacert path is not set in PHP.ini</comment>
|
83 |
+
</bundle_cacert>
|
84 |
+
</fields>
|
85 |
+
</ingpsp>
|
86 |
+
<ingpsp_ideal translate="label comment" module="ingpsp">
|
87 |
+
<label>ING PSP - iDEAL</label>
|
88 |
+
<expanded>0</expanded>
|
89 |
+
<sort_order>117</sort_order>
|
90 |
+
<frontend_type>text</frontend_type>
|
91 |
+
<show_in_default>1</show_in_default>
|
92 |
+
<show_in_website>1</show_in_website>
|
93 |
+
<show_in_store>1</show_in_store>
|
94 |
+
<fields>
|
95 |
+
<active translate="label">
|
96 |
+
<label>Enabled</label>
|
97 |
+
<frontend_type>select</frontend_type>
|
98 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
99 |
+
<sort_order>100</sort_order>
|
100 |
+
<show_in_default>1</show_in_default>
|
101 |
+
<show_in_website>1</show_in_website>
|
102 |
+
<show_in_store>0</show_in_store>
|
103 |
+
</active>
|
104 |
+
<title translate="label">
|
105 |
+
<label>Title</label>
|
106 |
+
<frontend_type>text</frontend_type>
|
107 |
+
<sort_order>150</sort_order>
|
108 |
+
<show_in_default>1</show_in_default>
|
109 |
+
<show_in_website>1</show_in_website>
|
110 |
+
<show_in_store>1</show_in_store>
|
111 |
+
<validate>required-entry</validate>
|
112 |
+
</title>
|
113 |
+
<description translate="label">
|
114 |
+
<label>Description</label>
|
115 |
+
<frontend_type>text</frontend_type>
|
116 |
+
<sort_order>200</sort_order>
|
117 |
+
<show_in_default>1</show_in_default>
|
118 |
+
<show_in_website>1</show_in_website>
|
119 |
+
<show_in_store>1</show_in_store>
|
120 |
+
<validate>required-entry</validate>
|
121 |
+
</description>
|
122 |
+
<specificcountry translate="label">
|
123 |
+
<label>Payment from Specific Countries</label>
|
124 |
+
<sort_order>300</sort_order>
|
125 |
+
<frontend_type>multiselect</frontend_type>
|
126 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
127 |
+
<can_be_empty>1</can_be_empty>
|
128 |
+
<show_in_default>1</show_in_default>
|
129 |
+
<show_in_website>1</show_in_website>
|
130 |
+
<show_in_store>1</show_in_store>
|
131 |
+
</specificcountry>
|
132 |
+
<send_order_mail translate="label">
|
133 |
+
<label>Send order mail</label>
|
134 |
+
<sort_order>400</sort_order>
|
135 |
+
<frontend_type>select</frontend_type>
|
136 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
137 |
+
<show_in_default>1</show_in_default>
|
138 |
+
<show_in_website>1</show_in_website>
|
139 |
+
<show_in_store>1</show_in_store>
|
140 |
+
</send_order_mail>
|
141 |
+
<generate_invoice_upon_completion translate="label">
|
142 |
+
<label>Generate invoice upon succesfull transaction</label>
|
143 |
+
<sort_order>500</sort_order>
|
144 |
+
<frontend_type>select</frontend_type>
|
145 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
146 |
+
<show_in_default>1</show_in_default>
|
147 |
+
<show_in_website>1</show_in_website>
|
148 |
+
<show_in_store>1</show_in_store>
|
149 |
+
</generate_invoice_upon_completion>
|
150 |
+
<send_invoice_mail translate="label">
|
151 |
+
<label>Send invoice mail</label>
|
152 |
+
<sort_order>600</sort_order>
|
153 |
+
<frontend_type>select</frontend_type>
|
154 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
155 |
+
<show_in_default>1</show_in_default>
|
156 |
+
<show_in_website>1</show_in_website>
|
157 |
+
<show_in_store>1</show_in_store>
|
158 |
+
<depends>
|
159 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
160 |
+
</depends>
|
161 |
+
</send_invoice_mail>
|
162 |
+
<sort_order translate="label">
|
163 |
+
<label>Sort order</label>
|
164 |
+
<frontend_type>text</frontend_type>
|
165 |
+
<sort_order>700</sort_order>
|
166 |
+
<show_in_default>1</show_in_default>
|
167 |
+
<show_in_website>1</show_in_website>
|
168 |
+
<show_in_store>1</show_in_store>
|
169 |
+
</sort_order>
|
170 |
+
</fields>
|
171 |
+
</ingpsp_ideal>
|
172 |
+
<ingpsp_banktransfer translate="label comment" module="ingpsp">
|
173 |
+
<label>ING PSP - Banktransfer</label>
|
174 |
+
<expanded>0</expanded>
|
175 |
+
<sort_order>118</sort_order>
|
176 |
+
<frontend_type>text</frontend_type>
|
177 |
+
<show_in_default>1</show_in_default>
|
178 |
+
<show_in_website>1</show_in_website>
|
179 |
+
<show_in_store>1</show_in_store>
|
180 |
+
<fields>
|
181 |
+
<active translate="label">
|
182 |
+
<label>Enabled</label>
|
183 |
+
<frontend_type>select</frontend_type>
|
184 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
185 |
+
<sort_order>100</sort_order>
|
186 |
+
<show_in_default>1</show_in_default>
|
187 |
+
<show_in_website>1</show_in_website>
|
188 |
+
<show_in_store>0</show_in_store>
|
189 |
+
</active>
|
190 |
+
<title translate="label">
|
191 |
+
<label>Title</label>
|
192 |
+
<frontend_type>text</frontend_type>
|
193 |
+
<sort_order>150</sort_order>
|
194 |
+
<show_in_default>1</show_in_default>
|
195 |
+
<show_in_website>1</show_in_website>
|
196 |
+
<show_in_store>1</show_in_store>
|
197 |
+
<validate>required-entry</validate>
|
198 |
+
</title>
|
199 |
+
<description translate="label">
|
200 |
+
<label>Description</label>
|
201 |
+
<frontend_type>text</frontend_type>
|
202 |
+
<sort_order>200</sort_order>
|
203 |
+
<show_in_default>1</show_in_default>
|
204 |
+
<show_in_website>1</show_in_website>
|
205 |
+
<show_in_store>1</show_in_store>
|
206 |
+
<validate>required-entry</validate>
|
207 |
+
</description>
|
208 |
+
<specificcountry translate="label">
|
209 |
+
<label>Payment from Specific Countries</label>
|
210 |
+
<sort_order>300</sort_order>
|
211 |
+
<frontend_type>multiselect</frontend_type>
|
212 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
213 |
+
<can_be_empty>1</can_be_empty>
|
214 |
+
<show_in_default>1</show_in_default>
|
215 |
+
<show_in_website>1</show_in_website>
|
216 |
+
<show_in_store>1</show_in_store>
|
217 |
+
</specificcountry>
|
218 |
+
<send_order_mail translate="label">
|
219 |
+
<label>Send order mail</label>
|
220 |
+
<sort_order>400</sort_order>
|
221 |
+
<frontend_type>select</frontend_type>
|
222 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
223 |
+
<show_in_default>1</show_in_default>
|
224 |
+
<show_in_website>1</show_in_website>
|
225 |
+
<show_in_store>1</show_in_store>
|
226 |
+
</send_order_mail>
|
227 |
+
<generate_invoice_upon_completion translate="label">
|
228 |
+
<label>Generate invoice upon succesfull transaction</label>
|
229 |
+
<sort_order>500</sort_order>
|
230 |
+
<frontend_type>select</frontend_type>
|
231 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
232 |
+
<show_in_default>1</show_in_default>
|
233 |
+
<show_in_website>1</show_in_website>
|
234 |
+
<show_in_store>1</show_in_store>
|
235 |
+
</generate_invoice_upon_completion>
|
236 |
+
<send_invoice_mail translate="label">
|
237 |
+
<label>Send invoice mail</label>
|
238 |
+
<sort_order>600</sort_order>
|
239 |
+
<frontend_type>select</frontend_type>
|
240 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
241 |
+
<show_in_default>1</show_in_default>
|
242 |
+
<show_in_website>1</show_in_website>
|
243 |
+
<show_in_store>1</show_in_store>
|
244 |
+
<depends>
|
245 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
246 |
+
</depends>
|
247 |
+
</send_invoice_mail>
|
248 |
+
<sort_order translate="label">
|
249 |
+
<label>Sort order</label>
|
250 |
+
<frontend_type>text</frontend_type>
|
251 |
+
<sort_order>700</sort_order>
|
252 |
+
<show_in_default>1</show_in_default>
|
253 |
+
<show_in_website>1</show_in_website>
|
254 |
+
<show_in_store>1</show_in_store>
|
255 |
+
</sort_order>
|
256 |
+
</fields>
|
257 |
+
</ingpsp_banktransfer>
|
258 |
+
<ingpsp_creditcard translate="label comment" module="ingpsp">
|
259 |
+
<label>ING PSP - Mastercard, VISA, Maestro of V PAY</label>
|
260 |
+
<expanded>0</expanded>
|
261 |
+
<sort_order>119</sort_order>
|
262 |
+
<frontend_type>text</frontend_type>
|
263 |
+
<show_in_default>1</show_in_default>
|
264 |
+
<show_in_website>1</show_in_website>
|
265 |
+
<show_in_store>1</show_in_store>
|
266 |
+
<fields>
|
267 |
+
<active translate="label">
|
268 |
+
<label>Enabled</label>
|
269 |
+
<frontend_type>select</frontend_type>
|
270 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
271 |
+
<sort_order>100</sort_order>
|
272 |
+
<show_in_default>1</show_in_default>
|
273 |
+
<show_in_website>1</show_in_website>
|
274 |
+
<show_in_store>0</show_in_store>
|
275 |
+
</active>
|
276 |
+
<title translate="label">
|
277 |
+
<label>Title</label>
|
278 |
+
<frontend_type>text</frontend_type>
|
279 |
+
<sort_order>150</sort_order>
|
280 |
+
<show_in_default>1</show_in_default>
|
281 |
+
<show_in_website>1</show_in_website>
|
282 |
+
<show_in_store>1</show_in_store>
|
283 |
+
<validate>required-entry</validate>
|
284 |
+
</title>
|
285 |
+
<description translate="label">
|
286 |
+
<label>Description</label>
|
287 |
+
<frontend_type>text</frontend_type>
|
288 |
+
<sort_order>200</sort_order>
|
289 |
+
<show_in_default>1</show_in_default>
|
290 |
+
<show_in_website>1</show_in_website>
|
291 |
+
<show_in_store>1</show_in_store>
|
292 |
+
<validate>required-entry</validate>
|
293 |
+
</description>
|
294 |
+
<specificcountry translate="label">
|
295 |
+
<label>Payment from Specific Countries</label>
|
296 |
+
<sort_order>300</sort_order>
|
297 |
+
<frontend_type>multiselect</frontend_type>
|
298 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
299 |
+
<can_be_empty>1</can_be_empty>
|
300 |
+
<show_in_default>1</show_in_default>
|
301 |
+
<show_in_website>1</show_in_website>
|
302 |
+
<show_in_store>1</show_in_store>
|
303 |
+
</specificcountry>
|
304 |
+
<send_order_mail translate="label">
|
305 |
+
<label>Send order mail</label>
|
306 |
+
<sort_order>400</sort_order>
|
307 |
+
<frontend_type>select</frontend_type>
|
308 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
309 |
+
<show_in_default>1</show_in_default>
|
310 |
+
<show_in_website>1</show_in_website>
|
311 |
+
<show_in_store>1</show_in_store>
|
312 |
+
</send_order_mail>
|
313 |
+
<generate_invoice_upon_completion translate="label">
|
314 |
+
<label>Generate invoice upon succesfull transaction</label>
|
315 |
+
<sort_order>500</sort_order>
|
316 |
+
<frontend_type>select</frontend_type>
|
317 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
318 |
+
<show_in_default>1</show_in_default>
|
319 |
+
<show_in_website>1</show_in_website>
|
320 |
+
<show_in_store>1</show_in_store>
|
321 |
+
</generate_invoice_upon_completion>
|
322 |
+
<send_invoice_mail translate="label">
|
323 |
+
<label>Send invoice mail</label>
|
324 |
+
<sort_order>600</sort_order>
|
325 |
+
<frontend_type>select</frontend_type>
|
326 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
327 |
+
<show_in_default>1</show_in_default>
|
328 |
+
<show_in_website>1</show_in_website>
|
329 |
+
<show_in_store>1</show_in_store>
|
330 |
+
<depends>
|
331 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
332 |
+
</depends>
|
333 |
+
</send_invoice_mail>
|
334 |
+
<sort_order translate="label">
|
335 |
+
<label>Sort order</label>
|
336 |
+
<frontend_type>text</frontend_type>
|
337 |
+
<sort_order>700</sort_order>
|
338 |
+
<show_in_default>1</show_in_default>
|
339 |
+
<show_in_website>1</show_in_website>
|
340 |
+
<show_in_store>1</show_in_store>
|
341 |
+
</sort_order>
|
342 |
+
</fields>
|
343 |
+
</ingpsp_creditcard>
|
344 |
+
<ingpsp_cashondelivery translate="label comment" module="ingpsp">
|
345 |
+
<label>ING PSP - Cashondelivery</label>
|
346 |
+
<expanded>0</expanded>
|
347 |
+
<sort_order>120</sort_order>
|
348 |
+
<frontend_type>text</frontend_type>
|
349 |
+
<show_in_default>1</show_in_default>
|
350 |
+
<show_in_website>1</show_in_website>
|
351 |
+
<show_in_store>1</show_in_store>
|
352 |
+
<fields>
|
353 |
+
<active translate="label">
|
354 |
+
<label>Enabled</label>
|
355 |
+
<frontend_type>select</frontend_type>
|
356 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
357 |
+
<sort_order>100</sort_order>
|
358 |
+
<show_in_default>1</show_in_default>
|
359 |
+
<show_in_website>1</show_in_website>
|
360 |
+
<show_in_store>0</show_in_store>
|
361 |
+
</active>
|
362 |
+
<title translate="label">
|
363 |
+
<label>Title</label>
|
364 |
+
<frontend_type>text</frontend_type>
|
365 |
+
<sort_order>150</sort_order>
|
366 |
+
<show_in_default>1</show_in_default>
|
367 |
+
<show_in_website>1</show_in_website>
|
368 |
+
<show_in_store>1</show_in_store>
|
369 |
+
<validate>required-entry</validate>
|
370 |
+
</title>
|
371 |
+
<description translate="label">
|
372 |
+
<label>Description</label>
|
373 |
+
<frontend_type>text</frontend_type>
|
374 |
+
<sort_order>200</sort_order>
|
375 |
+
<show_in_default>1</show_in_default>
|
376 |
+
<show_in_website>1</show_in_website>
|
377 |
+
<show_in_store>1</show_in_store>
|
378 |
+
<validate>required-entry</validate>
|
379 |
+
</description>
|
380 |
+
<specificcountry translate="label">
|
381 |
+
<label>Payment from Specific Countries</label>
|
382 |
+
<sort_order>300</sort_order>
|
383 |
+
<frontend_type>multiselect</frontend_type>
|
384 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
385 |
+
<can_be_empty>1</can_be_empty>
|
386 |
+
<show_in_default>1</show_in_default>
|
387 |
+
<show_in_website>1</show_in_website>
|
388 |
+
<show_in_store>1</show_in_store>
|
389 |
+
</specificcountry>
|
390 |
+
<send_order_mail translate="label">
|
391 |
+
<label>Send order mail</label>
|
392 |
+
<sort_order>400</sort_order>
|
393 |
+
<frontend_type>select</frontend_type>
|
394 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
395 |
+
<show_in_default>1</show_in_default>
|
396 |
+
<show_in_website>1</show_in_website>
|
397 |
+
<show_in_store>1</show_in_store>
|
398 |
+
</send_order_mail>
|
399 |
+
<generate_invoice_upon_completion translate="label">
|
400 |
+
<label>Generate invoice upon succesfull transaction</label>
|
401 |
+
<sort_order>500</sort_order>
|
402 |
+
<frontend_type>select</frontend_type>
|
403 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
404 |
+
<show_in_default>1</show_in_default>
|
405 |
+
<show_in_website>1</show_in_website>
|
406 |
+
<show_in_store>1</show_in_store>
|
407 |
+
</generate_invoice_upon_completion>
|
408 |
+
<send_invoice_mail translate="label">
|
409 |
+
<label>Send invoice mail</label>
|
410 |
+
<sort_order>600</sort_order>
|
411 |
+
<frontend_type>select</frontend_type>
|
412 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
413 |
+
<show_in_default>1</show_in_default>
|
414 |
+
<show_in_website>1</show_in_website>
|
415 |
+
<show_in_store>1</show_in_store>
|
416 |
+
<depends>
|
417 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
418 |
+
</depends>
|
419 |
+
</send_invoice_mail>
|
420 |
+
<sort_order translate="label">
|
421 |
+
<label>Sort order</label>
|
422 |
+
<frontend_type>text</frontend_type>
|
423 |
+
<sort_order>700</sort_order>
|
424 |
+
<show_in_default>1</show_in_default>
|
425 |
+
<show_in_website>1</show_in_website>
|
426 |
+
<show_in_store>1</show_in_store>
|
427 |
+
</sort_order>
|
428 |
+
</fields>
|
429 |
+
</ingpsp_cashondelivery>
|
430 |
+
<ingpsp_bancontact translate="label comment" module="ingpsp">
|
431 |
+
<label>ING PSP - Bancontact</label>
|
432 |
+
<expanded>0</expanded>
|
433 |
+
<sort_order>121</sort_order>
|
434 |
+
<frontend_type>text</frontend_type>
|
435 |
+
<show_in_default>1</show_in_default>
|
436 |
+
<show_in_website>1</show_in_website>
|
437 |
+
<show_in_store>1</show_in_store>
|
438 |
+
<fields>
|
439 |
+
<active translate="label">
|
440 |
+
<label>Enabled</label>
|
441 |
+
<frontend_type>select</frontend_type>
|
442 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
443 |
+
<sort_order>100</sort_order>
|
444 |
+
<show_in_default>1</show_in_default>
|
445 |
+
<show_in_website>1</show_in_website>
|
446 |
+
<show_in_store>0</show_in_store>
|
447 |
+
</active>
|
448 |
+
<title translate="label">
|
449 |
+
<label>Title</label>
|
450 |
+
<frontend_type>text</frontend_type>
|
451 |
+
<sort_order>150</sort_order>
|
452 |
+
<show_in_default>1</show_in_default>
|
453 |
+
<show_in_website>1</show_in_website>
|
454 |
+
<show_in_store>1</show_in_store>
|
455 |
+
<validate>required-entry</validate>
|
456 |
+
</title>
|
457 |
+
<description translate="label">
|
458 |
+
<label>Description</label>
|
459 |
+
<frontend_type>text</frontend_type>
|
460 |
+
<sort_order>200</sort_order>
|
461 |
+
<show_in_default>1</show_in_default>
|
462 |
+
<show_in_website>1</show_in_website>
|
463 |
+
<show_in_store>1</show_in_store>
|
464 |
+
<validate>required-entry</validate>
|
465 |
+
</description>
|
466 |
+
<specificcountry translate="label">
|
467 |
+
<label>Payment from Specific Countries</label>
|
468 |
+
<sort_order>300</sort_order>
|
469 |
+
<frontend_type>multiselect</frontend_type>
|
470 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
471 |
+
<can_be_empty>1</can_be_empty>
|
472 |
+
<show_in_default>1</show_in_default>
|
473 |
+
<show_in_website>1</show_in_website>
|
474 |
+
<show_in_store>1</show_in_store>
|
475 |
+
</specificcountry>
|
476 |
+
<send_order_mail translate="label">
|
477 |
+
<label>Send order mail</label>
|
478 |
+
<sort_order>400</sort_order>
|
479 |
+
<frontend_type>select</frontend_type>
|
480 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
481 |
+
<show_in_default>1</show_in_default>
|
482 |
+
<show_in_website>1</show_in_website>
|
483 |
+
<show_in_store>1</show_in_store>
|
484 |
+
</send_order_mail>
|
485 |
+
<generate_invoice_upon_completion translate="label">
|
486 |
+
<label>Generate invoice upon succesfull transaction</label>
|
487 |
+
<sort_order>500</sort_order>
|
488 |
+
<frontend_type>select</frontend_type>
|
489 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
490 |
+
<show_in_default>1</show_in_default>
|
491 |
+
<show_in_website>1</show_in_website>
|
492 |
+
<show_in_store>1</show_in_store>
|
493 |
+
</generate_invoice_upon_completion>
|
494 |
+
<send_invoice_mail translate="label">
|
495 |
+
<label>Send invoice mail</label>
|
496 |
+
<sort_order>600</sort_order>
|
497 |
+
<frontend_type>select</frontend_type>
|
498 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
499 |
+
<show_in_default>1</show_in_default>
|
500 |
+
<show_in_website>1</show_in_website>
|
501 |
+
<show_in_store>1</show_in_store>
|
502 |
+
<depends>
|
503 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
504 |
+
</depends>
|
505 |
+
</send_invoice_mail>
|
506 |
+
<sort_order translate="label">
|
507 |
+
<label>Sort order</label>
|
508 |
+
<frontend_type>text</frontend_type>
|
509 |
+
<sort_order>700</sort_order>
|
510 |
+
<show_in_default>1</show_in_default>
|
511 |
+
<show_in_website>1</show_in_website>
|
512 |
+
<show_in_store>1</show_in_store>
|
513 |
+
</sort_order>
|
514 |
+
</fields>
|
515 |
+
</ingpsp_bancontact>
|
516 |
+
<ingpsp_paypal translate="label comment" module="ingpsp">
|
517 |
+
<label>ING PSP - PayPal</label>
|
518 |
+
<expanded>0</expanded>
|
519 |
+
<sort_order>122</sort_order>
|
520 |
+
<frontend_type>text</frontend_type>
|
521 |
+
<show_in_default>1</show_in_default>
|
522 |
+
<show_in_website>1</show_in_website>
|
523 |
+
<show_in_store>1</show_in_store>
|
524 |
+
<fields>
|
525 |
+
<active translate="label">
|
526 |
+
<label>Enabled</label>
|
527 |
+
<frontend_type>select</frontend_type>
|
528 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
529 |
+
<sort_order>100</sort_order>
|
530 |
+
<show_in_default>1</show_in_default>
|
531 |
+
<show_in_website>1</show_in_website>
|
532 |
+
<show_in_store>0</show_in_store>
|
533 |
+
</active>
|
534 |
+
<title translate="label">
|
535 |
+
<label>Title</label>
|
536 |
+
<frontend_type>text</frontend_type>
|
537 |
+
<sort_order>150</sort_order>
|
538 |
+
<show_in_default>1</show_in_default>
|
539 |
+
<show_in_website>1</show_in_website>
|
540 |
+
<show_in_store>1</show_in_store>
|
541 |
+
<validate>required-entry</validate>
|
542 |
+
</title>
|
543 |
+
<description translate="label">
|
544 |
+
<label>Description</label>
|
545 |
+
<frontend_type>text</frontend_type>
|
546 |
+
<sort_order>200</sort_order>
|
547 |
+
<show_in_default>1</show_in_default>
|
548 |
+
<show_in_website>1</show_in_website>
|
549 |
+
<show_in_store>1</show_in_store>
|
550 |
+
<validate>required-entry</validate>
|
551 |
+
</description>
|
552 |
+
<specificcountry translate="label">
|
553 |
+
<label>Payment from Specific Countries</label>
|
554 |
+
<sort_order>300</sort_order>
|
555 |
+
<frontend_type>multiselect</frontend_type>
|
556 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
557 |
+
<can_be_empty>1</can_be_empty>
|
558 |
+
<show_in_default>1</show_in_default>
|
559 |
+
<show_in_website>1</show_in_website>
|
560 |
+
<show_in_store>1</show_in_store>
|
561 |
+
</specificcountry>
|
562 |
+
<send_order_mail translate="label">
|
563 |
+
<label>Send order mail</label>
|
564 |
+
<sort_order>400</sort_order>
|
565 |
+
<frontend_type>select</frontend_type>
|
566 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
567 |
+
<show_in_default>1</show_in_default>
|
568 |
+
<show_in_website>1</show_in_website>
|
569 |
+
<show_in_store>1</show_in_store>
|
570 |
+
</send_order_mail>
|
571 |
+
<generate_invoice_upon_completion translate="label">
|
572 |
+
<label>Generate invoice upon succesfull transaction</label>
|
573 |
+
<sort_order>500</sort_order>
|
574 |
+
<frontend_type>select</frontend_type>
|
575 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
576 |
+
<show_in_default>1</show_in_default>
|
577 |
+
<show_in_website>1</show_in_website>
|
578 |
+
<show_in_store>1</show_in_store>
|
579 |
+
</generate_invoice_upon_completion>
|
580 |
+
<send_invoice_mail translate="label">
|
581 |
+
<label>Send invoice mail</label>
|
582 |
+
<sort_order>600</sort_order>
|
583 |
+
<frontend_type>select</frontend_type>
|
584 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
585 |
+
<show_in_default>1</show_in_default>
|
586 |
+
<show_in_website>1</show_in_website>
|
587 |
+
<show_in_store>1</show_in_store>
|
588 |
+
<depends>
|
589 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
590 |
+
</depends>
|
591 |
+
</send_invoice_mail>
|
592 |
+
<sort_order translate="label">
|
593 |
+
<label>Sort order</label>
|
594 |
+
<frontend_type>text</frontend_type>
|
595 |
+
<sort_order>700</sort_order>
|
596 |
+
<show_in_default>1</show_in_default>
|
597 |
+
<show_in_website>1</show_in_website>
|
598 |
+
<show_in_store>1</show_in_store>
|
599 |
+
</sort_order>
|
600 |
+
</fields>
|
601 |
+
</ingpsp_paypal>
|
602 |
+
<ingpsp_klarna translate="label comment" module="ingpsp">
|
603 |
+
<label>ING PSP - Klarna</label>
|
604 |
+
<expanded>0</expanded>
|
605 |
+
<sort_order>123</sort_order>
|
606 |
+
<frontend_type>text</frontend_type>
|
607 |
+
<show_in_default>1</show_in_default>
|
608 |
+
<show_in_website>1</show_in_website>
|
609 |
+
<show_in_store>1</show_in_store>
|
610 |
+
<fields>
|
611 |
+
<active translate="label">
|
612 |
+
<label>Enabled</label>
|
613 |
+
<frontend_type>select</frontend_type>
|
614 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
615 |
+
<sort_order>100</sort_order>
|
616 |
+
<show_in_default>1</show_in_default>
|
617 |
+
<show_in_website>1</show_in_website>
|
618 |
+
<show_in_store>0</show_in_store>
|
619 |
+
</active>
|
620 |
+
<title translate="label">
|
621 |
+
<label>Title</label>
|
622 |
+
<frontend_type>text</frontend_type>
|
623 |
+
<sort_order>150</sort_order>
|
624 |
+
<show_in_default>1</show_in_default>
|
625 |
+
<show_in_website>1</show_in_website>
|
626 |
+
<show_in_store>1</show_in_store>
|
627 |
+
<validate>required-entry</validate>
|
628 |
+
</title>
|
629 |
+
<description translate="label">
|
630 |
+
<label>Description</label>
|
631 |
+
<frontend_type>text</frontend_type>
|
632 |
+
<sort_order>200</sort_order>
|
633 |
+
<show_in_default>1</show_in_default>
|
634 |
+
<show_in_website>1</show_in_website>
|
635 |
+
<show_in_store>1</show_in_store>
|
636 |
+
<validate>required-entry</validate>
|
637 |
+
</description>
|
638 |
+
<specificcountry translate="label">
|
639 |
+
<label>Payment from Specific Countries</label>
|
640 |
+
<sort_order>300</sort_order>
|
641 |
+
<frontend_type>multiselect</frontend_type>
|
642 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
643 |
+
<can_be_empty>1</can_be_empty>
|
644 |
+
<show_in_default>1</show_in_default>
|
645 |
+
<show_in_website>1</show_in_website>
|
646 |
+
<show_in_store>1</show_in_store>
|
647 |
+
</specificcountry>
|
648 |
+
<send_order_mail translate="label">
|
649 |
+
<label>Send order mail</label>
|
650 |
+
<sort_order>400</sort_order>
|
651 |
+
<frontend_type>select</frontend_type>
|
652 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
653 |
+
<show_in_default>1</show_in_default>
|
654 |
+
<show_in_website>1</show_in_website>
|
655 |
+
<show_in_store>1</show_in_store>
|
656 |
+
</send_order_mail>
|
657 |
+
<generate_invoice_upon_completion translate="label">
|
658 |
+
<label>Generate invoice upon succesfull transaction</label>
|
659 |
+
<sort_order>500</sort_order>
|
660 |
+
<frontend_type>select</frontend_type>
|
661 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
662 |
+
<show_in_default>1</show_in_default>
|
663 |
+
<show_in_website>1</show_in_website>
|
664 |
+
<show_in_store>1</show_in_store>
|
665 |
+
</generate_invoice_upon_completion>
|
666 |
+
<send_invoice_mail translate="label">
|
667 |
+
<label>Send invoice mail</label>
|
668 |
+
<sort_order>600</sort_order>
|
669 |
+
<frontend_type>select</frontend_type>
|
670 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
671 |
+
<show_in_default>1</show_in_default>
|
672 |
+
<show_in_website>1</show_in_website>
|
673 |
+
<show_in_store>1</show_in_store>
|
674 |
+
<depends>
|
675 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
676 |
+
</depends>
|
677 |
+
</send_invoice_mail>
|
678 |
+
<sort_order translate="label">
|
679 |
+
<label>Sort order</label>
|
680 |
+
<frontend_type>text</frontend_type>
|
681 |
+
<sort_order>700</sort_order>
|
682 |
+
<show_in_default>1</show_in_default>
|
683 |
+
<show_in_website>1</show_in_website>
|
684 |
+
<show_in_store>1</show_in_store>
|
685 |
+
</sort_order>
|
686 |
+
|
687 |
+
<ip_filter>
|
688 |
+
<label>IP Filtering</label>
|
689 |
+
<frontend_type>text</frontend_type>
|
690 |
+
<sort_order>800</sort_order>
|
691 |
+
<show_in_default>1</show_in_default>
|
692 |
+
<show_in_website>1</show_in_website>
|
693 |
+
<show_in_store>1</show_in_store>
|
694 |
+
<comment>Example: 127.0.0.1, 255.255.255.255</comment>
|
695 |
+
</ip_filter>
|
696 |
+
|
697 |
+
</fields>
|
698 |
+
</ingpsp_klarna>
|
699 |
+
<ingpsp_sofort translate="label comment" module="ingpsp">
|
700 |
+
<label>ING PSP - SOFORT</label>
|
701 |
+
<expanded>0</expanded>
|
702 |
+
<sort_order>123</sort_order>
|
703 |
+
<frontend_type>text</frontend_type>
|
704 |
+
<show_in_default>1</show_in_default>
|
705 |
+
<show_in_website>1</show_in_website>
|
706 |
+
<show_in_store>1</show_in_store>
|
707 |
+
<fields>
|
708 |
+
<active translate="label">
|
709 |
+
<label>Enabled</label>
|
710 |
+
<frontend_type>select</frontend_type>
|
711 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
712 |
+
<sort_order>100</sort_order>
|
713 |
+
<show_in_default>1</show_in_default>
|
714 |
+
<show_in_website>1</show_in_website>
|
715 |
+
<show_in_store>0</show_in_store>
|
716 |
+
</active>
|
717 |
+
<title translate="label">
|
718 |
+
<label>Title</label>
|
719 |
+
<frontend_type>text</frontend_type>
|
720 |
+
<sort_order>150</sort_order>
|
721 |
+
<show_in_default>1</show_in_default>
|
722 |
+
<show_in_website>1</show_in_website>
|
723 |
+
<show_in_store>1</show_in_store>
|
724 |
+
<validate>required-entry</validate>
|
725 |
+
</title>
|
726 |
+
<description translate="label">
|
727 |
+
<label>Description</label>
|
728 |
+
<frontend_type>text</frontend_type>
|
729 |
+
<sort_order>200</sort_order>
|
730 |
+
<show_in_default>1</show_in_default>
|
731 |
+
<show_in_website>1</show_in_website>
|
732 |
+
<show_in_store>1</show_in_store>
|
733 |
+
<validate>required-entry</validate>
|
734 |
+
</description>
|
735 |
+
<specificcountry translate="label">
|
736 |
+
<label>Payment from Specific Countries</label>
|
737 |
+
<sort_order>300</sort_order>
|
738 |
+
<frontend_type>multiselect</frontend_type>
|
739 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
740 |
+
<can_be_empty>1</can_be_empty>
|
741 |
+
<show_in_default>1</show_in_default>
|
742 |
+
<show_in_website>1</show_in_website>
|
743 |
+
<show_in_store>1</show_in_store>
|
744 |
+
</specificcountry>
|
745 |
+
<send_order_mail translate="label">
|
746 |
+
<label>Send order mail</label>
|
747 |
+
<sort_order>400</sort_order>
|
748 |
+
<frontend_type>select</frontend_type>
|
749 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
750 |
+
<show_in_default>1</show_in_default>
|
751 |
+
<show_in_website>1</show_in_website>
|
752 |
+
<show_in_store>1</show_in_store>
|
753 |
+
</send_order_mail>
|
754 |
+
<generate_invoice_upon_completion translate="label">
|
755 |
+
<label>Generate invoice upon succesfull transaction</label>
|
756 |
+
<sort_order>500</sort_order>
|
757 |
+
<frontend_type>select</frontend_type>
|
758 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
759 |
+
<show_in_default>1</show_in_default>
|
760 |
+
<show_in_website>1</show_in_website>
|
761 |
+
<show_in_store>1</show_in_store>
|
762 |
+
</generate_invoice_upon_completion>
|
763 |
+
<send_invoice_mail translate="label">
|
764 |
+
<label>Send invoice mail</label>
|
765 |
+
<sort_order>600</sort_order>
|
766 |
+
<frontend_type>select</frontend_type>
|
767 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
768 |
+
<show_in_default>1</show_in_default>
|
769 |
+
<show_in_website>1</show_in_website>
|
770 |
+
<show_in_store>1</show_in_store>
|
771 |
+
<depends>
|
772 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
773 |
+
</depends>
|
774 |
+
</send_invoice_mail>
|
775 |
+
<sort_order translate="label">
|
776 |
+
<label>Sort order</label>
|
777 |
+
<frontend_type>text</frontend_type>
|
778 |
+
<sort_order>700</sort_order>
|
779 |
+
<show_in_default>1</show_in_default>
|
780 |
+
<show_in_website>1</show_in_website>
|
781 |
+
<show_in_store>1</show_in_store>
|
782 |
+
</sort_order>
|
783 |
+
</fields>
|
784 |
+
</ingpsp_sofort>
|
785 |
+
<ingpsp_homepay translate="label comment" module="ingpsp">
|
786 |
+
<label>ING PSP - HomePay</label>
|
787 |
+
<expanded>0</expanded>
|
788 |
+
<sort_order>122</sort_order>
|
789 |
+
<frontend_type>text</frontend_type>
|
790 |
+
<show_in_default>1</show_in_default>
|
791 |
+
<show_in_website>1</show_in_website>
|
792 |
+
<show_in_store>1</show_in_store>
|
793 |
+
<fields>
|
794 |
+
<active translate="label">
|
795 |
+
<label>Enabled</label>
|
796 |
+
<frontend_type>select</frontend_type>
|
797 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
798 |
+
<sort_order>100</sort_order>
|
799 |
+
<show_in_default>1</show_in_default>
|
800 |
+
<show_in_website>1</show_in_website>
|
801 |
+
<show_in_store>0</show_in_store>
|
802 |
+
</active>
|
803 |
+
<title translate="label">
|
804 |
+
<label>Title</label>
|
805 |
+
<frontend_type>text</frontend_type>
|
806 |
+
<sort_order>150</sort_order>
|
807 |
+
<show_in_default>1</show_in_default>
|
808 |
+
<show_in_website>1</show_in_website>
|
809 |
+
<show_in_store>1</show_in_store>
|
810 |
+
<validate>required-entry</validate>
|
811 |
+
</title>
|
812 |
+
<description translate="label">
|
813 |
+
<label>Description</label>
|
814 |
+
<frontend_type>text</frontend_type>
|
815 |
+
<sort_order>200</sort_order>
|
816 |
+
<show_in_default>1</show_in_default>
|
817 |
+
<show_in_website>1</show_in_website>
|
818 |
+
<show_in_store>1</show_in_store>
|
819 |
+
<validate>required-entry</validate>
|
820 |
+
</description>
|
821 |
+
<specificcountry translate="label">
|
822 |
+
<label>Payment from Specific Countries</label>
|
823 |
+
<sort_order>300</sort_order>
|
824 |
+
<frontend_type>multiselect</frontend_type>
|
825 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
826 |
+
<can_be_empty>1</can_be_empty>
|
827 |
+
<show_in_default>1</show_in_default>
|
828 |
+
<show_in_website>1</show_in_website>
|
829 |
+
<show_in_store>1</show_in_store>
|
830 |
+
</specificcountry>
|
831 |
+
<send_order_mail translate="label">
|
832 |
+
<label>Send order mail</label>
|
833 |
+
<sort_order>400</sort_order>
|
834 |
+
<frontend_type>select</frontend_type>
|
835 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
836 |
+
<show_in_default>1</show_in_default>
|
837 |
+
<show_in_website>1</show_in_website>
|
838 |
+
<show_in_store>1</show_in_store>
|
839 |
+
</send_order_mail>
|
840 |
+
<generate_invoice_upon_completion translate="label">
|
841 |
+
<label>Generate invoice upon succesfull transaction</label>
|
842 |
+
<sort_order>500</sort_order>
|
843 |
+
<frontend_type>select</frontend_type>
|
844 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
845 |
+
<show_in_default>1</show_in_default>
|
846 |
+
<show_in_website>1</show_in_website>
|
847 |
+
<show_in_store>1</show_in_store>
|
848 |
+
</generate_invoice_upon_completion>
|
849 |
+
<send_invoice_mail translate="label">
|
850 |
+
<label>Send invoice mail</label>
|
851 |
+
<sort_order>600</sort_order>
|
852 |
+
<frontend_type>select</frontend_type>
|
853 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
854 |
+
<show_in_default>1</show_in_default>
|
855 |
+
<show_in_website>1</show_in_website>
|
856 |
+
<show_in_store>1</show_in_store>
|
857 |
+
<depends>
|
858 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
859 |
+
</depends>
|
860 |
+
</send_invoice_mail>
|
861 |
+
<sort_order translate="label">
|
862 |
+
<label>Sort order</label>
|
863 |
+
<frontend_type>text</frontend_type>
|
864 |
+
<sort_order>700</sort_order>
|
865 |
+
<show_in_default>1</show_in_default>
|
866 |
+
<show_in_website>1</show_in_website>
|
867 |
+
<show_in_store>1</show_in_store>
|
868 |
+
</sort_order>
|
869 |
+
</fields>
|
870 |
+
</ingpsp_homepay>
|
871 |
+
</groups>
|
872 |
+
</payment>
|
873 |
+
</sections>
|
874 |
+
</config>
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -2,7 +2,7 @@
|
|
2 |
<!--
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -13,8 +13,8 @@
|
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger B.V. (info@gingerpayments.com)
|
16 |
-
* @version v1.1.
|
17 |
-
* @copyright COPYRIGHT (C)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
2 |
<!--
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
13 |
* @category ING
|
14 |
* @package ING_PSP
|
15 |
* @author Ginger B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.7
|
17 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
* @license The MIT License (MIT)
|
19 |
*
|
20 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
@@ -12,8 +12,8 @@
|
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
-
* @version v1.1.
|
16 |
-
* @copyright COPYRIGHT (C)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
1 |
<?php
|
2 |
/**
|
3 |
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
5 |
* │╭──╮ ╭──╮│
|
6 |
* ││//│ │//││
|
7 |
* │╰──╯ ╰──╯│
|
12 |
* @category ING
|
13 |
* @package ING_PSP
|
14 |
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.7
|
16 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
* @license The MIT License (MIT)
|
18 |
*
|
19 |
**/
|
@@ -2,7 +2,7 @@
|
|
2 |
<!--
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
-
* ╭──────────────╮ COPYRIGHT (C)
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
@@ -14,8 +14,8 @@
|
|
14 |
* @category ING
|
15 |
* @package ING_PSP
|
16 |
* @author Ginger B.V. (info@gingerpayments.com)
|
17 |
-
* @version v1.1.
|
18 |
-
* @copyright COPYRIGHT (C)
|
19 |
* @license The MIT License (MIT)
|
20 |
*
|
21 |
**/
|
@@ -29,7 +29,7 @@
|
|
29 |
<Mage_Payment />
|
30 |
<Mage_Checkout />
|
31 |
</depends>
|
32 |
-
<version>1.1.
|
33 |
</ING_PSP>
|
34 |
</modules>
|
35 |
<global>
|
2 |
<!--
|
3 |
/**
|
4 |
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2017 GINGER PAYMENTS B.V.
|
6 |
* │╭──╮ ╭──╮│
|
7 |
* ││//│ │//││
|
8 |
* │╰──╯ ╰──╯│
|
14 |
* @category ING
|
15 |
* @package ING_PSP
|
16 |
* @author Ginger B.V. (info@gingerpayments.com)
|
17 |
+
* @version v1.1.7
|
18 |
+
* @copyright COPYRIGHT (C) 2017 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
19 |
* @license The MIT License (MIT)
|
20 |
*
|
21 |
**/
|
29 |
<Mage_Payment />
|
30 |
<Mage_Checkout />
|
31 |
</depends>
|
32 |
+
<version>1.1.7</version>
|
33 |
</ING_PSP>
|
34 |
</modules>
|
35 |
<global>
|
@@ -1,15 +1,21 @@
|
|
1 |
{
|
2 |
-
"name": "
|
3 |
-
"description": "The official
|
4 |
"keywords": ["payment", "pay", "merchant", "e-commerce"],
|
5 |
"license": "MIT",
|
6 |
-
"homepage": "https://github.com/
|
7 |
"authors": [
|
8 |
{
|
9 |
"name": "Ginger Payments",
|
10 |
"email": "dev@gingerpayments.com"
|
11 |
}
|
12 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
"require": {
|
14 |
"php": ">=5.4.0",
|
15 |
"guzzlehttp/guzzle": "~5.2",
|
@@ -43,4 +49,4 @@
|
|
43 |
"dev-master": "0.0.x-dev"
|
44 |
}
|
45 |
}
|
46 |
-
}
|
1 |
{
|
2 |
+
"name": "ingpsp/ing-php",
|
3 |
+
"description": "The official ING-PSP PHP SDK",
|
4 |
"keywords": ["payment", "pay", "merchant", "e-commerce"],
|
5 |
"license": "MIT",
|
6 |
+
"homepage": "https://github.com/ingpsp/ing-php",
|
7 |
"authors": [
|
8 |
{
|
9 |
"name": "Ginger Payments",
|
10 |
"email": "dev@gingerpayments.com"
|
11 |
}
|
12 |
],
|
13 |
+
"repositories": [
|
14 |
+
{
|
15 |
+
"type": "vcs",
|
16 |
+
"url": "https://github.com/ingpsp/ing-php"
|
17 |
+
}
|
18 |
+
],
|
19 |
"require": {
|
20 |
"php": ">=5.4.0",
|
21 |
"guzzlehttp/guzzle": "~5.2",
|
49 |
"dev-master": "0.0.x-dev"
|
50 |
}
|
51 |
}
|
52 |
+
}
|
@@ -370,16 +370,16 @@
|
|
370 |
},
|
371 |
{
|
372 |
"name": "paragonie/random_compat",
|
373 |
-
"version": "v2.0.
|
374 |
"source": {
|
375 |
"type": "git",
|
376 |
"url": "https://github.com/paragonie/random_compat.git",
|
377 |
-
"reference": "
|
378 |
},
|
379 |
"dist": {
|
380 |
"type": "zip",
|
381 |
-
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/
|
382 |
-
"reference": "
|
383 |
"shasum": ""
|
384 |
},
|
385 |
"require": {
|
@@ -414,7 +414,7 @@
|
|
414 |
"pseudorandom",
|
415 |
"random"
|
416 |
],
|
417 |
-
"time": "
|
418 |
},
|
419 |
{
|
420 |
"name": "ramsey/uuid",
|
@@ -885,12 +885,12 @@
|
|
885 |
"version": "0.9.5",
|
886 |
"source": {
|
887 |
"type": "git",
|
888 |
-
"url": "https://github.com/
|
889 |
"reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2"
|
890 |
},
|
891 |
"dist": {
|
892 |
"type": "zip",
|
893 |
-
"url": "https://api.github.com/repos/
|
894 |
"reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2",
|
895 |
"shasum": ""
|
896 |
},
|
370 |
},
|
371 |
{
|
372 |
"name": "paragonie/random_compat",
|
373 |
+
"version": "v2.0.10",
|
374 |
"source": {
|
375 |
"type": "git",
|
376 |
"url": "https://github.com/paragonie/random_compat.git",
|
377 |
+
"reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d"
|
378 |
},
|
379 |
"dist": {
|
380 |
"type": "zip",
|
381 |
+
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/634bae8e911eefa89c1abfbf1b66da679ac8f54d",
|
382 |
+
"reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d",
|
383 |
"shasum": ""
|
384 |
},
|
385 |
"require": {
|
414 |
"pseudorandom",
|
415 |
"random"
|
416 |
],
|
417 |
+
"time": "2017-03-13 16:27:32"
|
418 |
},
|
419 |
{
|
420 |
"name": "ramsey/uuid",
|
885 |
"version": "0.9.5",
|
886 |
"source": {
|
887 |
"type": "git",
|
888 |
+
"url": "https://github.com/mockery/mockery.git",
|
889 |
"reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2"
|
890 |
},
|
891 |
"dist": {
|
892 |
"type": "zip",
|
893 |
+
"url": "https://api.github.com/repos/mockery/mockery/zipball/4db079511a283e5aba1b3c2fb19037c645e70fc2",
|
894 |
"reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2",
|
895 |
"shasum": ""
|
896 |
},
|
@@ -88,17 +88,16 @@ final class Client
|
|
88 |
return $result;
|
89 |
}
|
90 |
|
91 |
-
if (array_key_exists('status', $details)
|
92 |
-
&& $details['status'] == 'active-testing') {
|
93 |
-
return array('ideal');
|
94 |
-
}
|
95 |
-
|
96 |
$products_to_check = array(
|
97 |
'ideal' => 'ideal',
|
98 |
'bank-transfer' => 'banktransfer',
|
99 |
'bancontact' => 'bancontact',
|
100 |
'cash-on-delivery' => 'cashondelivery',
|
101 |
'credit-card' => 'creditcard',
|
|
|
|
|
|
|
|
|
102 |
);
|
103 |
|
104 |
foreach ($products_to_check as $permission_id => $id) {
|
@@ -401,6 +400,136 @@ final class Client
|
|
401 |
);
|
402 |
}
|
403 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
404 |
/**
|
405 |
* Create a new order.
|
406 |
*
|
@@ -495,7 +624,7 @@ final class Client
|
|
495 |
$response = $this->httpClient->post(
|
496 |
'orders/',
|
497 |
[
|
498 |
-
'timeout' =>
|
499 |
'headers' => ['Content-Type' => 'application/json'],
|
500 |
'body' => json_encode(
|
501 |
ArrayFunctions::withoutNullValues($order->toArray())
|
@@ -525,7 +654,7 @@ final class Client
|
|
525 |
$this->httpClient->put(
|
526 |
"orders/".$order->id()."/",
|
527 |
[
|
528 |
-
"timeout" =>
|
529 |
"json" => ArrayFunctions::withoutNullValues($order->toArray())
|
530 |
]
|
531 |
)->json()
|
88 |
return $result;
|
89 |
}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
91 |
$products_to_check = array(
|
92 |
'ideal' => 'ideal',
|
93 |
'bank-transfer' => 'banktransfer',
|
94 |
'bancontact' => 'bancontact',
|
95 |
'cash-on-delivery' => 'cashondelivery',
|
96 |
'credit-card' => 'creditcard',
|
97 |
+
'paypal' => 'paypal',
|
98 |
+
'homepay' => 'homepay',
|
99 |
+
'klarna' => 'klarna',
|
100 |
+
'sofort' => 'sofort'
|
101 |
);
|
102 |
|
103 |
foreach ($products_to_check as $permission_id => $id) {
|
400 |
);
|
401 |
}
|
402 |
|
403 |
+
/**
|
404 |
+
* Create a new Klarna order.
|
405 |
+
*
|
406 |
+
* @param integer $amount Amount in cents.
|
407 |
+
* @param string $currency A valid currency code.
|
408 |
+
* @param string $description A description of the order.
|
409 |
+
* @param string $merchantOrderId A merchant-defined order identifier.
|
410 |
+
* @param string $returnUrl The return URL.
|
411 |
+
* @param string $expirationPeriod The expiration period as an ISO 8601 duration
|
412 |
+
* @param array $customer Customer information.
|
413 |
+
* @param array $extra Extra information.
|
414 |
+
* @param string $webhookUrl The webhook URL.
|
415 |
+
* @param array $orderLines Order lines
|
416 |
+
*
|
417 |
+
* @return Order The newly created order.
|
418 |
+
*/
|
419 |
+
public function createKlarnaOrder(
|
420 |
+
$amount,
|
421 |
+
$currency,
|
422 |
+
$description = null,
|
423 |
+
$merchantOrderId = null,
|
424 |
+
$returnUrl = null,
|
425 |
+
$expirationPeriod = null,
|
426 |
+
$customer = null,
|
427 |
+
$extra = null,
|
428 |
+
$webhookUrl = null,
|
429 |
+
$orderLines = null
|
430 |
+
) {
|
431 |
+
return $this->postOrder(
|
432 |
+
Order::createWithKlarna(
|
433 |
+
$amount,
|
434 |
+
$currency,
|
435 |
+
$description,
|
436 |
+
$merchantOrderId,
|
437 |
+
$returnUrl,
|
438 |
+
$expirationPeriod,
|
439 |
+
$customer,
|
440 |
+
$extra,
|
441 |
+
$webhookUrl,
|
442 |
+
$orderLines
|
443 |
+
)
|
444 |
+
);
|
445 |
+
}
|
446 |
+
|
447 |
+
/**
|
448 |
+
* Create a new PayPal order.
|
449 |
+
*
|
450 |
+
* @param integer $amount Amount in cents.
|
451 |
+
* @param string $currency A valid currency code.
|
452 |
+
* @param array $paymentMethodDetails An array of extra payment method details.
|
453 |
+
* @param string $description A description of the order.
|
454 |
+
* @param string $merchantOrderId A merchant-defined order identifier.
|
455 |
+
* @param string $returnUrl The return URL.
|
456 |
+
* @param string $expirationPeriod The expiration period as an ISO 8601 duration
|
457 |
+
* @param array $customer Customer information.
|
458 |
+
* @param array $extra Extra information.
|
459 |
+
*
|
460 |
+
* @return Order The newly created order.
|
461 |
+
*/
|
462 |
+
public function createPaypalOrder(
|
463 |
+
$amount,
|
464 |
+
$currency,
|
465 |
+
array $paymentMethodDetails = [],
|
466 |
+
$description = null,
|
467 |
+
$merchantOrderId = null,
|
468 |
+
$returnUrl = null,
|
469 |
+
$expirationPeriod = null,
|
470 |
+
$customer = null,
|
471 |
+
$extra = null,
|
472 |
+
$webhookUrl = null
|
473 |
+
) {
|
474 |
+
return $this->postOrder(
|
475 |
+
Order::createWithPaypal(
|
476 |
+
$amount,
|
477 |
+
$currency,
|
478 |
+
$paymentMethodDetails,
|
479 |
+
$description,
|
480 |
+
$merchantOrderId,
|
481 |
+
$returnUrl,
|
482 |
+
$expirationPeriod,
|
483 |
+
$customer,
|
484 |
+
$extra,
|
485 |
+
$webhookUrl
|
486 |
+
)
|
487 |
+
);
|
488 |
+
}
|
489 |
+
|
490 |
+
/**
|
491 |
+
* Create a new Home'Pay order.
|
492 |
+
*
|
493 |
+
* @param integer $amount Amount in cents.
|
494 |
+
* @param string $currency A valid currency code.
|
495 |
+
* @param array $paymentMethodDetails An array of extra payment method details.
|
496 |
+
* @param string $description A description of the order.
|
497 |
+
* @param string $merchantOrderId A merchant-defined order identifier.
|
498 |
+
* @param string $returnUrl The return URL.
|
499 |
+
* @param string $expirationPeriod The expiration period as an ISO 8601 duration
|
500 |
+
* @param array $customer Customer information.
|
501 |
+
* @param array $extra Extra information.
|
502 |
+
*
|
503 |
+
* @return Order The newly created order.
|
504 |
+
*/
|
505 |
+
public function createHomepayOrder(
|
506 |
+
$amount,
|
507 |
+
$currency,
|
508 |
+
array $paymentMethodDetails = [],
|
509 |
+
$description = null,
|
510 |
+
$merchantOrderId = null,
|
511 |
+
$returnUrl = null,
|
512 |
+
$expirationPeriod = null,
|
513 |
+
$customer = null,
|
514 |
+
$extra = null,
|
515 |
+
$webhookUrl = null
|
516 |
+
) {
|
517 |
+
return $this->postOrder(
|
518 |
+
Order::createWithHomepay(
|
519 |
+
$amount,
|
520 |
+
$currency,
|
521 |
+
$paymentMethodDetails,
|
522 |
+
$description,
|
523 |
+
$merchantOrderId,
|
524 |
+
$returnUrl,
|
525 |
+
$expirationPeriod,
|
526 |
+
$customer,
|
527 |
+
$extra,
|
528 |
+
$webhookUrl
|
529 |
+
)
|
530 |
+
);
|
531 |
+
}
|
532 |
+
|
533 |
/**
|
534 |
* Create a new order.
|
535 |
*
|
624 |
$response = $this->httpClient->post(
|
625 |
'orders/',
|
626 |
[
|
627 |
+
'timeout' => 30,
|
628 |
'headers' => ['Content-Type' => 'application/json'],
|
629 |
'body' => json_encode(
|
630 |
ArrayFunctions::withoutNullValues($order->toArray())
|
654 |
$this->httpClient->put(
|
655 |
"orders/".$order->id()."/",
|
656 |
[
|
657 |
+
"timeout" => 30,
|
658 |
"json" => ArrayFunctions::withoutNullValues($order->toArray())
|
659 |
]
|
660 |
)->json()
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Common;
|
4 |
+
|
5 |
+
trait IntegerBasedValueObject
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* @var integer
|
9 |
+
*/
|
10 |
+
private $value;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Factory method. Returns a new instance from an integer.
|
14 |
+
*
|
15 |
+
* @param integer $value
|
16 |
+
* @return static
|
17 |
+
*/
|
18 |
+
public static function fromInteger($value)
|
19 |
+
{
|
20 |
+
return new self((int) $value);
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @return integer
|
25 |
+
*/
|
26 |
+
public function toInteger()
|
27 |
+
{
|
28 |
+
return $this->value;
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* @param integer $value
|
33 |
+
*/
|
34 |
+
private function __construct($value)
|
35 |
+
{
|
36 |
+
$this->value = $value;
|
37 |
+
}
|
38 |
+
}
|
@@ -10,7 +10,7 @@ final class Ginger
|
|
10 |
/**
|
11 |
* The library version.
|
12 |
*/
|
13 |
-
const CLIENT_VERSION = '1.2.
|
14 |
|
15 |
/**
|
16 |
* The API version.
|
@@ -48,7 +48,7 @@ final class Ginger
|
|
48 |
{
|
49 |
Guard::uuid(
|
50 |
static::apiKeyToUuid($apiKey),
|
51 |
-
'
|
52 |
);
|
53 |
|
54 |
return new Client(
|
10 |
/**
|
11 |
* The library version.
|
12 |
*/
|
13 |
+
const CLIENT_VERSION = '1.2.8';
|
14 |
|
15 |
/**
|
16 |
* The API version.
|
48 |
{
|
49 |
Guard::uuid(
|
50 |
static::apiKeyToUuid($apiKey),
|
51 |
+
'ING API key is invalid: '.$apiKey
|
52 |
);
|
53 |
|
54 |
return new Client(
|
@@ -13,6 +13,7 @@ use GingerPayments\Payment\Order\Transactions;
|
|
13 |
use GingerPayments\Payment\Order\Customer;
|
14 |
use GingerPayments\Payment\Order\Extra;
|
15 |
use Rhumsaa\Uuid\Uuid;
|
|
|
16 |
|
17 |
final class Order
|
18 |
{
|
@@ -100,6 +101,11 @@ final class Order
|
|
100 |
*/
|
101 |
private $webhookUrl;
|
102 |
|
|
|
|
|
|
|
|
|
|
|
103 |
/**
|
104 |
* Create a new Order with the iDEAL payment method.
|
105 |
*
|
@@ -352,6 +358,133 @@ final class Order
|
|
352 |
);
|
353 |
}
|
354 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
/**
|
356 |
* Create a new Order.
|
357 |
*
|
@@ -366,6 +499,7 @@ final class Order
|
|
366 |
* @param array $customer Customer information.
|
367 |
* @param array $extra Extra information.
|
368 |
* @param string $webhookUrl The webhook URL.
|
|
|
369 |
*
|
370 |
* @return Order
|
371 |
*/
|
@@ -380,7 +514,8 @@ final class Order
|
|
380 |
$expirationPeriod = null,
|
381 |
$customer = null,
|
382 |
$extra = null,
|
383 |
-
$webhookUrl = null
|
|
|
384 |
) {
|
385 |
return new static(
|
386 |
Transactions::fromArray(
|
@@ -405,7 +540,8 @@ final class Order
|
|
405 |
null,
|
406 |
($customer !== null) ? Customer::fromArray($customer) : null,
|
407 |
($extra !== null) ? Extra::fromArray($extra) : null,
|
408 |
-
($webhookUrl !== null) ? Url::fromString($webhookUrl) : null
|
|
|
409 |
);
|
410 |
}
|
411 |
|
@@ -439,7 +575,9 @@ final class Order
|
|
439 |
? Customer::fromArray($order['customer']) : null,
|
440 |
array_key_exists('extra', $order) && $order['extra'] !== null
|
441 |
? Extra::fromArray($order['extra']) : null,
|
442 |
-
array_key_exists('webhook_url', $order) ? Url::fromString($order['webhook_url']) : null
|
|
|
|
|
443 |
);
|
444 |
}
|
445 |
|
@@ -464,7 +602,8 @@ final class Order
|
|
464 |
'return_url' => $this->getReturnUrl(),
|
465 |
'customer' => $this->getCustomer(),
|
466 |
'extra' => $this->getExtra(),
|
467 |
-
'webhook_url' => $this->getWebhookUrl()
|
|
|
468 |
];
|
469 |
}
|
470 |
|
@@ -600,6 +739,14 @@ final class Order
|
|
600 |
return ($this->extra() !== null) ? $this->extra()->toArray() : null;
|
601 |
}
|
602 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
603 |
/**
|
604 |
* @return Extra|null
|
605 |
*/
|
@@ -748,6 +895,14 @@ final class Order
|
|
748 |
return $this->webhookUrl;
|
749 |
}
|
750 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
751 |
/**
|
752 |
* @return Transactions
|
753 |
*/
|
@@ -773,22 +928,25 @@ final class Order
|
|
773 |
}
|
774 |
|
775 |
/**
|
|
|
|
|
776 |
* @param Transactions $transactions
|
777 |
* @param Amount $amount
|
778 |
* @param Currency $currency
|
779 |
-
* @param Description $description
|
780 |
-
* @param MerchantOrderId $merchantOrderId
|
781 |
-
* @param Url $returnUrl
|
782 |
-
* @param \DateInterval $expirationPeriod
|
783 |
-
* @param Uuid $id
|
784 |
-
* @param Uuid $projectId
|
785 |
-
* @param Carbon $created
|
786 |
-
* @param Carbon $modified
|
787 |
-
* @param Carbon $completed
|
788 |
-
* @param Status $status
|
789 |
-
* @param Customer $customer
|
790 |
-
* @param Extra $extra
|
791 |
-
* @param Url $webhookUrl
|
|
|
792 |
*/
|
793 |
private function __construct(
|
794 |
Transactions $transactions,
|
@@ -806,7 +964,8 @@ final class Order
|
|
806 |
Status $status = null,
|
807 |
Customer $customer = null,
|
808 |
Extra $extra = null,
|
809 |
-
Url $webhookUrl = null
|
|
|
810 |
) {
|
811 |
$this->transactions = $transactions;
|
812 |
$this->amount = $amount;
|
@@ -824,5 +983,6 @@ final class Order
|
|
824 |
$this->customer = $customer;
|
825 |
$this->extra = $extra;
|
826 |
$this->webhookUrl = $webhookUrl;
|
|
|
827 |
}
|
828 |
}
|
13 |
use GingerPayments\Payment\Order\Customer;
|
14 |
use GingerPayments\Payment\Order\Extra;
|
15 |
use Rhumsaa\Uuid\Uuid;
|
16 |
+
use GingerPayments\Payment\Order\OrderLines;
|
17 |
|
18 |
final class Order
|
19 |
{
|
101 |
*/
|
102 |
private $webhookUrl;
|
103 |
|
104 |
+
/**
|
105 |
+
* @var OrderLines|null
|
106 |
+
*/
|
107 |
+
private $orderLines;
|
108 |
+
|
109 |
/**
|
110 |
* Create a new Order with the iDEAL payment method.
|
111 |
*
|
358 |
);
|
359 |
}
|
360 |
|
361 |
+
/**
|
362 |
+
* @param integer $amount Amount in cents.
|
363 |
+
* @param string $currency A valid currency code.
|
364 |
+
* @param string $description A description of the order.
|
365 |
+
* @param string $merchantOrderId A merchant-defined order identifier.
|
366 |
+
* @param string $returnUrl The return URL.
|
367 |
+
* @param string $expirationPeriod The expiration period as an ISO 8601 duration.
|
368 |
+
* @param array $customer Customer information
|
369 |
+
* @param array $extra Extra information.
|
370 |
+
* @param string $webhookUrl The webhook URL.
|
371 |
+
*
|
372 |
+
* @return Order
|
373 |
+
*/
|
374 |
+
public static function createWithKlarna(
|
375 |
+
$amount,
|
376 |
+
$currency,
|
377 |
+
$description = null,
|
378 |
+
$merchantOrderId = null,
|
379 |
+
$returnUrl = null,
|
380 |
+
$expirationPeriod = null,
|
381 |
+
$customer = null,
|
382 |
+
$extra = null,
|
383 |
+
$webhookUrl = null,
|
384 |
+
$orderLines = null
|
385 |
+
) {
|
386 |
+
return static::create(
|
387 |
+
$amount,
|
388 |
+
$currency,
|
389 |
+
PaymentMethod::KLARNA,
|
390 |
+
[],
|
391 |
+
$description,
|
392 |
+
$merchantOrderId,
|
393 |
+
$returnUrl,
|
394 |
+
$expirationPeriod,
|
395 |
+
$customer,
|
396 |
+
$extra,
|
397 |
+
$webhookUrl,
|
398 |
+
$orderLines
|
399 |
+
);
|
400 |
+
}
|
401 |
+
|
402 |
+
/**
|
403 |
+
* Create a new Order with the Paypal payment method.
|
404 |
+
*
|
405 |
+
* @param integer $amount Amount in cents.
|
406 |
+
* @param string $currency A valid currency code.
|
407 |
+
* @param array $paymentMethodDetails An array of extra payment method details.
|
408 |
+
* @param string $description A description of the order.
|
409 |
+
* @param string $merchantOrderId A merchant-defined order identifier.
|
410 |
+
* @param string $returnUrl The return URL.
|
411 |
+
* @param string $expirationPeriod The expiration period as an ISO 8601 duration.
|
412 |
+
* @param array $customer Customer information.
|
413 |
+
* @param array $extra Extra information.
|
414 |
+
* @param string $webhookUrl The webhook URL.
|
415 |
+
*
|
416 |
+
* @return Order
|
417 |
+
*/
|
418 |
+
public static function createWithPaypal(
|
419 |
+
$amount,
|
420 |
+
$currency,
|
421 |
+
array $paymentMethodDetails = [],
|
422 |
+
$description = null,
|
423 |
+
$merchantOrderId = null,
|
424 |
+
$returnUrl = null,
|
425 |
+
$expirationPeriod = null,
|
426 |
+
$customer = null,
|
427 |
+
$extra = null,
|
428 |
+
$webhookUrl = null
|
429 |
+
) {
|
430 |
+
return static::create(
|
431 |
+
$amount,
|
432 |
+
$currency,
|
433 |
+
PaymentMethod::PAYPAL,
|
434 |
+
$paymentMethodDetails,
|
435 |
+
$description,
|
436 |
+
$merchantOrderId,
|
437 |
+
$returnUrl,
|
438 |
+
$expirationPeriod,
|
439 |
+
$customer,
|
440 |
+
$extra,
|
441 |
+
$webhookUrl
|
442 |
+
);
|
443 |
+
}
|
444 |
+
|
445 |
+
/**
|
446 |
+
* Create a new Order with the HomePay payment method.
|
447 |
+
*
|
448 |
+
* @param integer $amount Amount in cents.
|
449 |
+
* @param string $currency A valid currency code.
|
450 |
+
* @param array $paymentMethodDetails An array of extra payment method details.
|
451 |
+
* @param string $description A description of the order.
|
452 |
+
* @param string $merchantOrderId A merchant-defined order identifier.
|
453 |
+
* @param string $returnUrl The return URL.
|
454 |
+
* @param string $expirationPeriod The expiration period as an ISO 8601 duration.
|
455 |
+
* @param array $customer Customer information.
|
456 |
+
* @param array $extra Extra information.
|
457 |
+
* @param string $webhookUrl The webhook URL.
|
458 |
+
*
|
459 |
+
* @return Order
|
460 |
+
*/
|
461 |
+
public static function createWithHomepay(
|
462 |
+
$amount,
|
463 |
+
$currency,
|
464 |
+
array $paymentMethodDetails = [],
|
465 |
+
$description = null,
|
466 |
+
$merchantOrderId = null,
|
467 |
+
$returnUrl = null,
|
468 |
+
$expirationPeriod = null,
|
469 |
+
$customer = null,
|
470 |
+
$extra = null,
|
471 |
+
$webhookUrl = null
|
472 |
+
) {
|
473 |
+
return static::create(
|
474 |
+
$amount,
|
475 |
+
$currency,
|
476 |
+
PaymentMethod::HOMEPAY,
|
477 |
+
$paymentMethodDetails,
|
478 |
+
$description,
|
479 |
+
$merchantOrderId,
|
480 |
+
$returnUrl,
|
481 |
+
$expirationPeriod,
|
482 |
+
$customer,
|
483 |
+
$extra,
|
484 |
+
$webhookUrl
|
485 |
+
);
|
486 |
+
}
|
487 |
+
|
488 |
/**
|
489 |
* Create a new Order.
|
490 |
*
|
499 |
* @param array $customer Customer information.
|
500 |
* @param array $extra Extra information.
|
501 |
* @param string $webhookUrl The webhook URL.
|
502 |
+
* @param array $orderLines Order lines.
|
503 |
*
|
504 |
* @return Order
|
505 |
*/
|
514 |
$expirationPeriod = null,
|
515 |
$customer = null,
|
516 |
$extra = null,
|
517 |
+
$webhookUrl = null,
|
518 |
+
$orderLines = null
|
519 |
) {
|
520 |
return new static(
|
521 |
Transactions::fromArray(
|
540 |
null,
|
541 |
($customer !== null) ? Customer::fromArray($customer) : null,
|
542 |
($extra !== null) ? Extra::fromArray($extra) : null,
|
543 |
+
($webhookUrl !== null) ? Url::fromString($webhookUrl) : null,
|
544 |
+
($orderLines !== null) ? OrderLines::fromArray($orderLines) : null
|
545 |
);
|
546 |
}
|
547 |
|
575 |
? Customer::fromArray($order['customer']) : null,
|
576 |
array_key_exists('extra', $order) && $order['extra'] !== null
|
577 |
? Extra::fromArray($order['extra']) : null,
|
578 |
+
array_key_exists('webhook_url', $order) ? Url::fromString($order['webhook_url']) : null,
|
579 |
+
array_key_exists('order_lines', $order) && $order['order_lines'] !== null
|
580 |
+
? OrderLines::fromArray($order['order_lines']) : null
|
581 |
);
|
582 |
}
|
583 |
|
602 |
'return_url' => $this->getReturnUrl(),
|
603 |
'customer' => $this->getCustomer(),
|
604 |
'extra' => $this->getExtra(),
|
605 |
+
'webhook_url' => $this->getWebhookUrl(),
|
606 |
+
'order_lines' => $this->getOrderLines()
|
607 |
];
|
608 |
}
|
609 |
|
739 |
return ($this->extra() !== null) ? $this->extra()->toArray() : null;
|
740 |
}
|
741 |
|
742 |
+
/**
|
743 |
+
* @return array|null
|
744 |
+
*/
|
745 |
+
public function getOrderLines()
|
746 |
+
{
|
747 |
+
return ($this->orderLines() !== null) ? $this->orderLines()->toArray() : null;
|
748 |
+
}
|
749 |
+
|
750 |
/**
|
751 |
* @return Extra|null
|
752 |
*/
|
895 |
return $this->webhookUrl;
|
896 |
}
|
897 |
|
898 |
+
/**
|
899 |
+
* @return OrderLines|null
|
900 |
+
*/
|
901 |
+
public function orderLines()
|
902 |
+
{
|
903 |
+
return $this->orderLines;
|
904 |
+
}
|
905 |
+
|
906 |
/**
|
907 |
* @return Transactions
|
908 |
*/
|
928 |
}
|
929 |
|
930 |
/**
|
931 |
+
* Order constructor.
|
932 |
+
*
|
933 |
* @param Transactions $transactions
|
934 |
* @param Amount $amount
|
935 |
* @param Currency $currency
|
936 |
+
* @param Description|null $description
|
937 |
+
* @param MerchantOrderId|null $merchantOrderId
|
938 |
+
* @param Url|null $returnUrl
|
939 |
+
* @param \DateInterval|null $expirationPeriod
|
940 |
+
* @param Uuid|null $id
|
941 |
+
* @param Uuid|null $projectId
|
942 |
+
* @param Carbon|null $created
|
943 |
+
* @param Carbon|null $modified
|
944 |
+
* @param Carbon|null $completed
|
945 |
+
* @param Status|null $status
|
946 |
+
* @param Customer|null $customer
|
947 |
+
* @param Extra|null $extra
|
948 |
+
* @param Url|null $webhookUrl
|
949 |
+
* @param OrderLines|null $orderLines
|
950 |
*/
|
951 |
private function __construct(
|
952 |
Transactions $transactions,
|
964 |
Status $status = null,
|
965 |
Customer $customer = null,
|
966 |
Extra $extra = null,
|
967 |
+
Url $webhookUrl = null,
|
968 |
+
OrderLines $orderLines = null
|
969 |
) {
|
970 |
$this->transactions = $transactions;
|
971 |
$this->amount = $amount;
|
983 |
$this->customer = $customer;
|
984 |
$this->extra = $extra;
|
985 |
$this->webhookUrl = $webhookUrl;
|
986 |
+
$this->orderLines = $orderLines;
|
987 |
}
|
988 |
}
|
@@ -13,6 +13,9 @@ use GingerPayments\Payment\Order\Customer\Housenumber;
|
|
13 |
use GingerPayments\Payment\Order\Customer\Country;
|
14 |
use GingerPayments\Payment\Order\Customer\PhoneNumbers;
|
15 |
use GingerPayments\Payment\Order\Customer\Locale;
|
|
|
|
|
|
|
16 |
|
17 |
final class Customer
|
18 |
{
|
@@ -71,6 +74,21 @@ final class Customer
|
|
71 |
*/
|
72 |
private $locale;
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
/**
|
75 |
* @param array $details
|
76 |
* @return Customer
|
@@ -89,7 +107,10 @@ final class Customer
|
|
89 |
array_key_exists('housenumber', $details) ? Housenumber::fromString($details['housenumber']) : null,
|
90 |
array_key_exists('country', $details) ? Country::fromString($details['country']) : null,
|
91 |
array_key_exists('phone_numbers', $details) ? PhoneNumbers::fromArray($details['phone_numbers']) : null,
|
92 |
-
array_key_exists('locale', $details) ? Locale::fromString($details['locale']) : null
|
|
|
|
|
|
|
93 |
);
|
94 |
}
|
95 |
|
@@ -110,7 +131,10 @@ final class Customer
|
|
110 |
'housenumber' => ($this->housenumber() !== null) ? $this->housenumber()->toString() : null,
|
111 |
'country' => ($this->country() !== null) ? $this->country()->toString() : null,
|
112 |
'phone_numbers' => ($this->phoneNumbers() !== null) ? $this->phoneNumbers()->toArray() : [],
|
113 |
-
'locale' => ($this->locale() !== null) ? $this->locale()->toString() : null
|
|
|
|
|
|
|
114 |
];
|
115 |
}
|
116 |
|
@@ -202,6 +226,30 @@ final class Customer
|
|
202 |
return $this->locale;
|
203 |
}
|
204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
/**
|
206 |
* @param MerchantCustomerId $merchantCustomerId
|
207 |
* @param EmailAddress $emailAddress
|
@@ -214,6 +262,9 @@ final class Customer
|
|
214 |
* @param Country $country
|
215 |
* @param PhoneNumbers $phoneNumbers
|
216 |
* @param Locale $locale
|
|
|
|
|
|
|
217 |
*/
|
218 |
private function __construct(
|
219 |
MerchantCustomerId $merchantCustomerId = null,
|
@@ -226,7 +277,10 @@ final class Customer
|
|
226 |
Housenumber $housenumber = null,
|
227 |
Country $country = null,
|
228 |
PhoneNumbers $phoneNumbers = null,
|
229 |
-
Locale $locale = null
|
|
|
|
|
|
|
230 |
) {
|
231 |
$this->merchantCustomerId = $merchantCustomerId;
|
232 |
$this->emailAddress = $emailAddress;
|
@@ -239,5 +293,8 @@ final class Customer
|
|
239 |
$this->country = $country;
|
240 |
$this->phoneNumbers = $phoneNumbers;
|
241 |
$this->locale = $locale;
|
|
|
|
|
|
|
242 |
}
|
243 |
}
|
13 |
use GingerPayments\Payment\Order\Customer\Country;
|
14 |
use GingerPayments\Payment\Order\Customer\PhoneNumbers;
|
15 |
use GingerPayments\Payment\Order\Customer\Locale;
|
16 |
+
use GingerPayments\Payment\Order\Customer\Birthdate;
|
17 |
+
use GingerPayments\Payment\Order\Customer\Gender;
|
18 |
+
use GingerPayments\Payment\Order\Customer\IP;
|
19 |
|
20 |
final class Customer
|
21 |
{
|
74 |
*/
|
75 |
private $locale;
|
76 |
|
77 |
+
/**
|
78 |
+
* @var Gender|null
|
79 |
+
*/
|
80 |
+
private $gender;
|
81 |
+
|
82 |
+
/**
|
83 |
+
* @var Birthdate|null
|
84 |
+
*/
|
85 |
+
private $birthdate;
|
86 |
+
|
87 |
+
/**
|
88 |
+
* @var IP|null
|
89 |
+
*/
|
90 |
+
private $ip;
|
91 |
+
|
92 |
/**
|
93 |
* @param array $details
|
94 |
* @return Customer
|
107 |
array_key_exists('housenumber', $details) ? Housenumber::fromString($details['housenumber']) : null,
|
108 |
array_key_exists('country', $details) ? Country::fromString($details['country']) : null,
|
109 |
array_key_exists('phone_numbers', $details) ? PhoneNumbers::fromArray($details['phone_numbers']) : null,
|
110 |
+
array_key_exists('locale', $details) ? Locale::fromString($details['locale']) : null,
|
111 |
+
array_key_exists('gender', $details) ? Gender::fromString($details['gender']) : null,
|
112 |
+
array_key_exists('birthdate', $details) ? Birthdate::fromString($details['birthdate']) : null,
|
113 |
+
array_key_exists('ip_address', $details) ? Ip::fromString($details['ip_address']) : null
|
114 |
);
|
115 |
}
|
116 |
|
131 |
'housenumber' => ($this->housenumber() !== null) ? $this->housenumber()->toString() : null,
|
132 |
'country' => ($this->country() !== null) ? $this->country()->toString() : null,
|
133 |
'phone_numbers' => ($this->phoneNumbers() !== null) ? $this->phoneNumbers()->toArray() : [],
|
134 |
+
'locale' => ($this->locale() !== null) ? $this->locale()->toString() : null,
|
135 |
+
'gender' => ($this->gender() !== null) ? $this->gender()->toString() : null,
|
136 |
+
'birthdate' => ($this->birthdate() !== null) ? $this->birthdate()->toString() : null,
|
137 |
+
'ip_address' => ($this->ip() !== null) ? $this->ip()->toString() : null
|
138 |
];
|
139 |
}
|
140 |
|
226 |
return $this->locale;
|
227 |
}
|
228 |
|
229 |
+
/**
|
230 |
+
* @return Gender|null
|
231 |
+
*/
|
232 |
+
public function gender()
|
233 |
+
{
|
234 |
+
return $this->gender;
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* @return Birthdate|null
|
239 |
+
*/
|
240 |
+
public function birthdate()
|
241 |
+
{
|
242 |
+
return $this->birthdate;
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* @return IP|null
|
247 |
+
*/
|
248 |
+
public function ip()
|
249 |
+
{
|
250 |
+
return $this->ip;
|
251 |
+
}
|
252 |
+
|
253 |
/**
|
254 |
* @param MerchantCustomerId $merchantCustomerId
|
255 |
* @param EmailAddress $emailAddress
|
262 |
* @param Country $country
|
263 |
* @param PhoneNumbers $phoneNumbers
|
264 |
* @param Locale $locale
|
265 |
+
* @param Gender $gender
|
266 |
+
* @param Birthdate $birthdate
|
267 |
+
* @param IP $ip
|
268 |
*/
|
269 |
private function __construct(
|
270 |
MerchantCustomerId $merchantCustomerId = null,
|
277 |
Housenumber $housenumber = null,
|
278 |
Country $country = null,
|
279 |
PhoneNumbers $phoneNumbers = null,
|
280 |
+
Locale $locale = null,
|
281 |
+
Gender $gender = null,
|
282 |
+
Birthdate $birthdate = null,
|
283 |
+
IP $ip = null
|
284 |
) {
|
285 |
$this->merchantCustomerId = $merchantCustomerId;
|
286 |
$this->emailAddress = $emailAddress;
|
293 |
$this->country = $country;
|
294 |
$this->phoneNumbers = $phoneNumbers;
|
295 |
$this->locale = $locale;
|
296 |
+
$this->gender = $gender;
|
297 |
+
$this->birthdate = $birthdate;
|
298 |
+
$this->ip = $ip;
|
299 |
}
|
300 |
}
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\Customer;
|
4 |
+
|
5 |
+
use Assert\Assertion as Guard;
|
6 |
+
use GingerPayments\Payment\Common\StringBasedValueObject;
|
7 |
+
|
8 |
+
final class Birthdate
|
9 |
+
{
|
10 |
+
use StringBasedValueObject;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param string $value
|
14 |
+
*/
|
15 |
+
private function __construct($value)
|
16 |
+
{
|
17 |
+
Guard::date($value, 'Y-m-d');
|
18 |
+
|
19 |
+
$this->value = $value;
|
20 |
+
}
|
21 |
+
}
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\Customer;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Common\ChoiceBasedValueObject;
|
6 |
+
|
7 |
+
final class Gender
|
8 |
+
{
|
9 |
+
use ChoiceBasedValueObject;
|
10 |
+
|
11 |
+
const MALE = 'male';
|
12 |
+
const FEMALE = 'female';
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @return array
|
16 |
+
*/
|
17 |
+
public function possibleValues()
|
18 |
+
{
|
19 |
+
return [
|
20 |
+
self::MALE,
|
21 |
+
self::FEMALE
|
22 |
+
];
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @return bool
|
27 |
+
*/
|
28 |
+
public function isMale()
|
29 |
+
{
|
30 |
+
return $this->value === self::MALE;
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @return bool
|
35 |
+
*/
|
36 |
+
public function isFemale()
|
37 |
+
{
|
38 |
+
return $this->value === self::FEMALE;
|
39 |
+
}
|
40 |
+
}
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\Customer;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Common\StringBasedValueObject;
|
6 |
+
use Assert\Assertion as Guard;
|
7 |
+
|
8 |
+
final class IP
|
9 |
+
{
|
10 |
+
use StringBasedValueObject;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param string $value
|
14 |
+
*/
|
15 |
+
private function __construct($value)
|
16 |
+
{
|
17 |
+
Guard::ip($value, "Customer IP must me a valid IP address.");
|
18 |
+
|
19 |
+
$this->value = $value;
|
20 |
+
}
|
21 |
+
}
|
@@ -0,0 +1,370 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order;
|
4 |
+
|
5 |
+
use Rhumsaa\Uuid\Uuid;
|
6 |
+
use Assert\Assertion as Guard;
|
7 |
+
|
8 |
+
use GingerPayments\Payment\Order\OrderLine\Ean;
|
9 |
+
use GingerPayments\Payment\Order\OrderLine\Url;
|
10 |
+
use GingerPayments\Payment\Order\OrderLine\Type;
|
11 |
+
use GingerPayments\Payment\Order\OrderLine\Name;
|
12 |
+
use GingerPayments\Payment\Order\OrderLine\Amount as OrderLineAmount;
|
13 |
+
use GingerPayments\Payment\Order\OrderLine\Currency;
|
14 |
+
use GingerPayments\Payment\Order\OrderLine\Quantity;
|
15 |
+
use GingerPayments\Payment\Order\OrderLine\ImageUrl;
|
16 |
+
use GingerPayments\Payment\Order\OrderLine\DiscountRate;
|
17 |
+
use GingerPayments\Payment\Order\OrderLine\VatPercentage;
|
18 |
+
use GingerPayments\Payment\Order\OrderLine\MerchantOrderLineId;
|
19 |
+
|
20 |
+
final class OrderLine
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* @var Uuid|null
|
24 |
+
*/
|
25 |
+
private $id;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @var Ean|null
|
29 |
+
*/
|
30 |
+
private $ean;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @var Url|null
|
34 |
+
*/
|
35 |
+
private $url;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @var Name|null
|
39 |
+
*/
|
40 |
+
private $name;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @var Type|null
|
44 |
+
*/
|
45 |
+
private $type;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @var OrderLineAmount|null
|
49 |
+
*/
|
50 |
+
private $amount;
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @var Currency|null
|
54 |
+
*/
|
55 |
+
private $currency;
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @var Quantity|null
|
59 |
+
*/
|
60 |
+
private $quantity;
|
61 |
+
|
62 |
+
/**
|
63 |
+
* @var ImageUrl|null
|
64 |
+
*/
|
65 |
+
private $imageUrl;
|
66 |
+
|
67 |
+
/**
|
68 |
+
* @var DiscountRate|null
|
69 |
+
*/
|
70 |
+
private $discountRate;
|
71 |
+
|
72 |
+
/**
|
73 |
+
* @var VatPercentage|null
|
74 |
+
*/
|
75 |
+
private $vatPercentage;
|
76 |
+
|
77 |
+
/**
|
78 |
+
* @var MerchantOrderLineId|nulL
|
79 |
+
*/
|
80 |
+
private $merchantOrderLineId;
|
81 |
+
|
82 |
+
/**
|
83 |
+
* @param array $orderLine
|
84 |
+
* @return OrderLine
|
85 |
+
*/
|
86 |
+
public static function fromArray(array $orderLine)
|
87 |
+
{
|
88 |
+
Guard::keyExists($orderLine, 'name');
|
89 |
+
Guard::keyExists($orderLine, 'amount');
|
90 |
+
Guard::keyExists($orderLine, 'quantity');
|
91 |
+
Guard::keyExists($orderLine, 'currency');
|
92 |
+
Guard::keyExists($orderLine, 'vat_percentage');
|
93 |
+
Guard::keyExists($orderLine, 'merchant_order_line_id');
|
94 |
+
|
95 |
+
return new static(
|
96 |
+
array_key_exists('id', $orderLine) ? Uuid::fromString($orderLine['id']) : null,
|
97 |
+
array_key_exists('ean', $orderLine) ? Ean::fromString($orderLine['ean']) : null,
|
98 |
+
array_key_exists('url', $orderLine) ? Url::fromString($orderLine['url']) : null,
|
99 |
+
array_key_exists('name', $orderLine) ? Name::fromString($orderLine['name']) : null,
|
100 |
+
array_key_exists('type', $orderLine) ? Type::fromString($orderLine['type']) : null,
|
101 |
+
array_key_exists('amount', $orderLine) ? OrderLineAmount::fromInteger($orderLine['amount']) : null,
|
102 |
+
array_key_exists('currency', $orderLine) ? Currency::fromString($orderLine['currency']) : null,
|
103 |
+
array_key_exists('quantity', $orderLine) ? Quantity::fromInteger($orderLine['quantity']) : null,
|
104 |
+
array_key_exists('image_url', $orderLine) ? ImageUrl::fromString($orderLine['image_url']) : null,
|
105 |
+
array_key_exists('discount_rate',
|
106 |
+
$orderLine) ? DiscountRate::fromInteger($orderLine['discount_rate']) : null,
|
107 |
+
array_key_exists('vat_percentage',
|
108 |
+
$orderLine) ? VatPercentage::fromInteger($orderLine['vat_percentage']) : null,
|
109 |
+
array_key_exists('merchant_order_line_id',
|
110 |
+
$orderLine) ? MerchantOrderLineId::fromString($orderLine['merchant_order_line_id']) : null
|
111 |
+
);
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* @return array
|
116 |
+
*/
|
117 |
+
public function toArray()
|
118 |
+
{
|
119 |
+
return [
|
120 |
+
'id' => $this->getId(),
|
121 |
+
'ean' => $this->getEan(),
|
122 |
+
'url' => $this->getUrl(),
|
123 |
+
'name' => $this->getName(),
|
124 |
+
'type' => $this->getType(),
|
125 |
+
'amount' => $this->getAmount(),
|
126 |
+
'currency' => $this->getCurrency(),
|
127 |
+
'quantity' => $this->getQuantity(),
|
128 |
+
'image_url' => $this->getImageUrl(),
|
129 |
+
'discount_rate' => $this->getDiscountRate(),
|
130 |
+
'vat_percentage' => $this->getVatPercentage(),
|
131 |
+
'merchant_order_line_id' => $this->getMerchantOrderLineId(),
|
132 |
+
];
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* @return Uuid|null
|
137 |
+
*/
|
138 |
+
public function id()
|
139 |
+
{
|
140 |
+
return $this->id;
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* @return null|string
|
145 |
+
*/
|
146 |
+
public function getId()
|
147 |
+
{
|
148 |
+
return ($this->id() !== null) ? $this->id()->toString() : null;
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* @return Ean|null
|
153 |
+
*/
|
154 |
+
public function ean()
|
155 |
+
{
|
156 |
+
return $this->ean;
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* @return null|string
|
161 |
+
*/
|
162 |
+
public function getEan()
|
163 |
+
{
|
164 |
+
return ($this->ean() !== null) ? $this->ean()->toString() : null;
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* @return Url|null
|
169 |
+
*/
|
170 |
+
public function url()
|
171 |
+
{
|
172 |
+
return $this->url;
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* @return null|string
|
177 |
+
*/
|
178 |
+
public function getUrl()
|
179 |
+
{
|
180 |
+
return ($this->url() !== null) ? $this->url()->toString() : null;
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* @return Name|null
|
185 |
+
*/
|
186 |
+
public function name()
|
187 |
+
{
|
188 |
+
return $this->name;
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* @return null|string
|
193 |
+
*/
|
194 |
+
public function getName()
|
195 |
+
{
|
196 |
+
return ($this->name() !== null) ? $this->name()->toString() : null;
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* @return Type|null
|
201 |
+
*/
|
202 |
+
public function type()
|
203 |
+
{
|
204 |
+
return $this->type;
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* @return null|string
|
209 |
+
*/
|
210 |
+
public function getType()
|
211 |
+
{
|
212 |
+
return ($this->type() !== null) ? $this->type()->toString() : null;
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* @return OrderLineAmount|null
|
217 |
+
*/
|
218 |
+
public function amount()
|
219 |
+
{
|
220 |
+
return $this->amount;
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* @return int|null
|
225 |
+
*/
|
226 |
+
public function getAmount()
|
227 |
+
{
|
228 |
+
return ($this->amount() !== null) ? $this->amount()->toInteger() : null;
|
229 |
+
}
|
230 |
+
|
231 |
+
/**
|
232 |
+
* @return Currency|null
|
233 |
+
*/
|
234 |
+
public function currency()
|
235 |
+
{
|
236 |
+
return $this->currency;
|
237 |
+
}
|
238 |
+
|
239 |
+
/**
|
240 |
+
* @return null|string
|
241 |
+
*/
|
242 |
+
public function getCurrency()
|
243 |
+
{
|
244 |
+
return ($this->currency() !== null) ? $this->currency()->toString() : null;
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* @return Quantity|null
|
249 |
+
*/
|
250 |
+
public function quantity()
|
251 |
+
{
|
252 |
+
return $this->quantity;
|
253 |
+
}
|
254 |
+
|
255 |
+
/**
|
256 |
+
* @return int|null
|
257 |
+
*/
|
258 |
+
public function getQuantity()
|
259 |
+
{
|
260 |
+
return ($this->quantity() !== null) ? $this->quantity()->toInteger() : null;
|
261 |
+
}
|
262 |
+
|
263 |
+
/**
|
264 |
+
* @return ImageUrl|null
|
265 |
+
*/
|
266 |
+
public function imageUrl()
|
267 |
+
{
|
268 |
+
return $this->imageUrl;
|
269 |
+
}
|
270 |
+
|
271 |
+
/**
|
272 |
+
* @return null|string
|
273 |
+
*/
|
274 |
+
public function getImageUrl()
|
275 |
+
{
|
276 |
+
return ($this->imageUrl() !== null) ? $this->imageUrl()->toString() : null;
|
277 |
+
}
|
278 |
+
|
279 |
+
/**
|
280 |
+
* @return DiscountRate|null
|
281 |
+
*/
|
282 |
+
public function discountRate()
|
283 |
+
{
|
284 |
+
return $this->discountRate;
|
285 |
+
}
|
286 |
+
|
287 |
+
/**
|
288 |
+
* @return int|null
|
289 |
+
*/
|
290 |
+
public function getDiscountRate()
|
291 |
+
{
|
292 |
+
return ($this->discountRate() !== null) ? $this->discountRate()->toInteger() : null;
|
293 |
+
}
|
294 |
+
|
295 |
+
/**
|
296 |
+
* @return VatPercentage|null
|
297 |
+
*/
|
298 |
+
public function vatPercentage()
|
299 |
+
{
|
300 |
+
return $this->vatPercentage;
|
301 |
+
}
|
302 |
+
|
303 |
+
/**
|
304 |
+
* @return int|null
|
305 |
+
*/
|
306 |
+
public function getVatPercentage()
|
307 |
+
{
|
308 |
+
return ($this->vatPercentage() !== null) ? $this->vatPercentage()->toInteger() : null;
|
309 |
+
}
|
310 |
+
|
311 |
+
/**
|
312 |
+
* @return MerchantOrderLineId|nulL
|
313 |
+
*/
|
314 |
+
public function merchantOrderLineId()
|
315 |
+
{
|
316 |
+
return $this->merchantOrderLineId;
|
317 |
+
}
|
318 |
+
|
319 |
+
/**
|
320 |
+
* @return null|string
|
321 |
+
*/
|
322 |
+
public function getMerchantOrderLineId()
|
323 |
+
{
|
324 |
+
return ($this->merchantOrderLineId() !== null) ? $this->merchantOrderLineId()->toString() : null;
|
325 |
+
}
|
326 |
+
|
327 |
+
/**
|
328 |
+
* OrderLine constructor.
|
329 |
+
*
|
330 |
+
* @param Uuid|null $id
|
331 |
+
* @param Ean|null $ean
|
332 |
+
* @param Url|null $url
|
333 |
+
* @param Name|null $name
|
334 |
+
* @param Type|null $type
|
335 |
+
* @param OrderLineAmount|null $amount
|
336 |
+
* @param Currency|null $currency
|
337 |
+
* @param Quantity|null $quantity
|
338 |
+
* @param ImageUrl|null $imageUrl
|
339 |
+
* @param DiscountRate|null $discountRate
|
340 |
+
* @param VatPercentage|null $vatPercentage
|
341 |
+
* @param MerchantOrderLineId|null $merchantOrderLineId
|
342 |
+
*/
|
343 |
+
private function __construct(
|
344 |
+
Uuid $id = null,
|
345 |
+
Ean $ean = null,
|
346 |
+
Url $url = null,
|
347 |
+
Name $name = null,
|
348 |
+
Type $type = null,
|
349 |
+
OrderLineAmount $amount = null,
|
350 |
+
Currency $currency = null,
|
351 |
+
Quantity $quantity = null,
|
352 |
+
ImageUrl $imageUrl = null,
|
353 |
+
DiscountRate $discountRate = null,
|
354 |
+
VatPercentage $vatPercentage = null,
|
355 |
+
MerchantOrderLineId $merchantOrderLineId = null
|
356 |
+
) {
|
357 |
+
$this->id = $id;
|
358 |
+
$this->ean = $ean;
|
359 |
+
$this->url = $url;
|
360 |
+
$this->name = $name;
|
361 |
+
$this->type = $type;
|
362 |
+
$this->amount = $amount;
|
363 |
+
$this->currency = $currency;
|
364 |
+
$this->quantity = $quantity;
|
365 |
+
$this->imageUrl = $imageUrl;
|
366 |
+
$this->discountRate = $discountRate;
|
367 |
+
$this->vatPercentage = $vatPercentage;
|
368 |
+
$this->merchantOrderLineId = $merchantOrderLineId;
|
369 |
+
}
|
370 |
+
}
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\OrderLine;
|
4 |
+
|
5 |
+
use Assert\Assertion as Guard;
|
6 |
+
use GingerPayments\Payment\Common\IntegerBasedValueObject;
|
7 |
+
|
8 |
+
final class Amount
|
9 |
+
{
|
10 |
+
use IntegerBasedValueObject;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param integer $value
|
14 |
+
*/
|
15 |
+
private function __construct($value)
|
16 |
+
{
|
17 |
+
Guard::min($value, 1, 'Order line amount must be at least one');
|
18 |
+
|
19 |
+
$this->value = $value;
|
20 |
+
}
|
21 |
+
}
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\OrderLine;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Common\ChoiceBasedValueObject;
|
6 |
+
|
7 |
+
final class Currency
|
8 |
+
{
|
9 |
+
use ChoiceBasedValueObject;
|
10 |
+
|
11 |
+
const EUR = 'EUR';
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @return array
|
15 |
+
*/
|
16 |
+
public function possibleValues()
|
17 |
+
{
|
18 |
+
return [self::EUR];
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* @return bool
|
23 |
+
*/
|
24 |
+
public function isEUR()
|
25 |
+
{
|
26 |
+
return $this->value === self::EUR;
|
27 |
+
}
|
28 |
+
}
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\OrderLine;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Common\IntegerBasedValueObject;
|
6 |
+
use Assert\Assertion as Guard;
|
7 |
+
|
8 |
+
final class DiscountRate
|
9 |
+
{
|
10 |
+
use IntegerBasedValueObject;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param integer $value
|
14 |
+
*/
|
15 |
+
private function __construct($value)
|
16 |
+
{
|
17 |
+
Guard::min($value, 0, 'Discount rate can not be less than zero.');
|
18 |
+
Guard::max($value, 10000, 'Discount rate can not be greater than 10000.');
|
19 |
+
|
20 |
+
$this->value = $value;
|
21 |
+
}
|
22 |
+
}
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\OrderLine;
|
4 |
+
|
5 |
+
use Assert\Assertion as Guard;
|
6 |
+
use GingerPayments\Payment\Common\StringBasedValueObject;
|
7 |
+
|
8 |
+
final class Ean
|
9 |
+
{
|
10 |
+
use StringBasedValueObject;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param string $value
|
14 |
+
*/
|
15 |
+
private function __construct($value)
|
16 |
+
{
|
17 |
+
Guard::notBlank($value, 'International Article Number should not be blank.');
|
18 |
+
|
19 |
+
$this->value = $value;
|
20 |
+
}
|
21 |
+
}
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\OrderLine;
|
4 |
+
|
5 |
+
use Assert\Assertion as Guard;
|
6 |
+
use GingerPayments\Payment\Common\StringBasedValueObject;
|
7 |
+
|
8 |
+
final class ImageUrl
|
9 |
+
{
|
10 |
+
use StringBasedValueObject;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param string $value
|
14 |
+
*/
|
15 |
+
private function __construct($value)
|
16 |
+
{
|
17 |
+
Guard::url($value, 'Item image URL must be a valid URL.');
|
18 |
+
|
19 |
+
$this->value = $value;
|
20 |
+
}
|
21 |
+
}
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\OrderLine;
|
4 |
+
|
5 |
+
use Assert\Assertion as Guard;
|
6 |
+
use GingerPayments\Payment\Common\StringBasedValueObject;
|
7 |
+
|
8 |
+
final class MerchantOrderLineId
|
9 |
+
{
|
10 |
+
use StringBasedValueObject;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param string $value
|
14 |
+
*/
|
15 |
+
private function __construct($value)
|
16 |
+
{
|
17 |
+
Guard::notBlank($value, 'Merchant Order Line ID should not be blank.');
|
18 |
+
|
19 |
+
$this->value = $value;
|
20 |
+
}
|
21 |
+
}
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\OrderLine;
|
4 |
+
|
5 |
+
use Assert\Assertion as Guard;
|
6 |
+
use GingerPayments\Payment\Common\StringBasedValueObject;
|
7 |
+
|
8 |
+
final class Name
|
9 |
+
{
|
10 |
+
use StringBasedValueObject;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param string $value
|
14 |
+
*/
|
15 |
+
private function __construct($value)
|
16 |
+
{
|
17 |
+
Guard::notBlank($value, 'Order line name should not be blank.');
|
18 |
+
|
19 |
+
$this->value = $value;
|
20 |
+
}
|
21 |
+
}
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\OrderLine;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Common\IntegerBasedValueObject;
|
6 |
+
use Assert\Assertion as Guard;
|
7 |
+
|
8 |
+
final class Quantity
|
9 |
+
{
|
10 |
+
use IntegerBasedValueObject;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param integer $value
|
14 |
+
*/
|
15 |
+
private function __construct($value)
|
16 |
+
{
|
17 |
+
Guard::min($value, 1, 'Order line quantity must be at least one.');
|
18 |
+
|
19 |
+
$this->value = $value;
|
20 |
+
}
|
21 |
+
}
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\OrderLine;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Common\ChoiceBasedValueObject;
|
6 |
+
|
7 |
+
final class Type
|
8 |
+
{
|
9 |
+
use ChoiceBasedValueObject;
|
10 |
+
|
11 |
+
const PHYSICAL = 'physical';
|
12 |
+
const DISCOUNT = 'discount';
|
13 |
+
const SHIPPING_FEE = 'shipping_fee';
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @return array
|
17 |
+
*/
|
18 |
+
public function possibleValues()
|
19 |
+
{
|
20 |
+
return [
|
21 |
+
self::PHYSICAL,
|
22 |
+
self::DISCOUNT,
|
23 |
+
self::SHIPPING_FEE
|
24 |
+
];
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @return bool
|
29 |
+
*/
|
30 |
+
public function isPhysical()
|
31 |
+
{
|
32 |
+
return $this->value === self::PHYSICAL;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* @return bool
|
37 |
+
*/
|
38 |
+
public function isDiscount()
|
39 |
+
{
|
40 |
+
return $this->value === self::DISCOUNT;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @return bool
|
45 |
+
*/
|
46 |
+
public function isShippingFee()
|
47 |
+
{
|
48 |
+
return $this->value === self::SHIPPING_FEE;
|
49 |
+
}
|
50 |
+
}
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\OrderLine;
|
4 |
+
|
5 |
+
use Assert\Assertion as Guard;
|
6 |
+
use GingerPayments\Payment\Common\StringBasedValueObject;
|
7 |
+
|
8 |
+
final class Url
|
9 |
+
{
|
10 |
+
use StringBasedValueObject;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param string $value
|
14 |
+
*/
|
15 |
+
private function __construct($value)
|
16 |
+
{
|
17 |
+
Guard::url($value, 'Item product page URI must be a valid URL.');
|
18 |
+
|
19 |
+
$this->value = $value;
|
20 |
+
}
|
21 |
+
}
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\OrderLine;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Common\IntegerBasedValueObject;
|
6 |
+
use Assert\Assertion as Guard;
|
7 |
+
|
8 |
+
final class VatPercentage
|
9 |
+
{
|
10 |
+
use IntegerBasedValueObject;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param integer $value
|
14 |
+
*/
|
15 |
+
private function __construct($value)
|
16 |
+
{
|
17 |
+
Guard::min($value, 0, 'VAT percentage can not be less than zero.');
|
18 |
+
Guard::max($value, 10000, 'VAT percentage can not be greater than 10000.');
|
19 |
+
|
20 |
+
$this->value = $value;
|
21 |
+
}
|
22 |
+
}
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order;
|
4 |
+
|
5 |
+
use Assert\Assertion as Guard;
|
6 |
+
|
7 |
+
final class OrderLines implements \Iterator
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @var OrderLine[]
|
11 |
+
*/
|
12 |
+
private $orderLines;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @return OrderLines
|
16 |
+
*/
|
17 |
+
public static function create()
|
18 |
+
{
|
19 |
+
return new static([]);
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* @param array $orderLines
|
24 |
+
* @return OrderLines
|
25 |
+
*/
|
26 |
+
public static function fromArray(array $orderLines)
|
27 |
+
{
|
28 |
+
return new static(
|
29 |
+
array_map(
|
30 |
+
function ($orderLine) {
|
31 |
+
return OrderLine::fromArray($orderLine);
|
32 |
+
},
|
33 |
+
$orderLines
|
34 |
+
)
|
35 |
+
);
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @return array
|
40 |
+
*/
|
41 |
+
public function toArray()
|
42 |
+
{
|
43 |
+
return array_map(
|
44 |
+
function (OrderLine $orderLine) {
|
45 |
+
return $orderLine->toArray();
|
46 |
+
},
|
47 |
+
$this->orderLines
|
48 |
+
);
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @return OrderLine|mixed
|
53 |
+
*/
|
54 |
+
public function current()
|
55 |
+
{
|
56 |
+
return current($this->orderLines);
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* @return OrderLine|mixed
|
61 |
+
*/
|
62 |
+
public function next()
|
63 |
+
{
|
64 |
+
return next($this->orderLines);
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* @return mixed
|
69 |
+
*/
|
70 |
+
public function key()
|
71 |
+
{
|
72 |
+
return key($this->orderLines);
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* @return boolean
|
77 |
+
*/
|
78 |
+
public function valid()
|
79 |
+
{
|
80 |
+
$key = key($this->orderLines);
|
81 |
+
return ($key !== null && $key !== false);
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Rewind the Iterator to the first element
|
86 |
+
*/
|
87 |
+
public function rewind()
|
88 |
+
{
|
89 |
+
reset($this->orderLines);
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* @param OrderLine[] $orderLines
|
94 |
+
*/
|
95 |
+
private function __construct(array $orderLines = [])
|
96 |
+
{
|
97 |
+
Guard::allIsInstanceOf($orderLines, 'GingerPayments\Payment\Order\OrderLine');
|
98 |
+
|
99 |
+
$this->orderLines = $orderLines;
|
100 |
+
}
|
101 |
+
}
|
@@ -17,6 +17,9 @@ final class PaymentMethod
|
|
17 |
const SOFORT = 'sofort';
|
18 |
const BANCONTACT = 'bancontact';
|
19 |
const COD = 'cash-on-delivery';
|
|
|
|
|
|
|
20 |
|
21 |
/**
|
22 |
* @return array
|
@@ -29,7 +32,10 @@ final class PaymentMethod
|
|
29 |
self::BANK_TRANSFER,
|
30 |
self::SOFORT,
|
31 |
self::BANCONTACT,
|
32 |
-
self::COD
|
|
|
|
|
|
|
33 |
];
|
34 |
}
|
35 |
|
@@ -80,4 +86,28 @@ final class PaymentMethod
|
|
80 |
{
|
81 |
return $this->value === self::COD;
|
82 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
}
|
17 |
const SOFORT = 'sofort';
|
18 |
const BANCONTACT = 'bancontact';
|
19 |
const COD = 'cash-on-delivery';
|
20 |
+
const KLARNA = 'klarna';
|
21 |
+
const PAYPAL = 'paypal';
|
22 |
+
const HOMEPAY = 'homepay';
|
23 |
|
24 |
/**
|
25 |
* @return array
|
32 |
self::BANK_TRANSFER,
|
33 |
self::SOFORT,
|
34 |
self::BANCONTACT,
|
35 |
+
self::COD,
|
36 |
+
self::KLARNA,
|
37 |
+
self::PAYPAL,
|
38 |
+
self::HOMEPAY
|
39 |
];
|
40 |
}
|
41 |
|
86 |
{
|
87 |
return $this->value === self::COD;
|
88 |
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* @return bool
|
92 |
+
*/
|
93 |
+
public function isKlarna()
|
94 |
+
{
|
95 |
+
return $this->value === self::KLARNA;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* @return bool
|
100 |
+
*/
|
101 |
+
public function isPayPal()
|
102 |
+
{
|
103 |
+
return $this->value === self::PAYPAL;
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* @return bool
|
108 |
+
*/
|
109 |
+
public function isHomePay()
|
110 |
+
{
|
111 |
+
return $this->value === self::HOMEPAY;
|
112 |
+
}
|
113 |
}
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\Transaction\PaymentMethodDetails;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Order\Transaction\PaymentMethodDetails;
|
6 |
+
|
7 |
+
final class HomePayPaymentMethodDetails implements PaymentMethodDetails
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @param array $details
|
11 |
+
* @return static
|
12 |
+
*/
|
13 |
+
public static function fromArray(array $details)
|
14 |
+
{
|
15 |
+
return new static();
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @return array
|
20 |
+
*/
|
21 |
+
public function toArray()
|
22 |
+
{
|
23 |
+
return [];
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* HomePayPaymentMethodDetails constructor.
|
28 |
+
*/
|
29 |
+
private function __construct() {}
|
30 |
+
}
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\Transaction\PaymentMethodDetails;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Order\Transaction\PaymentMethodDetails;
|
6 |
+
use GingerPayments\Payment\Order\Transaction\PaymentMethodDetails\KlarnaPaymentMethodDetails\ErrorCode;
|
7 |
+
|
8 |
+
final class KlarnaPaymentMethodDetails implements PaymentMethodDetails
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* @var ErrorCode
|
12 |
+
*/
|
13 |
+
private $errorCode;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @param array $details
|
17 |
+
* @return static
|
18 |
+
*/
|
19 |
+
public static function fromArray(array $details)
|
20 |
+
{
|
21 |
+
return new static(
|
22 |
+
array_key_exists('error_code', $details) ? ErrorCode::fromString($details['error_code']) : null
|
23 |
+
);
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @return array
|
28 |
+
*/
|
29 |
+
public function toArray()
|
30 |
+
{
|
31 |
+
return [
|
32 |
+
'error_code' => ($this->errorCode() !== null) ? $this->errorCode()->toString() : null
|
33 |
+
];
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @return ErrorCode
|
38 |
+
*/
|
39 |
+
public function errorCode()
|
40 |
+
{
|
41 |
+
return $this->errorCode;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* KlarnaPaymentMethodDetails constructor.
|
46 |
+
* @param ErrorCode|null $errorCode
|
47 |
+
*/
|
48 |
+
private function __construct(
|
49 |
+
ErrorCode $errorCode = null
|
50 |
+
) {
|
51 |
+
$this->errorCode = $errorCode;
|
52 |
+
}
|
53 |
+
}
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\Transaction\PaymentMethodDetails\KlarnaPaymentMethodDetails;
|
4 |
+
|
5 |
+
use Assert\Assertion as Guard;
|
6 |
+
use GingerPayments\Payment\Common\StringBasedValueObject;
|
7 |
+
|
8 |
+
final class ErrorCode
|
9 |
+
{
|
10 |
+
use StringBasedValueObject;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param string $value
|
14 |
+
*/
|
15 |
+
private function __construct($value)
|
16 |
+
{
|
17 |
+
Guard::notBlank($value, 'Klarna error_code can not be blank.');
|
18 |
+
|
19 |
+
$this->value = $value;
|
20 |
+
}
|
21 |
+
}
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\Transaction\PaymentMethodDetails;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Order\Transaction\PaymentMethodDetails;
|
6 |
+
|
7 |
+
final class PayPalPaymentMethodDetails implements PaymentMethodDetails
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @param array $details
|
11 |
+
* @return static
|
12 |
+
*/
|
13 |
+
public static function fromArray(array $details)
|
14 |
+
{
|
15 |
+
return new static();
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @return array
|
20 |
+
*/
|
21 |
+
public function toArray()
|
22 |
+
{
|
23 |
+
return [];
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* PayPalPaymentMethodDetails constructor.
|
28 |
+
*/
|
29 |
+
private function __construct() {}
|
30 |
+
}
|
@@ -32,6 +32,18 @@ final class PaymentMethodDetailsFactory
|
|
32 |
return CashOnDeliveryPaymentMethodDetails::fromArray($paymentMethodDetails);
|
33 |
}
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
throw new \InvalidArgumentException('Provided payment method not supported.');
|
36 |
}
|
37 |
}
|
32 |
return CashOnDeliveryPaymentMethodDetails::fromArray($paymentMethodDetails);
|
33 |
}
|
34 |
|
35 |
+
if ($paymentMethod->isKlarna()) {
|
36 |
+
return KlarnaPaymentMethodDetails::fromArray($paymentMethodDetails);
|
37 |
+
}
|
38 |
+
|
39 |
+
if ($paymentMethod->isPayPal()) {
|
40 |
+
return PayPalPaymentMethodDetails::fromArray($paymentMethodDetails);
|
41 |
+
}
|
42 |
+
|
43 |
+
if ($paymentMethod->isHomePay()) {
|
44 |
+
return HomePayPaymentMethodDetails::fromArray($paymentMethodDetails);
|
45 |
+
}
|
46 |
+
|
47 |
throw new \InvalidArgumentException('Provided payment method not supported.');
|
48 |
}
|
49 |
}
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Order\Transaction\PaymentMethodDetails;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Order\Transaction\PaymentMethodDetails;
|
6 |
+
|
7 |
+
final class PayPalPaymentMethodDetails implements PaymentMethodDetails
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @param array $details
|
11 |
+
* @return static
|
12 |
+
*/
|
13 |
+
public static function fromArray(array $details)
|
14 |
+
{
|
15 |
+
return new static();
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @return array
|
20 |
+
*/
|
21 |
+
public function toArray()
|
22 |
+
{
|
23 |
+
return [];
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* PayPalPaymentMethodDetails constructor.
|
28 |
+
*/
|
29 |
+
private function __construct() {}
|
30 |
+
}
|
@@ -18,6 +18,7 @@ final class Status
|
|
18 |
const COMPLETED = 'completed';
|
19 |
const CANCELLED = 'cancelled';
|
20 |
const EXPIRED = 'expired';
|
|
|
21 |
|
22 |
/**
|
23 |
* @return array
|
@@ -31,7 +32,8 @@ final class Status
|
|
31 |
self::ERROR,
|
32 |
self::COMPLETED,
|
33 |
self::CANCELLED,
|
34 |
-
self::EXPIRED
|
|
|
35 |
];
|
36 |
}
|
37 |
|
@@ -90,4 +92,12 @@ final class Status
|
|
90 |
{
|
91 |
return $this->value === self::EXPIRED;
|
92 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
}
|
18 |
const COMPLETED = 'completed';
|
19 |
const CANCELLED = 'cancelled';
|
20 |
const EXPIRED = 'expired';
|
21 |
+
const ACCEPTED = 'accepted';
|
22 |
|
23 |
/**
|
24 |
* @return array
|
32 |
self::ERROR,
|
33 |
self::COMPLETED,
|
34 |
self::CANCELLED,
|
35 |
+
self::EXPIRED,
|
36 |
+
self::ACCEPTED
|
37 |
];
|
38 |
}
|
39 |
|
92 |
{
|
93 |
return $this->value === self::EXPIRED;
|
94 |
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* @return bool
|
98 |
+
*/
|
99 |
+
public function isAccepted()
|
100 |
+
{
|
101 |
+
return $this->value === self::ACCEPTED;
|
102 |
+
}
|
103 |
}
|
@@ -109,7 +109,7 @@ final class ClientTest extends \PHPUnit_Framework_TestCase
|
|
109 |
'orders/',
|
110 |
m::on(
|
111 |
function (array $options) use ($order) {
|
112 |
-
$this->assertEquals(
|
113 |
$this->assertEquals('application/json', $options['headers']['Content-Type']);
|
114 |
$this->assertEquals(
|
115 |
ArrayFunctions::withoutNullValues($order->toArray()),
|
@@ -162,7 +162,7 @@ final class ClientTest extends \PHPUnit_Framework_TestCase
|
|
162 |
'orders/',
|
163 |
m::on(
|
164 |
function (array $options) use ($order) {
|
165 |
-
$this->assertEquals(
|
166 |
$this->assertEquals('application/json', $options['headers']['Content-Type']);
|
167 |
$this->assertEquals(
|
168 |
ArrayFunctions::withoutNullValues($order->toArray()),
|
109 |
'orders/',
|
110 |
m::on(
|
111 |
function (array $options) use ($order) {
|
112 |
+
$this->assertEquals(30, $options['timeout']);
|
113 |
$this->assertEquals('application/json', $options['headers']['Content-Type']);
|
114 |
$this->assertEquals(
|
115 |
ArrayFunctions::withoutNullValues($order->toArray()),
|
162 |
'orders/',
|
163 |
m::on(
|
164 |
function (array $options) use ($order) {
|
165 |
+
$this->assertEquals(30, $options['timeout']);
|
166 |
$this->assertEquals('application/json', $options['headers']['Content-Type']);
|
167 |
$this->assertEquals(
|
168 |
ArrayFunctions::withoutNullValues($order->toArray()),
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Tests\Common;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Tests\Mock\FakeIntegerBasedValueObject;
|
6 |
+
|
7 |
+
final class IntegerBasedValueObjectTest extends \PHPUnit_Framework_TestCase
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @test
|
11 |
+
*/
|
12 |
+
public function itShouldCreateAnObjectFromInteger()
|
13 |
+
{
|
14 |
+
$integerValueObject = FakeIntegerBasedValueObject::fromInteger(1);
|
15 |
+
|
16 |
+
$this->assertInstanceOf(
|
17 |
+
'GingerPayments\Payment\Tests\Mock\FakeIntegerBasedValueObject',
|
18 |
+
$integerValueObject
|
19 |
+
);
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* @test
|
24 |
+
*/
|
25 |
+
public function itShouldConvertToInteger()
|
26 |
+
{
|
27 |
+
$integerBasedValueObject = FakeIntegerBasedValueObject::fromInteger(12345);
|
28 |
+
|
29 |
+
$this->assertInternalType('integer', $integerBasedValueObject->toInteger());
|
30 |
+
$this->assertEquals(12345, $integerBasedValueObject->toInteger());
|
31 |
+
}
|
32 |
+
}
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Tests\Mock;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Common\IntegerBasedValueObject;
|
6 |
+
|
7 |
+
final class FakeIntegerBasedValueObject
|
8 |
+
{
|
9 |
+
use IntegerBasedValueObject;
|
10 |
+
}
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Tests\Order\Customer;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Order\Customer\Birthdate;
|
6 |
+
|
7 |
+
final class BirthdateTest extends \PHPUnit_Framework_TestCase
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @test
|
11 |
+
*/
|
12 |
+
public function itShouldInstantiateFromAValidString()
|
13 |
+
{
|
14 |
+
$this->assertInstanceOf(
|
15 |
+
'GingerPayments\Payment\Order\Customer\Birthdate',
|
16 |
+
Birthdate::fromString('1988-03-29')
|
17 |
+
);
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @test
|
22 |
+
*/
|
23 |
+
public function itCanNotBeEmptyString()
|
24 |
+
{
|
25 |
+
$this->setExpectedException('Assert\InvalidArgumentException');
|
26 |
+
|
27 |
+
$this->assertEmpty(Birthdate::fromString('')->toString());
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @test
|
32 |
+
*/
|
33 |
+
public function formatShouldBeCorrect()
|
34 |
+
{
|
35 |
+
$this->setExpectedException('Assert\InvalidArgumentException');
|
36 |
+
|
37 |
+
Birthdate::fromString('29-03-1998');
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @test
|
42 |
+
*/
|
43 |
+
public function itShouldReturnValidDatetime()
|
44 |
+
{
|
45 |
+
$this->assertEquals(Birthdate::fromString('1988-03-29')->toString(), '1988-03-29');
|
46 |
+
}
|
47 |
+
}
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Tests\Order\Customer;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Order\Customer\Gender;
|
6 |
+
|
7 |
+
final class StatusTest extends \PHPUnit_Framework_TestCase
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @test
|
11 |
+
*/
|
12 |
+
public function itShouldInstantiateFromAValidGender()
|
13 |
+
{
|
14 |
+
$this->assertInstanceOf(
|
15 |
+
'GingerPayments\Payment\Order\Customer\Gender',
|
16 |
+
Gender::fromString(Gender::MALE)
|
17 |
+
);
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @test
|
22 |
+
*/
|
23 |
+
public function itCanBeMale()
|
24 |
+
{
|
25 |
+
$gender = Gender::fromString(Gender::MALE);
|
26 |
+
|
27 |
+
$this->assertTrue($gender->isMale());
|
28 |
+
$this->assertFalse($gender->isFemale());
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* @test
|
33 |
+
*/
|
34 |
+
public function itCanBeFemale()
|
35 |
+
{
|
36 |
+
$gender = Gender::fromString(Gender::FEMALE);
|
37 |
+
|
38 |
+
$this->assertFalse($gender->isMale());
|
39 |
+
$this->assertTrue($gender->isFemale());
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @test
|
44 |
+
*/
|
45 |
+
public function itShouldFailOnInvalidGender()
|
46 |
+
{
|
47 |
+
$this->setExpectedException('Assert\InvalidArgumentException');
|
48 |
+
Gender::fromString('androgynous');
|
49 |
+
}
|
50 |
+
}
|
@@ -22,7 +22,10 @@ final class CustomerTest extends \PHPUnit_Framework_TestCase
|
|
22 |
'housenumber' => '29 A-12',
|
23 |
'country' => 'NL',
|
24 |
'phone_numbers' => [],
|
25 |
-
'locale' => null
|
|
|
|
|
|
|
26 |
];
|
27 |
|
28 |
$customer = Customer::fromArray($array);
|
@@ -42,6 +45,9 @@ final class CustomerTest extends \PHPUnit_Framework_TestCase
|
|
42 |
$this->assertEquals($array['housenumber'], (string) $customer->housenumber());
|
43 |
$this->assertEquals($array['country'], (string) $customer->country());
|
44 |
$this->assertEquals($array['phone_numbers'], $customer->phoneNumbers()->toArray());
|
|
|
|
|
|
|
45 |
}
|
46 |
|
47 |
/**
|
@@ -60,7 +66,10 @@ final class CustomerTest extends \PHPUnit_Framework_TestCase
|
|
60 |
'housenumber' => '29 A-12',
|
61 |
'country' => 'NL',
|
62 |
'phone_numbers' => [],
|
63 |
-
'locale' => null
|
|
|
|
|
|
|
64 |
];
|
65 |
|
66 |
$this->assertEquals(
|
@@ -86,5 +95,7 @@ final class CustomerTest extends \PHPUnit_Framework_TestCase
|
|
86 |
$this->assertNull($customer->housenumber());
|
87 |
$this->assertNull($customer->country());
|
88 |
$this->assertNull($customer->phoneNumbers());
|
|
|
|
|
89 |
}
|
90 |
}
|
22 |
'housenumber' => '29 A-12',
|
23 |
'country' => 'NL',
|
24 |
'phone_numbers' => [],
|
25 |
+
'locale' => null,
|
26 |
+
'gender' => 'male',
|
27 |
+
'birthdate' => '1988-03-29',
|
28 |
+
'ip_address' => '128.0.0.1'
|
29 |
];
|
30 |
|
31 |
$customer = Customer::fromArray($array);
|
45 |
$this->assertEquals($array['housenumber'], (string) $customer->housenumber());
|
46 |
$this->assertEquals($array['country'], (string) $customer->country());
|
47 |
$this->assertEquals($array['phone_numbers'], $customer->phoneNumbers()->toArray());
|
48 |
+
$this->assertEquals($array['gender'], $customer->gender()->toString());
|
49 |
+
$this->assertEquals($array['birthdate'], $customer->birthdate()->toString());
|
50 |
+
$this->assertEquals($array['ip_address'], $customer->ip()->toString());
|
51 |
}
|
52 |
|
53 |
/**
|
66 |
'housenumber' => '29 A-12',
|
67 |
'country' => 'NL',
|
68 |
'phone_numbers' => [],
|
69 |
+
'locale' => null,
|
70 |
+
'gender' => 'male',
|
71 |
+
'birthdate' => '1988-03-29',
|
72 |
+
'ip_address' => '2001:0db8:85a3:0000:0000:8a2e:0370:7334'
|
73 |
];
|
74 |
|
75 |
$this->assertEquals(
|
95 |
$this->assertNull($customer->housenumber());
|
96 |
$this->assertNull($customer->country());
|
97 |
$this->assertNull($customer->phoneNumbers());
|
98 |
+
$this->assertNull($customer->gender());
|
99 |
+
$this->assertNull($customer->birthdate());
|
100 |
}
|
101 |
}
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Tests\Order;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Order\OrderLine;
|
6 |
+
|
7 |
+
final class OrderLineTest extends \PHPUnit_Framework_TestCase
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @test
|
11 |
+
*/
|
12 |
+
public function itShouldCreateFromArray()
|
13 |
+
{
|
14 |
+
$orderLineData = self::getOrderLinesData();
|
15 |
+
|
16 |
+
$orderLine = OrderLine::fromArray($orderLineData);
|
17 |
+
|
18 |
+
$this->assertInstanceOf(
|
19 |
+
'GingerPayments\Payment\Order\OrderLine',
|
20 |
+
$orderLine
|
21 |
+
);
|
22 |
+
|
23 |
+
$this->assertEquals(
|
24 |
+
$orderLine->toArray(),
|
25 |
+
$orderLineData
|
26 |
+
);
|
27 |
+
|
28 |
+
$this->assertEquals($orderLineData['id'], $orderLine->getId());
|
29 |
+
$this->assertEquals($orderLineData['ean'], $orderLine->getEan());
|
30 |
+
$this->assertEquals($orderLineData['url'], $orderLine->getUrl());
|
31 |
+
$this->assertEquals($orderLineData['name'], $orderLine->getName());
|
32 |
+
$this->assertEquals($orderLineData['type'], $orderLine->getType());
|
33 |
+
$this->assertEquals($orderLineData['amount'], $orderLine->getAmount());
|
34 |
+
$this->assertEquals($orderLineData['currency'], $orderLine->getCurrency());
|
35 |
+
$this->assertEquals($orderLineData['quantity'], $orderLine->getQuantity());
|
36 |
+
$this->assertEquals($orderLineData['image_url'], $orderLine->getImageUrl());
|
37 |
+
$this->assertEquals($orderLineData['discount_rate'], $orderLine->getDiscountRate());
|
38 |
+
$this->assertEquals($orderLineData['vat_percentage'], $orderLine->getVatPercentage());
|
39 |
+
$this->assertEquals($orderLineData['merchant_order_line_id'], $orderLine->getMerchantOrderLineId());
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @test
|
44 |
+
*/
|
45 |
+
public function itShouldGuardRequiredFields()
|
46 |
+
{
|
47 |
+
$this->setExpectedException('Assert\InvalidArgumentException');
|
48 |
+
OrderLine::fromArray([]);
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @test
|
53 |
+
*/
|
54 |
+
public function itShouldSetNotRequiredValuesToNull()
|
55 |
+
{
|
56 |
+
$orderLineData = [
|
57 |
+
'name' => "Order Item #1",
|
58 |
+
'amount' => 1299,
|
59 |
+
'quantity' => 1,
|
60 |
+
'currency' => 'EUR',
|
61 |
+
'vat_percentage' => 0,
|
62 |
+
'merchant_order_line_id' => "AAA001"
|
63 |
+
];
|
64 |
+
|
65 |
+
$orderLine = OrderLine::fromArray($orderLineData);
|
66 |
+
|
67 |
+
$this->assertNull($orderLine->id());
|
68 |
+
$this->assertNull($orderLine->ean());
|
69 |
+
$this->assertNull($orderLine->url());
|
70 |
+
$this->assertNull($orderLine->type());
|
71 |
+
$this->assertNull($orderLine->imageUrl());
|
72 |
+
$this->assertNull($orderLine->discountRate());
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* @test
|
77 |
+
*/
|
78 |
+
public function itShouldValidateFields()
|
79 |
+
{
|
80 |
+
$orderLine = OrderLine::fromArray(self::getOrderLinesData());
|
81 |
+
|
82 |
+
$this->assertTrue($orderLine->currency()->isEUR());
|
83 |
+
$this->assertTrue($orderLine->type()->isPhysical());
|
84 |
+
$this->assertFalse($orderLine->type()->isDiscount());
|
85 |
+
$this->assertFalse($orderLine->type()->isShippingFee());
|
86 |
+
}
|
87 |
+
|
88 |
+
public static function getOrderLinesData()
|
89 |
+
{
|
90 |
+
return [
|
91 |
+
'id' => '5ac3eb32-384d-4d61-a797-9f44b1cd70e5',
|
92 |
+
'ean' => '9780471117094',
|
93 |
+
'url' => 'https://example.com/',
|
94 |
+
'name' => 'Order Item Name #1',
|
95 |
+
'type' => 'physical',
|
96 |
+
'amount' => 1299,
|
97 |
+
'currency' => 'EUR',
|
98 |
+
'quantity' => 1,
|
99 |
+
'image_url' => 'https://example.com/image.jpg',
|
100 |
+
'discount_rate' => 0,
|
101 |
+
'vat_percentage' => 0,
|
102 |
+
'merchant_order_line_id' => 'AAA111'
|
103 |
+
];
|
104 |
+
}
|
105 |
+
}
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GingerPayments\Payment\Tests\Order;
|
4 |
+
|
5 |
+
use GingerPayments\Payment\Order\OrderLines;
|
6 |
+
|
7 |
+
final class OrderLinesTest extends \PHPUnit_Framework_TestCase
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @test
|
11 |
+
*/
|
12 |
+
public function itShouldCreate()
|
13 |
+
{
|
14 |
+
$this->assertInstanceOf(
|
15 |
+
'GingerPayments\Payment\Order\OrderLines',
|
16 |
+
OrderLines::create()
|
17 |
+
);
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @test
|
22 |
+
*/
|
23 |
+
public function itShouldCreateFromArray()
|
24 |
+
{
|
25 |
+
$this->assertInstanceOf(
|
26 |
+
'GingerPayments\Payment\Order\OrderLines',
|
27 |
+
OrderLines::fromArray([])
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* @test
|
33 |
+
*/
|
34 |
+
public function itShouldBeTraversable()
|
35 |
+
{
|
36 |
+
$iterations = 0;
|
37 |
+
foreach (OrderLines::fromArray(self::getOrderLinesData()) as $key => $orderLine) {
|
38 |
+
$this->assertEquals($iterations, $key);
|
39 |
+
$this->assertInstanceOf('GingerPayments\Payment\Order\OrderLine', $orderLine);
|
40 |
+
$iterations++;
|
41 |
+
}
|
42 |
+
$this->assertEquals(2, $iterations);
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* @test
|
47 |
+
*/
|
48 |
+
public function itShouldConvertToArray()
|
49 |
+
{
|
50 |
+
$array = self::getOrderLinesData();
|
51 |
+
|
52 |
+
$this->assertEquals(
|
53 |
+
$array,
|
54 |
+
OrderLines::fromArray($array)->toArray()
|
55 |
+
);
|
56 |
+
}
|
57 |
+
|
58 |
+
public static function getOrderLinesData()
|
59 |
+
{
|
60 |
+
return [
|
61 |
+
[
|
62 |
+
'id' => '5ac3eb32-384d-4d61-a797-9f44b1cd70e5',
|
63 |
+
'ean' => '9780471117094',
|
64 |
+
'url' => 'https://example.com/',
|
65 |
+
'name' => 'Order Item Name #1',
|
66 |
+
'type' => 'physical',
|
67 |
+
'amount' => 1299,
|
68 |
+
'currency' => 'EUR',
|
69 |
+
'quantity' => 1,
|
70 |
+
'image_url' => 'https://example.com/image.jpg',
|
71 |
+
'discount_rate' => 0,
|
72 |
+
'vat_percentage' => 0,
|
73 |
+
'merchant_order_line_id' => 'AAA222'
|
74 |
+
],
|
75 |
+
[
|
76 |
+
'id' => '5ac3eb32-384d-4d61-a797-9f44b1cd70e5',
|
77 |
+
'ean' => '9780471117094',
|
78 |
+
'url' => 'https://example.com/',
|
79 |
+
'name' => 'Order Item Name #1',
|
80 |
+
'type' => 'physical',
|
81 |
+
'amount' => 1299,
|
82 |
+
'currency' => 'EUR',
|
83 |
+
'quantity' => 10,
|
84 |
+
'image_url' => 'https://example.com/image.jpg',
|
85 |
+
'discount_rate' => 1000,
|
86 |
+
'vat_percentage' => 2000,
|
87 |
+
'merchant_order_line_id' => 'AAA222'
|
88 |
+
]
|
89 |
+
];
|
90 |
+
}
|
91 |
+
}
|
@@ -63,6 +63,20 @@ final class PaymentMethodDetailsFactoryTest extends \PHPUnit_Framework_TestCase
|
|
63 |
);
|
64 |
}
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
/**
|
67 |
* @test
|
68 |
*/
|
63 |
);
|
64 |
|