Skip to content

Commit

Permalink
Merge branch 'release/4.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rvdsteege committed Jul 1, 2022
2 parents f3f7fdf + b9026bd commit 4c7a58a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased][unreleased]

## [4.1.0] - 2022-07-01
### Changed
- Added WordPress network ID and blog ID to merchant reference ([#1](https://github.com/pronamic/wp-pronamic-pay-adyen/issues/1)).

## [4.0.0] - 2022-05-30
### Removed
- ⚠️ Removed the web SDK gateway, which functioned without origin key, manual [migration to client key](https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key) is required!
Expand Down Expand Up @@ -146,8 +150,9 @@ 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/pronamic/wp-pronamic-pay-adyen/compare/4.0.0-RC-1...HEAD
[4.0.0-RC-1]: https://github.com/pronamic/wp-pronamic-pay-adyen/compare/3.1.1...4.0.0-RC-1
[unreleased]: https://github.com/pronamic/wp-pronamic-pay-adyen/compare/4.1.0...HEAD
[4.0.0]: https://github.com/pronamic/wp-pronamic-pay-adyen/compare/4.0.0...4.1.0
[4.0.0]: https://github.com/pronamic/wp-pronamic-pay-adyen/compare/3.1.1...4.0.0
[3.1.1]: https://github.com/pronamic/wp-pronamic-pay-adyen/compare/3.1.0...3.1.1
[3.1.0]: https://github.com/pronamic/wp-pronamic-pay-adyen/compare/3.0.1...3.1.0
[3.0.1]: https://github.com/pronamic/wp-pronamic-pay-adyen/compare/3.0.0...3.0.1
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": "4.0.0",
"version": "4.1.0",
"description": "Adyen driver for the WordPress payment processing library.",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions pronamic-pay-adyen.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* 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: 4.0.0
* Requires at least: 4.7
* Version: 4.1.0
* Requires at least: 5.9
*
* Author: Pronamic
* Author URI: https://www.pronamic.eu/
Expand Down
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
=== Pronamic Pay Adyen Add-On ===
Contributors: pronamic, remcotolsma
Tags: pronamic, pay, adyen, add-on
Requires at least: 4.7
Requires at least: 5.9
Tested up to: 6.0
Requires PHP: 7.4
Stable tag: 4.0.0
Stable tag: 4.1.0

Extend the Pronamic Pay plugin with the Adyen gateway to receive payments with Adyen through a variety of WordPress plugins.
4 changes: 2 additions & 2 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function start( Payment $payment ) {
$payment_request = new PaymentRequest(
AmountTransformer::transform( $payment->get_total_amount() ),
$this->config->get_merchant_account(),
$payment_id,
\sprintf( '%s-%s-%s', \get_current_network_id(), \get_current_blog_id(), $payment_id ),
$this->get_payment_return_url( $payment_id ),
$payment_method_details
);
Expand Down Expand Up @@ -273,7 +273,7 @@ public function payment_redirect( Payment $payment ) {
$request = new PaymentSessionRequest(
AmountTransformer::transform( $payment->get_total_amount() ),
$this->config->get_merchant_account(),
$payment_id,
\sprintf( '%s-%s-%s', \get_current_network_id(), \get_current_blog_id(), $payment_id ),
$this->get_payment_return_url( $payment_id )
);

Expand Down
14 changes: 13 additions & 1 deletion src/NotificationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,19 @@ public function rest_api_adyen_notifications( WP_REST_Request $request ) {
}

foreach ( $notification_request->get_items() as $item ) {
$payment = get_pronamic_payment( $item->get_merchant_reference() );
$payment_id = $item->get_merchant_reference();

if ( \str_contains( $payment_id, '-' ) ) {
list( $scan_network_id, $scan_blog_id, $scan_payment_id ) = \sscanf( $payment_id, '%d-%d-%s' );

$payment_id = null;

if ( \get_current_network_id() === $scan_network_id && \get_current_blog_id() === $scan_blog_id ) {
$payment_id = $scan_payment_id;
}
}

$payment = get_pronamic_payment( $payment_id );

if ( null === $payment ) {
continue;
Expand Down

0 comments on commit 4c7a58a

Please sign in to comment.