Skip to content

Release branch/2.5.2 #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b9de0ed
do not display the separator on minicart if button should be hidden
alexiglesias31 Dec 14, 2023
931aca9
allow to change subscriptions to amazon pay classic
alexiglesias31 Dec 22, 2023
3641d74
adjust for express gateway and notice
alexiglesias31 Dec 22, 2023
de92c80
Remove hide standard checkout button setting
alexiglesias31 Dec 27, 2023
00a98e7
update dependencies
alexiglesias31 Dec 28, 2023
56be8c2
fix estimated order amount
alexiglesias31 Dec 28, 2023
4c87ee0
add tests for estimated order amount
alexiglesias31 Dec 28, 2023
cac2fd8
Fix compatibility with Product Add-on
alexiglesias31 Dec 28, 2023
abb6624
Fix compatibility with GForm Add-on
alexiglesias31 Dec 28, 2023
f8acbc9
handle fields with multiple options
alexiglesias31 Dec 28, 2023
77494fe
Update composer packages - polyfills required
alexiglesias31 Dec 29, 2023
a93dbd6
Force decimals with JPY always to be 0
alexiglesias31 Dec 30, 2023
0f5cd5c
format charge amount
alexiglesias31 Dec 30, 2023
983f2dc
format recurring charge amount
alexiglesias31 Dec 30, 2023
3fec85b
use plugin's method
alexiglesias31 Jan 19, 2024
a459cfb
product_id should be sent only once
alexiglesias31 Jan 31, 2024
520acb6
Support subscription switch on express checkout
alexiglesias31 Feb 14, 2024
c37be82
fix product type on variable products
alexiglesias31 Feb 14, 2024
f831934
fix issue processing ajax response
alexiglesias31 Feb 14, 2024
2898f7d
update makepot process to include build js strings
alexiglesias31 Apr 8, 2024
edf88be
simplify pot file generation
alexiglesias31 Apr 19, 2024
a7ea54d
update npm dependencies
alexiglesias31 Apr 19, 2024
109f839
Merge remote-tracking branch 'origin/fix/hide-or-separator-minicart' …
alexiglesias31 Jun 26, 2024
f163b57
Merge remote-tracking branch 'origin/fix/error-when-switch-to-paypal'…
alexiglesias31 Jun 26, 2024
daafe01
Merge remote-tracking branch 'origin/fix/remove-hide-checkout-button-…
alexiglesias31 Jun 26, 2024
6c083b4
Merge remote-tracking branch 'origin/update/composer-polyfills' into …
alexiglesias31 Jun 26, 2024
f14f023
Merge remote-tracking branch 'origin/fix/error-jpy-decimals' into rel…
alexiglesias31 Jun 26, 2024
8c1f626
Merge remote-tracking branch 'origin/fix/error-non-standard-decimals'…
alexiglesias31 Jun 26, 2024
2574a19
Merge remote-tracking branch 'origin/fix/add-compatibility-product-ad…
alexiglesias31 Jun 26, 2024
410436a
Merge remote-tracking branch 'origin/fix/issue-js-translations' into …
alexiglesias31 Jun 26, 2024
5d0ca7d
Prevent bail of API routes
alexiglesias31 Jun 27, 2024
2fce50f
Merge branch 'fix/issue-register-api-routes' into release-branch/2.5.2
alexiglesias31 Jun 27, 2024
7c0e7f5
Release 2.5.2
lauramelos Jul 22, 2024
5fb0005
Update tested versions
lauramelos Jul 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Thumbs.db
.settings*
.vscode
.phpunit.result.cache
woorelease.phar
sftp-config.json
/deploy/
/wc-apidocs/
Expand Down
117 changes: 117 additions & 0 deletions bin/update-pot-file-references.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?php
// phpcs:ignoreFile - This is an auxiliary build tool, and not part of the plugin.

/**
* Command line script for updating the file references of JS files in a .pot file.
*/

use phpDocumentor\Reflection\DocBlock\Tags\Var_;

/**
* Get the file name from the command line.
*/
if ( $argc !== 2 ) {
echo "Usage: {$argc} php -f {$argv[0]} file.pot\n";
exit;
}

$pot_filename = $argv[1];

if ( ! is_file( $pot_filename ) ) {
echo "[ERROR] File not found: {$pot_filename}\n";
exit;
}

/**
* Parses a .pot file into an array.
*
* @param string $file_name Pot file name.
* @return array Translation messages
*/
function read_pot_translations( string $file_name ): array {
$fh = fopen( $file_name, 'r' );
$originals = [];
$references = [];
$messages = [];
$have_msgid = false;

while ( ! feof( $fh ) ) {
$line = trim( fgets( $fh ) );
if ( ! $line ) {
$message = implode( "\n", $messages );
$originals[ $message ] = $references;
$references = [];
$messages = [];
$have_msgid = false;
continue;
}

if ( 'msgid' == substr( $line, 0, 5 ) ) {
$have_msgid = true;
}

if ( $have_msgid ) {
$messages[] = $line;
} else {
$references[] = $line;
}
}

fclose( $fh );

$message = implode( "\n", $messages );
$originals[ $message ] = $references;
return $originals;
}

/**
* Add the transpiled file path to the references of the translation messages.
*
* @param array $translations POT translations (including references/comments).
* @return array Translation messages
*/
function add_transpiled_filepath_reference_to_comments( array $translations ): array {
foreach ( $translations as $message => $references ) {
// Check references for js/jsx/ts/tsx files
$dist_js_to_add = [];
foreach ( $references as $i => $ref ) {
if ( preg_match( '%^#: (build.+)(\.(js|jsx|ts|tsx)):\d+$%', $ref, $m ) ) {
if ( preg_match( '%\.min\.js$%', $m[1] ) ) {
unset( $translations[ $message ][ $i ] );
continue;
}
if ( empty( $m[2] ) ) {
continue;
}
$dist_js_to_add[] = "#: {$m[1]}.min{$m[2]}:1";
}
}

// Add the new file references to the top of the list.
if ( ! empty( $dist_js_to_add ) ) {
array_splice( $translations[ $message], 0, 0, array_unique( $dist_js_to_add ) );
}
}

return $translations;
}

// Read the translation .pot file.
$translations = read_pot_translations( $pot_filename );

// For transpiled JS client files, we need to add a reference to the generated build file.
$translations = add_transpiled_filepath_reference_to_comments( $translations );

// Delete the original source.
unlink( $pot_filename );

$fh = fopen( $pot_filename, 'w' );

foreach ( $translations as $message => $original ) {
fwrite( $fh, implode( "\n", $original ) );
fwrite( $fh, "\n" . $message . "\n\n" );
}

fclose( $fh );

echo "Updated {$pot_filename}\n";
8 changes: 8 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
*** Amazon Pay Changelog ***

= 2.5.2 - 2024-xx-xx =

* Fix - Error when using a non Standard decimal amount for a currency.
* Fix - chargeAmount.Amount is invalid when changing currency after selecting other shipping address.
* Fix - Hide the -OR- on Minicart when selecting "Enable hide button mode".
* Fix - Change Payment Method for a Subscription Paid with another Payment Method.
* Fix - Express Checkout on Product page not getting the values of the variations created by WooCommerce Product Add-Ons and Gravity Forms Product Add-ons

= 2.5.1 - 2023-10-30 =

* Add - New Amazon Pay Platform related Headers.
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"php-stubs/woocommerce-stubs": "^5.1",
"szepeviktor/phpstan-wordpress": "^0.7.5",
"phpstan/extension-installer": "^1.1",
"yoast/phpunit-polyfills": "^1.0"
"yoast/phpunit-polyfills": "^1.0",
"wp-cli/wp-cli-bundle": "*"
},
"require": {
"amzn/amazon-pay-api-sdk-php": "2.6.2",
Expand Down
Loading
Loading