Skip to content

Commit

Permalink
Merge pull request #80 from mwarzybok-sumoheavy/feature/SP-875
Browse files Browse the repository at this point in the history
SP-875 Settings Error on Clean Install
  • Loading branch information
p-maguire committed Mar 8, 2024
2 parents 3f74563 + e6cffda commit 8c876e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion BitPayLib/class-bitpaypaymentsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function check_token(): void {
}

$bitpay_checkout_token = $this->get_bitpay_token();
$bitpay_checkout_endpoint = $this->get_bitpay_gateway_setting( 'bitpay_checkout_endpoint' );
$bitpay_checkout_endpoint = $this->get_bitpay_checkout_endpoint();

if ( ! $bitpay_checkout_token ) {
$message = 'There is no token set for your ' . strtoupper( $bitpay_checkout_endpoint ) . ' environment. BitPay will not function if this is not set.';
Expand Down Expand Up @@ -163,4 +163,9 @@ private function get_bitpay_gateway_setting( string $setting_name, $default_valu
private function get_bitpay_gateway_settings(): array {
return get_option( 'woocommerce_bitpay_checkout_gateway_settings', array() );
}

private function get_bitpay_checkout_endpoint(): string {
// 'test' as default when we don't store options yet (before save configuration)
return $this->get_bitpay_gateway_setting( 'bitpay_checkout_endpoint' ) ?? 'test';
}
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
* Added compatibility with Checkout Blocks
* Fixed Checkout Flow (BitPay Modal)
* Tested compatibility with WordPress 6.4.2
* Fixed issue with exception for missing DB data for plugin in admin panel
* Improved logging IPN requests
* Improved webhook handling to prevent an issue where Order IPN's could update a refunded Order's status to a processable Order status

Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ You can contact our support team via the following form https://bitpay.com/reque
* Added compatibility with Checkout Blocks
* Fixed Checkout Flow (BitPay Modal)
* Tested compatibility with WordPress 6.4.2
* Fixed issue with exception for missing DB data for plugin in admin panel
* Improved logging IPN requests
* Improved webhook handling to prevent an issue where Order IPN's could update a refunded Order's status to a processable Order status

Expand Down

0 comments on commit 8c876e3

Please sign in to comment.