diff --git a/CHANGELOG.md b/CHANGELOG.md index a63a45f..b0fde2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased][unreleased] -- + +## [2.0.2] - 2021-08-19 +- Adyen drop-in gateway supports Klarna Pay Later payment method. ## [2.0.1] - 2021-08-17 - No longer require PHP `intl` extensie. @@ -87,7 +89,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 1.0.0 - 2019-03-28 - First release. -[unreleased]: https://github.com/wp-pay-gateways/adyen/compare/2.0.1...HEAD +[unreleased]: https://github.com/wp-pay-gateways/adyen/compare/2.0.2...HEAD +[2.0.2]: https://github.com/wp-pay-gateways/adyen/compare/2.0.1...2.0.2 [2.0.1]: https://github.com/wp-pay-gateways/adyen/compare/2.0.0...2.0.1 [2.0.0]: https://github.com/wp-pay-gateways/adyen/compare/1.3.2...2.0.0 [1.3.2]: https://github.com/wp-pay-gateways/adyen/compare/1.3.1...1.3.2 diff --git a/composer.json b/composer.json index bef7dda..8f1d18d 100644 --- a/composer.json +++ b/composer.json @@ -52,6 +52,13 @@ "wp-phpunit/wp-phpunit": "^5.8" }, "scripts": { + "ci": [ + "@phplint", + "@phpcs", + "@coverage", + "@phpstan", + "@psalm" + ], "coveralls": "vendor/bin/php-coveralls -v", "phpcbf": "vendor/bin/phpcbf", "phpcs": "XDEBUG_MODE=off vendor/bin/phpcs -s -v", diff --git a/package.json b/package.json index d769372..0fcea6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "adyen", - "version": "2.0.1", + "version": "2.0.2", "description": "Adyen driver for the WordPress payment processing library.", "repository": { "type": "git", diff --git a/pronamic-pay-adyen.php b/pronamic-pay-adyen.php index b95aec4..811a29e 100644 --- a/pronamic-pay-adyen.php +++ b/pronamic-pay-adyen.php @@ -4,7 +4,7 @@ * Plugin URI: https://www.pronamic.eu/plugins/pronamic-pay-adyen/ * Description: Extend the Pronamic Pay plugin with the Adyen gateway to receive payments with Adyen through a variety of WordPress plugins. * - * Version: 2.0.1 + * Version: 2.0.2 * Requires at least: 4.7 * * Author: Pronamic diff --git a/readme.txt b/readme.txt index fad4b12..30661a7 100644 --- a/readme.txt +++ b/readme.txt @@ -4,6 +4,6 @@ Tags: pronamic, pay, adyen, add-on Requires at least: 4.7 Tested up to: 5.1 Requires PHP: 5.3 -Stable tag: 2.0.1 +Stable tag: 2.0.2 Extend the Pronamic Pay plugin with the Adyen gateway to receive payments with Adyen through a variety of WordPress plugins. diff --git a/src/DropInGateway.php b/src/DropInGateway.php index 2eddfcd..14a36d1 100644 --- a/src/DropInGateway.php +++ b/src/DropInGateway.php @@ -23,7 +23,7 @@ * @link https://github.com/adyenpayments/php/blob/master/generatepaymentform.php * * @author Remco Tolsma - * @version 1.2.1 + * @version 2.0.2 * @since 1.0.0 */ class DropInGateway extends AbstractGateway { @@ -68,6 +68,7 @@ public function get_supported_payment_methods() { PaymentMethods::GIROPAY, PaymentMethods::GOOGLE_PAY, PaymentMethods::IDEAL, + PaymentMethods::KLARNA_PAY_LATER, PaymentMethods::SOFORT, PaymentMethods::SWISH, PaymentMethods::VIPPS, @@ -520,7 +521,13 @@ public function get_checkout_payment_methods_configuration( $payment_method_type ), ); - // Line items. + /** + * Line Items. + * + * @link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/1916120-lineitems + * @link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaylineitem + * @link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaylineitem/1916086-amount + */ $lines = $payment->get_lines(); if ( null !== $lines ) { @@ -529,7 +536,7 @@ public function get_checkout_payment_methods_configuration( $payment_method_type foreach ( $lines as $line ) { $line_items[] = array( 'label' => $line->get_name(), - 'amount' => (string) $line->get_total_amount()->get_value(), + 'amount' => $line->get_total_amount()->number_format( null, '.', '' ), 'type' => 'final', ); } diff --git a/src/Integration.php b/src/Integration.php index 7d733eb..3f6e7a0 100644 --- a/src/Integration.php +++ b/src/Integration.php @@ -96,7 +96,11 @@ public function setup() { // Actions. add_action( 'current_screen', array( $this, 'maybe_download_certificate_or_key' ) ); - \add_filter( 'pronamic_gateway_configuration_display_value_' . $this->get_id(), array( $this, 'gateway_configuration_display_value' ), 10, 2 ); + $id = $this->get_id(); + + if ( null !== $id ) { + \add_filter( 'pronamic_gateway_configuration_display_value_' . $id, array( $this, 'gateway_configuration_display_value' ), 10, 2 ); + } } /** diff --git a/src/Util.php b/src/Util.php index dd5c13e..5e2235d 100644 --- a/src/Util.php +++ b/src/Util.php @@ -79,7 +79,7 @@ public static function get_country_code( Payment $payment ) { } } - if ( null === $country_code && \method_exists( '\Locale', 'getRegion' ) ) { + if ( null === $country_code && \class_exists( '\Locale' ) ) { $locale = self::get_payment_locale( $payment ); $country_code = \Locale::getRegion( $locale ); diff --git a/vendor-bin/psalm/composer.lock b/vendor-bin/psalm/composer.lock index 77e45f6..e8e84a8 100644 --- a/vendor-bin/psalm/composer.lock +++ b/vendor-bin/psalm/composer.lock @@ -1827,16 +1827,16 @@ }, { "name": "vimeo/psalm", - "version": "4.9.2", + "version": "4.9.3", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "00c062267d6e3229d91a1939992987e2d46f2393" + "reference": "4c262932602b9bbab5020863d1eb22d49de0dbf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/00c062267d6e3229d91a1939992987e2d46f2393", - "reference": "00c062267d6e3229d91a1939992987e2d46f2393", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/4c262932602b9bbab5020863d1eb22d49de0dbf4", + "reference": "4c262932602b9bbab5020863d1eb22d49de0dbf4", "shasum": "" }, "require": { @@ -1878,7 +1878,6 @@ "slevomat/coding-standard": "^7.0", "squizlabs/php_codesniffer": "^3.5", "symfony/process": "^4.3 || ^5.0", - "weirdan/phpunit-appveyor-reporter": "^1.0.0", "weirdan/prophecy-shim": "^1.0 || ^2.0" }, "suggest": { @@ -1926,9 +1925,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.9.2" + "source": "https://github.com/vimeo/psalm/tree/4.9.3" }, - "time": "2021-08-01T01:15:26+00:00" + "time": "2021-08-14T16:19:38+00:00" }, { "name": "webmozart/assert", diff --git a/views/checkout-drop-in.php b/views/checkout-drop-in.php index 32c3f32..6ce65ce 100644 --- a/views/checkout-drop-in.php +++ b/views/checkout-drop-in.php @@ -19,32 +19,29 @@
+
- - -
-
-

+
+
+

-
-
-
get_date()->format_i18n() ); ?>
+
+
+
get_date()->format_i18n() ); ?>
-
-
get_description() ); ?>
+
+
get_description() ); ?>
-
-
get_total_amount()->format_i18n() ); ?>
-
-
+
+
get_total_amount()->format_i18n() ); ?>
+
- - +
diff --git a/views/checkout-web-sdk.php b/views/checkout-web-sdk.php index 42bb643..0f35965 100644 --- a/views/checkout-web-sdk.php +++ b/views/checkout-web-sdk.php @@ -19,32 +19,29 @@
+
- - -
-
-

+
+
+

-
-
-
get_date()->format_i18n() ); ?>
+
+
+
get_date()->format_i18n() ); ?>
-
-
get_description() ); ?>
+
+
get_description() ); ?>
-
-
get_total_amount()->format_i18n() ); ?>
-
-
+
+
get_total_amount()->format_i18n() ); ?>
+
- - +