Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added button to select another currency. #107

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions modules/gateways/blockonomics/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ app.controller('CheckoutController', function($scope, $interval, Order, $httpPar
var blockonomics_time_period = time_period_div.dataset.time_period;
var totalTime = blockonomics_time_period * 60;
var totalProgress = 100;

var order_uuid_div = document.getElementById("order_uuid");
$scope.order_uuid = order_uuid_div.dataset.order_uuid;

var order_id_div = document.getElementById("order_id");
$scope.order_id = order_id_div.dataset.order_id;

var active_currencies_div = document.getElementById("active_currencies");
var active_currencies = JSON.parse(active_currencies_div.dataset.active_currencies);
$scope.active_currencies = active_currencies;

$scope.copyshow = false;
$scope.display_problems = true;
//Create url when the order is received
//Create url when the order is received
$scope.finish_order_url = function() {
var params = {};
params.finish_order = $scope.order_id;
Expand All @@ -48,7 +48,7 @@ app.controller('CheckoutController', function($scope, $interval, Order, $httpPar
return url;
}

//Increment bitcoin timer
//Increment bitcoin timer
$scope.tick = function() {
$scope.clock = $scope.clock - 1;
$scope.progress = Math.floor($scope.clock * totalProgress / totalTime);
Expand Down Expand Up @@ -102,7 +102,7 @@ app.controller('CheckoutController', function($scope, $interval, Order, $httpPar
}
}
}

//Check if the blockonomics uuid is present
function check_blockonomics_uuid() {
$scope.spinner = true;
Expand All @@ -127,7 +127,7 @@ app.controller('CheckoutController', function($scope, $interval, Order, $httpPar
});
}
}

$scope.spinner = true;
if(Object.keys($scope.active_currencies).length === 1){
// Auto select btc if 1 activated currency
Expand Down Expand Up @@ -187,9 +187,11 @@ app.controller('CheckoutController', function($scope, $interval, Order, $httpPar
$scope.blockonomics_amount_click = function() {
copy_to_clipboard("bnomics-amount-copy");
}
//Copy bitcoin address to clipboard
$scope.try_again_click = function() {
location.reload();

//It allows to go back to the currency selector page
$scope.goback_click = function () {
$scope.order.status = 0;
$scope.currency_selecter = true;
}

});
1 change: 1 addition & 0 deletions modules/gateways/blockonomics/lang/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
$_BLOCKLANG['payWith'] = 'Pay With';
$_BLOCKLANG['paymentExpired'] = 'Payment Expired';
$_BLOCKLANG['tryAgain'] = 'Click here to try again';
$_BLOCKLANG['currencySelector'] = 'Change currency';
$_BLOCKLANG['paymentError'] = 'Payment Error';
$_BLOCKLANG['openWallet'] = 'Open in wallet';
$_BLOCKLANG['payAmount'] = 'To pay, send exactly this [[currency.code | uppercase]] amount';
Expand Down
6 changes: 5 additions & 1 deletion modules/gateways/blockonomics/payment.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<!-- Payment Expired -->
<div class="bnomics-order-expired-wrapper" ng-show="order.status == -3" ng-cloak>
<h3 class="warning bnomics-status-warning">{$_BLOCKLANG.paymentExpired}</h3><br>
<p><a href="#" ng-click="try_again_click()">{$_BLOCKLANG.tryAgain}</a></p>
<p><a href="{$currentpagelinkback}">{$_BLOCKLANG.tryAgain}</a></p>
</div>
<!-- Payment Error -->
<div class="bnomics-order-error-wrapper" ng-show="order.status == -2" ng-cloak>
Expand Down Expand Up @@ -124,6 +124,10 @@
</div>
</div>
</div>
<div class="col-md-12 text-center">
<button type="button" class="btn btn-default btn-sm"
ng-click="goback_click()">{$_BLOCKLANG.currencySelector}</button>
</div>
</div>
<!-- Blockonomics How to pay + Credit -->
<div class="bnomics-powered-by">
Expand Down