Skip to content

Commit

Permalink
Merge branch 'release/2.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Aug 19, 2021
2 parents 87de8f1 + 3ac8f2c commit a69b664
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 49 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion pronamic-pay-adyen.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
13 changes: 10 additions & 3 deletions src/DropInGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 ) {
Expand All @@ -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',
);
}
Expand Down
6 changes: 5 additions & 1 deletion src/Integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
13 changes: 6 additions & 7 deletions vendor-bin/psalm/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 13 additions & 16 deletions views/checkout-drop-in.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,29 @@
<body>
<div class="pronamic-pay-redirect-page">
<div class="pronamic-pay-redirect-container">

<div class="pp-page-section-container">
<div class="pp-page-section-wrapper">
<div id="pronamic-pay-checkout"></div>
</div>
</div>

<?php if ( isset( $payment ) ) : ?>

<div class="pp-page-section-container">
<div class="pp-page-section-wrapper alignleft">
<h1><?php esc_html_e( 'Payment', 'pronamic_ideal' ); ?></h1>
<div class="pp-page-section-container">
<div class="pp-page-section-wrapper alignleft">
<h1><?php esc_html_e( 'Payment', 'pronamic_ideal' ); ?></h1>

<dl>
<dt><?php esc_html_e( 'Date', 'pronamic_ideal' ); ?></dt>
<dd><?php echo esc_html( $payment->get_date()->format_i18n() ); ?></dd>
<dl>
<dt><?php esc_html_e( 'Date', 'pronamic_ideal' ); ?></dt>
<dd><?php echo esc_html( $payment->get_date()->format_i18n() ); ?></dd>

<dt><?php esc_html_e( 'Description', 'pronamic_ideal' ); ?></dt>
<dd><?php echo esc_html( $payment->get_description() ); ?></dd>
<dt><?php esc_html_e( 'Description', 'pronamic_ideal' ); ?></dt>
<dd><?php echo esc_html( (string) $payment->get_description() ); ?></dd>

<dt><?php esc_html_e( 'Amount', 'pronamic_ideal' ); ?></dt>
<dd><?php echo esc_html( $payment->get_total_amount()->format_i18n() ); ?></dd>
</dl>
</div>
<dt><?php esc_html_e( 'Amount', 'pronamic_ideal' ); ?></dt>
<dd><?php echo esc_html( $payment->get_total_amount()->format_i18n() ); ?></dd>
</dl>
</div>

<?php endif; ?>
</div>

</div>
</div>
Expand Down
29 changes: 13 additions & 16 deletions views/checkout-web-sdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,29 @@
<body>
<div class="pronamic-pay-redirect-page">
<div class="pronamic-pay-redirect-container">

<div class="pp-page-section-container">
<div class="pp-page-section-wrapper">
<div id="pronamic-pay-checkout"></div>
</div>
</div>

<?php if ( isset( $payment ) ) : ?>

<div class="pp-page-section-container">
<div class="pp-page-section-wrapper alignleft">
<h1><?php esc_html_e( 'Payment', 'pronamic_ideal' ); ?></h1>
<div class="pp-page-section-container">
<div class="pp-page-section-wrapper alignleft">
<h1><?php esc_html_e( 'Payment', 'pronamic_ideal' ); ?></h1>

<dl>
<dt><?php esc_html_e( 'Date', 'pronamic_ideal' ); ?></dt>
<dd><?php echo esc_html( $payment->get_date()->format_i18n() ); ?></dd>
<dl>
<dt><?php esc_html_e( 'Date', 'pronamic_ideal' ); ?></dt>
<dd><?php echo esc_html( $payment->get_date()->format_i18n() ); ?></dd>

<dt><?php esc_html_e( 'Description', 'pronamic_ideal' ); ?></dt>
<dd><?php echo esc_html( $payment->get_description() ); ?></dd>
<dt><?php esc_html_e( 'Description', 'pronamic_ideal' ); ?></dt>
<dd><?php echo esc_html( (string) $payment->get_description() ); ?></dd>

<dt><?php esc_html_e( 'Amount', 'pronamic_ideal' ); ?></dt>
<dd><?php echo esc_html( $payment->get_total_amount()->format_i18n() ); ?></dd>
</dl>
</div>
<dt><?php esc_html_e( 'Amount', 'pronamic_ideal' ); ?></dt>
<dd><?php echo esc_html( $payment->get_total_amount()->format_i18n() ); ?></dd>
</dl>
</div>

<?php endif; ?>
</div>

</div>
</div>
Expand Down

0 comments on commit a69b664

Please sign in to comment.