Skip to content

Commit

Permalink
Merge pull request #56 from mwarzybok-sumoheavy/feature/SP-705
Browse files Browse the repository at this point in the history
SP-705 Add variable check
  • Loading branch information
p-maguire authored Sep 25, 2023
2 parents f252e52 + 3889d55 commit 65b00f7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
13 changes: 10 additions & 3 deletions BitPayLib/class-wcgatewaybitpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,18 @@ private function get_icon_on_payment_page(): string {
}

private function get_processing_link(): string {
$bitpay_checkout_options = get_option( 'woocommerce_bitpay_checkout_gateway_settings' );
$bitpay_checkout_endpoint = $bitpay_checkout_options['bitpay_checkout_endpoint'];

$test = 'https://test.bitpay.com/dashboard/settings/edit/order';

$bitpay_checkout_options = get_option( 'woocommerce_bitpay_checkout_gateway_settings' );
if ( ! $bitpay_checkout_options ) { // not configured settings.
return $test;
}

$bitpay_checkout_endpoint = $bitpay_checkout_options['bitpay_checkout_endpoint'] ?? null;
if ( ! $bitpay_checkout_endpoint ) {
return $test;
}

return match ( $bitpay_checkout_endpoint ) {
'production' => 'https://www.bitpay.com/dashboard/settings/edit/order',
default => $test
Expand Down
11 changes: 9 additions & 2 deletions build/BitPayLib/class-wcgatewaybitpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,16 @@ private function get_icon_on_payment_page() : string
}
private function get_processing_link() : string
{
$bitpay_checkout_options = get_option('woocommerce_bitpay_checkout_gateway_settings');
$bitpay_checkout_endpoint = $bitpay_checkout_options['bitpay_checkout_endpoint'];
$test = 'https://test.bitpay.com/dashboard/settings/edit/order';
$bitpay_checkout_options = get_option('woocommerce_bitpay_checkout_gateway_settings');
if (!$bitpay_checkout_options) {
// not configured settings.
return $test;
}
$bitpay_checkout_endpoint = $bitpay_checkout_options['bitpay_checkout_endpoint'] ?? null;
if (!$bitpay_checkout_endpoint) {
return $test;
}
return match ($bitpay_checkout_endpoint) {
'production' => 'https://www.bitpay.com/dashboard/settings/edit/order',
default => $test,
Expand Down
2 changes: 1 addition & 1 deletion build/vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

namespace BitPayVendor;

return array('root' => array('name' => 'bitpay/bitpay-checkout-for-woocommerce', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => '6e04105fc46ecc51db6277052f418d54cc209798', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('bitpay/bitpay-checkout-for-woocommerce' => array('pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => '6e04105fc46ecc51db6277052f418d54cc209798', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'bitpay/key-utils' => array('pretty_version' => '1.1.2', 'version' => '1.1.2.0', 'reference' => '44283014751d1886b41c7de29f1972737d6dfe4d', 'type' => 'library', 'install_path' => __DIR__ . '/../bitpay/key-utils', 'aliases' => array(), 'dev_requirement' => \false), 'bitpay/sdk' => array('pretty_version' => '8.0.2', 'version' => '8.0.2.0', 'reference' => 'd1d9888540790f8ff35c2beff1f87bdc7fd2730d', 'type' => 'library', 'install_path' => __DIR__ . '/../bitpay/sdk', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/guzzle' => array('pretty_version' => '7.8.0', 'version' => '7.8.0.0', 'reference' => '1110f66a6530a40fe7aea0378fe608ee2b2248f9', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/promises' => array('pretty_version' => '2.0.1', 'version' => '2.0.1.0', 'reference' => '111166291a0f8130081195ac4556a5587d7f1b5d', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/promises', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/psr7' => array('pretty_version' => '2.6.1', 'version' => '2.6.1.0', 'reference' => 'be45764272e8873c72dbe3d2edcfdfcc3bc9f727', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), 'dev_requirement' => \false), 'netresearch/jsonmapper' => array('pretty_version' => 'v4.2.0', 'version' => '4.2.0.0', 'reference' => 'f60565f8c0566a31acf06884cdaa591867ecc956', 'type' => 'library', 'install_path' => __DIR__ . '/../netresearch/jsonmapper', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-client' => array('pretty_version' => '1.0.2', 'version' => '1.0.2.0', 'reference' => '0955afe48220520692d2d09f7ab7e0f93ffd6a31', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-client', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-client-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/http-factory' => array('pretty_version' => '1.0.2', 'version' => '1.0.2.0', 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-factory-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/http-message' => array('pretty_version' => '2.0', 'version' => '2.0.0.0', 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-message-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'ralouphie/getallheaders' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'type' => 'library', 'install_path' => __DIR__ . '/../ralouphie/getallheaders', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.0.2', 'version' => '3.0.2.0', 'reference' => '26954b3d62a6c5fd0ea8a2a00c0353a14978d05c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-ctype' => array('pretty_version' => 'v1.28.0', 'version' => '1.28.0.0', 'reference' => 'ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/yaml' => array('pretty_version' => 'v6.0.19', 'version' => '6.0.19.0', 'reference' => 'deec3a812a0305a50db8ae689b183f43d915c884', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), 'dev_requirement' => \false)));
return array('root' => array('name' => 'bitpay/bitpay-checkout-for-woocommerce', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => '4325855de9613209c85c42ea37e7da5a378d7830', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('bitpay/bitpay-checkout-for-woocommerce' => array('pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => '4325855de9613209c85c42ea37e7da5a378d7830', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'bitpay/key-utils' => array('pretty_version' => '1.1.2', 'version' => '1.1.2.0', 'reference' => '44283014751d1886b41c7de29f1972737d6dfe4d', 'type' => 'library', 'install_path' => __DIR__ . '/../bitpay/key-utils', 'aliases' => array(), 'dev_requirement' => \false), 'bitpay/sdk' => array('pretty_version' => '8.0.2', 'version' => '8.0.2.0', 'reference' => 'd1d9888540790f8ff35c2beff1f87bdc7fd2730d', 'type' => 'library', 'install_path' => __DIR__ . '/../bitpay/sdk', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/guzzle' => array('pretty_version' => '7.8.0', 'version' => '7.8.0.0', 'reference' => '1110f66a6530a40fe7aea0378fe608ee2b2248f9', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/promises' => array('pretty_version' => '2.0.1', 'version' => '2.0.1.0', 'reference' => '111166291a0f8130081195ac4556a5587d7f1b5d', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/promises', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/psr7' => array('pretty_version' => '2.6.1', 'version' => '2.6.1.0', 'reference' => 'be45764272e8873c72dbe3d2edcfdfcc3bc9f727', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), 'dev_requirement' => \false), 'netresearch/jsonmapper' => array('pretty_version' => 'v4.2.0', 'version' => '4.2.0.0', 'reference' => 'f60565f8c0566a31acf06884cdaa591867ecc956', 'type' => 'library', 'install_path' => __DIR__ . '/../netresearch/jsonmapper', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-client' => array('pretty_version' => '1.0.2', 'version' => '1.0.2.0', 'reference' => '0955afe48220520692d2d09f7ab7e0f93ffd6a31', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-client', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-client-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/http-factory' => array('pretty_version' => '1.0.2', 'version' => '1.0.2.0', 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-factory-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/http-message' => array('pretty_version' => '2.0', 'version' => '2.0.0.0', 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-message-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'ralouphie/getallheaders' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'type' => 'library', 'install_path' => __DIR__ . '/../ralouphie/getallheaders', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.0.2', 'version' => '3.0.2.0', 'reference' => '26954b3d62a6c5fd0ea8a2a00c0353a14978d05c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-ctype' => array('pretty_version' => 'v1.28.0', 'version' => '1.28.0.0', 'reference' => 'ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/yaml' => array('pretty_version' => 'v6.0.19', 'version' => '6.0.19.0', 'reference' => 'deec3a812a0305a50db8ae689b183f43d915c884', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), 'dev_requirement' => \false)));

0 comments on commit 65b00f7

Please sign in to comment.