Fix paypro payments

This commit is contained in:
Gustavo Maximiliano Cortez 2018-02-17 16:11:58 -03:00
parent f85080753f
commit d5df706fc0
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
6 changed files with 26 additions and 10 deletions

View File

@ -65,7 +65,7 @@
<div item-start> <div item-start>
<span translate>Payment Proposals</span> <span translate>Payment Proposals</span>
</div> </div>
<ion-badge item-end (click)="openProposalsPage()">{{txpsN}}</ion-badge> <ion-badge item-end (click)="openProposalsPage()" *ngIf="txpsN>3">{{txpsN}}</ion-badge>
</ion-item-divider> </ion-item-divider>
<page-txp *ngFor="let txp of txps" [tx]="txp" [addressbook]="addressbook"></page-txp> <page-txp *ngFor="let txp of txps" [tx]="txp" [addressbook]="addressbook"></page-txp>
</ion-list> </ion-list>

View File

@ -5,7 +5,7 @@
</ion-header> </ion-header>
<ion-content no-bounce> <ion-content no-bounce>
<ion-list> <ion-list *ngIf="tx">
<ion-item> <ion-item>
<div class="sending-label"> <div class="sending-label">
<img class="sending-img" src="assets/img/icon-tx-sent-outline.svg"> <img class="sending-img" src="assets/img/icon-tx-sent-outline.svg">

View File

@ -87,7 +87,9 @@ export class ConfirmPage {
this.configFeeLevel = this.config.wallet.settings.feeLevel ? this.config.wallet.settings.feeLevel : 'normal'; this.configFeeLevel = this.config.wallet.settings.feeLevel ? this.config.wallet.settings.feeLevel : 'normal';
this.isCordova = this.platformProvider.isCordova; this.isCordova = this.platformProvider.isCordova;
this.isWindowsPhoneApp = this.platformProvider.isCordova && this.platformProvider.isWP; this.isWindowsPhoneApp = this.platformProvider.isCordova && this.platformProvider.isWP;
}
ionViewWillEnter() {
let B = this.navParams.data.coin == 'bch' ? this.bitcoreCash : this.bitcore; let B = this.navParams.data.coin == 'bch' ? this.bitcoreCash : this.bitcore;
let networkName; let networkName;
try { try {
@ -136,10 +138,7 @@ export class ConfirmPage {
this.tx.feeLevelName = this.feeProvider.feeOpts[this.tx.feeLevel]; this.tx.feeLevelName = this.feeProvider.feeOpts[this.tx.feeLevel];
this.showAddress = false; this.showAddress = false;
this.walletSelectorTitle = this.translate.instant('Send from'); this.walletSelectorTitle = this.translate.instant('Send from');
}
ionViewDidLoad() {
this.logger.info('ionViewDidLoad ConfirmPage');
this.setWalletSelector(this.tx.coin, this.tx.network, this.tx.amount).then(() => { this.setWalletSelector(this.tx.coin, this.tx.network, this.tx.amount).then(() => {
if (this.wallets.length > 1) { if (this.wallets.length > 1) {
this.showWallets(); this.showWallets();
@ -152,6 +151,10 @@ export class ConfirmPage {
}); });
} }
ionViewDidLoad() {
this.logger.info('ionViewDidLoad ConfirmPage');
}
private setWalletSelector(coin: string, network: string, minAmount: number): Promise<any> { private setWalletSelector(coin: string, network: string, minAmount: number): Promise<any> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

View File

@ -51,7 +51,6 @@ export class SendPage {
} }
ionViewWillEnter() { ionViewWillEnter() {
this.search = '';
this.walletsBtc = this.profileProvider.getWallets({ coin: 'btc' }); this.walletsBtc = this.profileProvider.getWallets({ coin: 'btc' });
this.walletsBch = this.profileProvider.getWallets({ coin: 'bch' }); this.walletsBch = this.profileProvider.getWallets({ coin: 'bch' });
this.hasBtcWallets = !(_.isEmpty(this.walletsBtc)); this.hasBtcWallets = !(_.isEmpty(this.walletsBtc));
@ -61,6 +60,10 @@ export class SendPage {
this.updateContactsList(); this.updateContactsList();
} }
ionViewDidEnter() {
this.search = '';
}
private updateBchWalletsList(): void { private updateBchWalletsList(): void {
this.walletBchList = []; this.walletBchList = [];

View File

@ -1,6 +1,6 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { NavController, NavParams, Events } from 'ionic-angular'; import { Events, NavController, NavParams } from 'ionic-angular';
import { Logger } from '../../../../../providers/logger/logger'; import { Logger } from '../../../../../providers/logger/logger';
//providers //providers

View File

@ -43,10 +43,20 @@ export class IncomingDataProvider {
public redir(data: string): boolean { public redir(data: string): boolean {
//TODO Injecting NavController in constructor of service fails with no provider error //TODO Injecting NavController in constructor of service fails with no provider error
this.navCtrl = this.app.getActiveNav(); this.navCtrl = this.app.getActiveNav();
// data extensions for Payment Protocol with non-backwards-compatible request // data extensions for Payment Protocol with non-backwards-compatible request
if ((/^bitcoin(cash)?:\?r=[\w+]/).exec(data)) { if ((/^bitcoin(cash)?:\?r=[\w+]/).exec(data)) {
let coin = 'btc';
if (data.indexOf('bitcoincash') === 0) coin = 'bch';
data = decodeURIComponent(data.replace(/bitcoin(cash)?:\?r=/, '')); data = decodeURIComponent(data.replace(/bitcoin(cash)?:\?r=/, ''));
this.navCtrl.push(ConfirmPage, { paypro: data });
this.payproProvider.getPayProDetails(data).then((details) => {
this.handlePayPro(details, coin);
}).catch((err) => {
this.popupProvider.ionicAlert(this.translate.instant('Error'), err);
});
return true; return true;
} }