mirror of https://github.com/BTCPrivate/copay.git
Fix paypro payments
This commit is contained in:
parent
f85080753f
commit
d5df706fc0
|
@ -65,7 +65,7 @@
|
|||
<div item-start>
|
||||
<span translate>Payment Proposals</span>
|
||||
</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>
|
||||
<page-txp *ngFor="let txp of txps" [tx]="txp" [addressbook]="addressbook"></page-txp>
|
||||
</ion-list>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
</ion-header>
|
||||
|
||||
<ion-content no-bounce>
|
||||
<ion-list>
|
||||
<ion-list *ngIf="tx">
|
||||
<ion-item>
|
||||
<div class="sending-label">
|
||||
<img class="sending-img" src="assets/img/icon-tx-sent-outline.svg">
|
||||
|
|
|
@ -87,7 +87,9 @@ export class ConfirmPage {
|
|||
this.configFeeLevel = this.config.wallet.settings.feeLevel ? this.config.wallet.settings.feeLevel : 'normal';
|
||||
this.isCordova = this.platformProvider.isCordova;
|
||||
this.isWindowsPhoneApp = this.platformProvider.isCordova && this.platformProvider.isWP;
|
||||
}
|
||||
|
||||
ionViewWillEnter() {
|
||||
let B = this.navParams.data.coin == 'bch' ? this.bitcoreCash : this.bitcore;
|
||||
let networkName;
|
||||
try {
|
||||
|
@ -136,10 +138,7 @@ export class ConfirmPage {
|
|||
this.tx.feeLevelName = this.feeProvider.feeOpts[this.tx.feeLevel];
|
||||
this.showAddress = false;
|
||||
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(() => {
|
||||
if (this.wallets.length > 1) {
|
||||
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> {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
|
|
|
@ -51,7 +51,6 @@ export class SendPage {
|
|||
}
|
||||
|
||||
ionViewWillEnter() {
|
||||
this.search = '';
|
||||
this.walletsBtc = this.profileProvider.getWallets({ coin: 'btc' });
|
||||
this.walletsBch = this.profileProvider.getWallets({ coin: 'bch' });
|
||||
this.hasBtcWallets = !(_.isEmpty(this.walletsBtc));
|
||||
|
@ -61,6 +60,10 @@ export class SendPage {
|
|||
this.updateContactsList();
|
||||
}
|
||||
|
||||
ionViewDidEnter() {
|
||||
this.search = '';
|
||||
}
|
||||
|
||||
private updateBchWalletsList(): void {
|
||||
this.walletBchList = [];
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Component } from '@angular/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';
|
||||
|
||||
//providers
|
||||
|
|
|
@ -43,10 +43,20 @@ export class IncomingDataProvider {
|
|||
public redir(data: string): boolean {
|
||||
//TODO Injecting NavController in constructor of service fails with no provider error
|
||||
this.navCtrl = this.app.getActiveNav();
|
||||
|
||||
// data extensions for Payment Protocol with non-backwards-compatible request
|
||||
if ((/^bitcoin(cash)?:\?r=[\w+]/).exec(data)) {
|
||||
let coin = 'btc';
|
||||
if (data.indexOf('bitcoincash') === 0) coin = 'bch';
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue