Fix handle URL (mobile). Replaces visa-api by api

This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-10 11:12:26 -03:00
parent 222fbe57ff
commit 252ebf45b3
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
5 changed files with 20 additions and 9 deletions

View File

@ -56,8 +56,9 @@
<plugin name="cordova-plugin-whitelist" spec="~1.3.0" />
<plugin name="cordova-plugin-wkwebview-engine" spec="https://github.com/driftyco/cordova-plugin-wkwebview-engine.git" />
<plugin name="cordova-plugin-qrscanner" spec="~2.4.0" />
<plugin name="cordova-plugin-customurlscheme" spec="~4.2.0">
<variable name="URL_SCHEME" value="UNUSED" />
<plugin name="cordova-plugin-customurlscheme" spec="https://github.com/cmgustavo/Custom-URL-scheme.git">
<variable name="URL_SCHEME" value="bitcoin" />
<variable name="SECOND_URL_SCHEME" value="bitpay" />
</plugin>
<plugin name="phonegap-plugin-push" spec="~1.8.2">
<variable name="SENDER_ID" value="*PUSHSENDERID*"/>

View File

@ -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);
});
}

View File

@ -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,

View File

@ -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});

View File

@ -22,7 +22,7 @@
<ion-slide>
<p translate>
<span translate>Get local cash anywhere you go, from any Visa&reg;-compatible ATM.</span>
<div translate class="size-10 m20t text-center">
<div translate class="size-10 text-center">
*ATM bank fees may apply
</div>
</p>