Skip to content

Commit

Permalink
fix Exchange Rate Lock Time setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ihor Sereda committed Aug 6, 2018
1 parent b00bf63 commit e4a2dc6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion assets/form/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
maxUnderpaymentFiat: container.getAttribute('data-max-underpayment-fiat'),
modal: true,
enablePoweredBy: true,
redirectPendingTo: container.getAttribute('data-redirect')
redirectPendingTo: container.getAttribute('data-redirect'),
timer: container.getAttribute('data-rate_lock_time')
});

function htmlDecode(input){
Expand Down
3 changes: 3 additions & 0 deletions class-wc-gateway-paybear.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ function paybear_payment_widget_shortcode($atts = array(), $content = null, $tag
}
$content .= '</table>';

$rate_lock_time = $gateway->get_option('rate_lock_time', 15) * 60;

$content .= '<div class="text-right">';
if (!in_array($payment_status, array('waiting for confirmations', 'paid'))) {
$content .= '<a href="#" class="button" id="paybear-all">Pay with Crypto</a>';
Expand All @@ -195,6 +197,7 @@ function paybear_payment_widget_shortcode($atts = array(), $content = null, $tag
data-fiat-currency="' . $fiat_currency . '"
data-fiat-sign="' . $fiat_sign . '"
data-min-overpayment-fiat="' . $min_overpayment_fiat . '"
data-rate_lock_time="' . $rate_lock_time . '"
data-max-underpayment-fiat="' . $max_underpayment_fiat . '">';
$content .= file_get_contents(plugin_dir_path(__FILE__) . 'assets/form/index.html');
}
Expand Down

0 comments on commit e4a2dc6

Please sign in to comment.