Closed remcotolsma closed 2 years ago
Another point of attention is that if Adyen users update the Pronamic Pay plugin and not the Pronamic Pay Adyen Add-On, they will still run on the new Adyen code. This has to do with the way we want to avoid Composer dependencies problems. In that regard, the https://wordpress.org/plugins/woocommerce-gateway-paypal-express-checkout/ → https://wordpress.org/plugins/woocommerce-paypal-payments/ approach is also interesting.
Admin notice implementation:
add_action(
'admin_notices',
function() {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
$query = new WP_Query(
[
'post_type' => 'pronamic_gateway',
'posts_per_page' => 10,
'meta_query' => [
'relation' => 'AND',
[
'key' => '_pronamic_gateway_id',
'compare' => 'IN',
'value' => [
'adyen',
'adyen-test',
],
],
[
'relation' => 'OR',
[
'key' => '_pronamic_gateway_adyen_client_key',
'compare' => '=',
'value' => '',
],
[
'key' => '_pronamic_gateway_adyen_client_key',
'compare' => 'NOT EXISTS',
],
],
]
]
);
if ( empty( $query->posts ) ) {
return;
}
?>
<div class="error notice">
<p>
<strong><?php esc_html_e( 'Pronamic Pay', 'pronamic_ideal' ); ?></strong> —
<?php \esc_html_e( 'The following Ayden configurations must be migrated to a client key:', 'pronamic_ideal' ); ?>
</p>
<ul>
<?php foreach ( $query->posts as $adyen_config_post ) : ?>
<li>
<?php
printf(
'<a href="%s">%s</a>',
esc_url( get_edit_post_link( $adyen_config_post ) ),
esc_html( get_the_title( $adyen_config_post ) )
);
?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php
}
);
- Use https://wordpress.org/plugins/woocommerce-gateway-paypal-express-checkout/ → https://wordpress.org/plugins/woocommerce-paypal-payments/ tactics.
Another point of attention is that if Adyen users update the Pronamic Pay plugin and not the Pronamic Pay Adyen Add-On, they will still run on the new Adyen code. This has to do with the way we want to avoid Composer dependencies problems. In that regard, the https://wordpress.org/plugins/woocommerce-gateway-paypal-express-checkout/ → https://wordpress.org/plugins/woocommerce-paypal-payments/ approach is also interesting.
For the Rabobank OmniKassa version '1' to '2' upgrade we did something similar:
https://github.com/wp-pay-gateways/omnikassa → https://github.com/pronamic/wp-pronamic-pay-omnikassa-2
This might not be a bad approach for gateway integrations that cannot be kept backwards compatible.
The https://github.com/pronamic/wp-pronamic-pay-adyen/releases/tag/4.0.0-RC-1 release is breaking backward compatibility since the Adyen Web Drop-in version
5.14.0
configuration requires aclientKey
andenvironment
parameter.https://docs.adyen.com/online-payments/web-drop-in#configure
I've already set it up to throw an exception when these parameters are empty:
https://github.com/pronamic/wp-pronamic-pay-adyen/blob/756d1b632682cb0dde299c3f55b25c5b249dcd30/src/Gateway.php#L296-L306
However, it is not very friendly for site owners that the Adyen gateway no longer works after an update.
We can inform site owners about this in different ways:
upgrade_notice
in https://api.pronamic.nl/plugins/update-check/1.2/ response.The
upgrade_notice
option is only shown on the/wp-admin/update-core.php
page and not on/wp-admin/plugins.php
: