Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Commit

Permalink
make sure that by default, the plugin does not override transactionSpeed
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasDorier committed Jan 18, 2018
1 parent bf68167 commit 9def55f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions src/class-wc-gateway-bitpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,16 @@ public function init_form_fields()
'type' => 'api_token'
),
'transaction_speed' => array(
'title' => __('Risk/Speed', 'bitpay'),
'title' => __('Invoice pass to "confirmed" state after', 'bitpay'),
'type' => 'select',
'description' => 'Choose a transaction speed. For details, see the API documentation at bitpay.com',
'description' => 'An invoice becomes confirmed after the payment has...',
'options' => array(
'high' => 'High',
'medium' => 'Medium',
'low' => 'Low',
'default' => 'Keep store level configuration',
'high' => '0 confirmation on-chain',
'medium' => '1 confirmation on-chain',
'low' => '6 confirmations on-chain',
),
'default' => 'high',
'default' => 'default',
'desc_tip' => true,
),
'order_states' => array(
Expand Down Expand Up @@ -715,7 +716,10 @@ public function process_payment($order_id)
// Add the Redirect and Notification URLs
$invoice->setRedirectUrl($redirect_url);
$invoice->setNotificationUrl($notification_url);
$invoice->setTransactionSpeed($this->transaction_speed);
if($this->transaction_speed !== 'default')
{
$invoice->setTransactionSpeed($this->transaction_speed);
}

try {
$this->log(' [Info] Attempting to generate invoice for ' . $order->get_order_number() . '...');
Expand Down
2 changes: 1 addition & 1 deletion woocommerce/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
- "mariadb_datadir:/var/lib/mysql"

btcpayserver:
image: nicolasdorier/btcpayserver:1.0.1.8
image: nicolasdorier/btcpayserver:1.0.1.11
expose:
- "80"
ports:
Expand Down

0 comments on commit 9def55f

Please sign in to comment.