Skip to content

Commit

Permalink
Fix connection array merge error (#3355)
Browse files Browse the repository at this point in the history
* Fix connection array merge error

* Adding PHP 8.1 to the list of testable versions

* Changing PHPUnit version for PHP 8.1 (using 10.5.29)

* Changing PHPUnit version for PHP 8.1 (using 10.5.29)

* Revert test changes (will be moved to another PR)

* Checking if the default options value is an array

* Changelog and readme entries

---------

Co-authored-by: Diego Curbelo <[email protected]>
  • Loading branch information
wjrosa and diegocurbelo authored Aug 14, 2024
1 parent 4486978 commit 4b71491
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** Changelog ***

= 8.7.0 - xxxx-xx-xx =
* Fix - Fix possible fatal errors when Stripe settings format is invalid during account connection.
* Add - Log incoming webhook events and their request body.
* Add - Show UPE payment methods in saved order on block checkout page.
* Tweak - Delete the notice about the missing customization options on the updated checkout experience.
Expand Down
3 changes: 2 additions & 1 deletion includes/connect/class-wc-stripe-connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ private function save_stripe_keys( $result, $type = 'connect', $mode = 'live' )
$is_test = 'live' !== $mode;
$prefix = $is_test ? 'test_' : '';
$default_options = $this->get_default_stripe_config();
$options = array_merge( $default_options, get_option( self::SETTINGS_OPTION, [] ) );
$current_options = get_option( self::SETTINGS_OPTION, [] );
$options = array_merge( $default_options, is_array( $current_options ) ? $current_options : [] );
$options['enabled'] = 'yes';
$options['testmode'] = $is_test ? 'yes' : 'no';
$options['upe_checkout_experience_enabled'] = $this->get_upe_checkout_experience_enabled();
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ If you get stuck, you can ask for help in the Plugin Forum.
== Changelog ==

= 8.7.0 - xxxx-xx-xx =
* Fix - Fix possible fatal errors when Stripe settings format is invalid during account connection.
* Add - Log incoming webhook events and their request body.
* Add - Show UPE payment methods in saved order on block checkout page.
* Tweak - Delete the notice about the missing customization options on the updated checkout experience.
Expand Down

0 comments on commit 4b71491

Please sign in to comment.