-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [#555] Another Stripe Onboarding Redirect Handler * [#555] FIx a Stripe error trying to trim null values. * [#555] Prevent onboarding from being updated again. * [#567] Adjust the site status value via REST API * [#567] Updated vars sent to JS * [#567] Removed unused JS Vars * [#567] Changed to local var. * [#567] JS Vars (#589) - Adds JS variables for site id --------- Co-authored-by: Nick <[email protected]>
- Loading branch information
1 parent
3a1da1a
commit f1e1756
Showing
10 changed files
with
171 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
client-mu-plugins/goodbids/src/classes/Plugins/WooCommerce/Stripe.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* WooCommerce Stripe Tweaks | ||
* | ||
* @since 1.0.0 | ||
* @package GoodBids | ||
*/ | ||
|
||
namespace GoodBids\Plugins\WooCommerce; | ||
|
||
/** | ||
* Stripe Tweaks | ||
* | ||
* @since 1.0.0 | ||
*/ | ||
class Stripe { | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @since 1.0.0 | ||
*/ | ||
public function __construct() { | ||
// Change nulls to empty strings. | ||
$this->clear_stripe_nulls(); | ||
} | ||
|
||
/** | ||
* Fix an error where nulls are trimmed. | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @return void | ||
*/ | ||
private function clear_stripe_nulls(): void { | ||
$clear_nulls = function ( array $settings ) : array { | ||
foreach ( $settings as $key => $value ) { | ||
if ( is_null( $value ) ) { | ||
$settings[ $key ] = ''; | ||
} | ||
} | ||
return $settings; | ||
}; | ||
|
||
add_filter( 'option_woocommerce_stripe_settings', $clear_nulls, 50 ); | ||
add_filter( 'default_option_woocommerce_stripe_settings', $clear_nulls, 50 ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters