Fix handle URL (mobile). Replaces visa-api by api
This commit is contained in:
parent
222fbe57ff
commit
252ebf45b3
5 changed files with 20 additions and 9 deletions
|
|
@ -50,7 +50,7 @@ angular.module('copayApp.controllers').controller('bitpayCardIntroController', f
|
|||
} else {
|
||||
// TEST TODO
|
||||
bitpayCardService.testSession(function(err, session) {
|
||||
if (err) $log.error(err);
|
||||
if (err) popupService.showAlert(null, err);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
|||
_setCredentials();
|
||||
$http({
|
||||
method: 'GET',
|
||||
url: credentials.BITPAY_API_URL + '/visa-api/session',
|
||||
url: credentials.BITPAY_API_URL + '/api/session',
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
|
|
@ -154,12 +154,12 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
|||
code: obj.otp
|
||||
};
|
||||
|
||||
var dataToSign = credentials.BITPAY_API_URL + '/visa-api/validateBitAuthPairingCode' + JSON.stringify(userData);
|
||||
var dataToSign = credentials.BITPAY_API_URL + '/api/validateBitAuthPairingCode' + JSON.stringify(userData);
|
||||
var signedData = bitauthService.sign(dataToSign, credentials.BITPAY_PRIV_KEY);
|
||||
|
||||
$http({
|
||||
method: 'POST',
|
||||
url: credentials.BITPAY_API_URL + '/visa-api/validateBitAuthPairingCode',
|
||||
url: credentials.BITPAY_API_URL + '/api/validateBitAuthPairingCode',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'x-csrf-token': session.csrfToken,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,18 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services').factory('incomingData', function($log, $ionicModal, $state, $window, $timeout, bitcore) {
|
||||
angular.module('copayApp.services').factory('incomingData', function($log, $ionicModal, $state, $window, $timeout, bitcore, lodash) {
|
||||
|
||||
var root = {};
|
||||
|
||||
var ignoreState = [
|
||||
'tabs.language',
|
||||
'tabs.about.translators',
|
||||
'tabs.bitpayCardIntro',
|
||||
'tabs.buyandsell.glidera',
|
||||
'tabs.giftcards.amazon',
|
||||
'tabs.giftcards.amazon.buy'
|
||||
];
|
||||
|
||||
root.redir = function(data) {
|
||||
$log.debug('Processing incoming data:' +data);
|
||||
|
||||
|
|
@ -70,7 +79,8 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
|
|||
|
||||
// Plain URL
|
||||
} else if (/^https?:\/\//.test(data)) {
|
||||
if ($state.current.name == 'tabs.bitpayCardIntro' || $state.current.name == 'tabs.buyandsell.glidera') return false;
|
||||
var currentState = $state.current.name;
|
||||
if (lodash.indexOf(ignoreState, currentState) != -1) return false;
|
||||
$state.go('tabs.send');
|
||||
$timeout(function() {
|
||||
$state.transitionTo('tabs.send.confirm', {paypro: data});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue