From 12abce63136156970895b2a659acfb73fc7c664a Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sun, 17 Aug 2025 17:45:40 -0400 Subject: [PATCH] fix page --- src/app/accounts/addbank/addbank.page.html | 75 +- src/app/pages/payment/payment.page.html | 244 +++--- src/app/pages/payment/payment.page.ts | 133 ++-- src/app/pages/profile/profile.page.html | 2 +- src/app/pages/redeem/redeem.page.html | 742 +++++++----------- src/app/pages/redeem/redeem.page.scss | 16 +- src/app/pages/redeem/redeem.page.ts | 573 +++++++------- .../pages/transaction/transaction.page.html | 252 +++--- 8 files changed, 940 insertions(+), 1097 deletions(-) diff --git a/src/app/accounts/addbank/addbank.page.html b/src/app/accounts/addbank/addbank.page.html index d4cc99b..f954864 100644 --- a/src/app/accounts/addbank/addbank.page.html +++ b/src/app/accounts/addbank/addbank.page.html @@ -14,85 +14,114 @@ -
-
- +
+
+ +
-
- - - - - + + + + + + Add New Redeem Bank Account + + - Bank Name + Bank Name : - + - {{item.name}} - ({{item.code}}) + {{item.name}} - + ({{item.code}}) + - Account Type + Account Type : - + - {{item.name}} + {{item.name}} - Account No : + Account No (10 digits) : - + - Confirm Account No : + Confirm Account No : - + -
+ +
+
City : - + State : - + + + + + + + + + + +
+ Add Account + >Add Account + diff --git a/src/app/pages/payment/payment.page.html b/src/app/pages/payment/payment.page.html index 2fd53ea..37a5500 100644 --- a/src/app/pages/payment/payment.page.html +++ b/src/app/pages/payment/payment.page.html @@ -1,162 +1,126 @@ - - - - - - - Card & Accounts - + + + + + + + Cards & Accounts + -
-
- - -
+
-
- - - - - -
+ + + Cards + + + Accounts + + + History + + - +
- - - - - - - - - - - - - - +
+
+
+
+ {{item.description}} **** **** **** {{item.digits}} + Added : {{item.added | date }} +
+
+
+ +
+
- - - Cards - - - Accounts - - - History - - - -
- -
-
-
- -
- {{item.description}} **** **** **** {{item.digits}} - Added : {{item.added | date }} -
-
- + +
+ +
+
+
+ +
+ {{item.recipient}} + Added: {{item.added | date}} + +
+
+
+ +
+
+ +
+ +
+
-
-
-
- - -
+ -
-
-
+ + + + + + + + + + + -
- {{item.recipient}} - {{item.added | date}} -
-
-
- -
-
+ + + + + + + + + + + -
+ + + + + + + + + + + -
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/src/app/pages/payment/payment.page.ts b/src/app/pages/payment/payment.page.ts index 4e2851f..41419e2 100644 --- a/src/app/pages/payment/payment.page.ts +++ b/src/app/pages/payment/payment.page.ts @@ -1,76 +1,82 @@ import {AlertController, NavController} from '@ionic/angular'; -import { Router } from '@angular/router'; -import { Component, OnInit } from '@angular/core'; +import {Router} from '@angular/router'; +import {Component, OnInit} from '@angular/core'; import {SessionDataProviderService} from "../../store/session-data-provider.service"; import {WrenchService} from "../../services/wrench.service"; @Component({ - selector: 'app-payment', - templateUrl: './payment.page.html', - styleUrls: ['./payment.page.scss'], + selector: 'app-payment', + templateUrl: './payment.page.html', + styleUrls: ['./payment.page.scss'], }) export class PaymentPage implements OnInit { - tabs = 'cards'; - constructor( - private router: Router, - private navctr: NavController, - public sessionDataProviderService: SessionDataProviderService, - private wrenchService: WrenchService, - private alertController: AlertController - ) { } + tabs = 'cards'; - ngOnInit() { - this.getUsersCardsList(); - this.getMyRecipientsData(); - } + constructor( + private router: Router, + private navctr: NavController, + public sessionDataProviderService: SessionDataProviderService, + private wrenchService: WrenchService, + private alertController: AlertController + ) { + } - onAddCard() { - this.router.navigate(['new-card']); - } + ngOnInit() { + this.getUsersCardsList(); + this.getMyRecipientsData(); + } - onBack() { - this.navctr.back(); - } + onAddCard() { + this.router.navigate(['new-card']); + } - usrData: { - action:number, member_id: number, uid: string, sessionid: string, limit:20, page:1,offset: 0 - }; + onBack() { + this.navctr.back(); + } - usersCardsTotalData:any; - usersCardsData: []; - getUsersCardsList(){ - this.usrData = - { - action:11055, - member_id: this.sessionDataProviderService.member_id, - uid: this.sessionDataProviderService.member_uid, - sessionid: this.sessionDataProviderService.session , - limit:20, page:1,offset: 0 - }; + usrData: { + action: number, member_id: number, uid: string, sessionid: string, limit: 20, page: 1, offset: 0 + }; - this.wrenchService.getusersCardList(this.usrData).subscribe( - usersCardsTotalData => { - this.usersCardsTotalData = usersCardsTotalData; - console.log("usersCardsTotalData TOTAL RETURN->", this.usersCardsTotalData); - this.usersCardsData = this.usersCardsTotalData.result_list; - // debugger; - console.log("usersCardsData RETURN DATA->", this.usersCardsData); - //this.total_family = this.familyData.length; - } - ); + usersCardsTotalData: any; + usersCardsData: []; - } + getUsersCardsList() { + this.usrData = + { + action: 11055, + member_id: this.sessionDataProviderService.member_id, + uid: this.sessionDataProviderService.member_uid, + sessionid: this.sessionDataProviderService.session, + limit: 20, page: 1, offset: 0 + }; - myRecipientsTotalData:any; - myRecipientsData:any; - getMyRecipientsData(){ - this.usrData = {action:11175, + this.wrenchService.getusersCardList(this.usrData).subscribe( + usersCardsTotalData => { + this.usersCardsTotalData = usersCardsTotalData; + console.log("usersCardsTotalData TOTAL RETURN->", this.usersCardsTotalData); + this.usersCardsData = this.usersCardsTotalData.result_list; + // debugger; + console.log("usersCardsData RETURN DATA->", this.usersCardsData); + //this.total_family = this.familyData.length; + } + ); + + } + + myRecipientsTotalData: any; + myRecipientsData: any; + + getMyRecipientsData() { + this.usrData = { + action: 11175, member_id: this.sessionDataProviderService.member_id, uid: this.sessionDataProviderService.member_uid, - sessionid: this.sessionDataProviderService.session , - limit:20, page:1, - offset: 0} + sessionid: this.sessionDataProviderService.session, + limit: 20, page: 1, + offset: 0 + } this.wrenchService.recipientAccount(this.usrData).subscribe( myRecipientsTotalData => { @@ -84,15 +90,20 @@ export class PaymentPage implements OnInit { } - cardDelData:{ - action : number, - card_uid : string, + cardDelData: { + action: number, + card_uid: string, member_id: number, - sessionid : string, + sessionid: string, uid: string } - myDeleteCardResult:any; - async deleteCard(item){ + myDeleteCardResult: any; + + async deleteBank(item) { + + } + + async deleteCard(item) { const alert = await this.alertController.create({ header: "Delete Card", message: "Confirm you are ready delete the card ?", diff --git a/src/app/pages/profile/profile.page.html b/src/app/pages/profile/profile.page.html index 9db46cd..79a0357 100644 --- a/src/app/pages/profile/profile.page.html +++ b/src/app/pages/profile/profile.page.html @@ -145,7 +145,7 @@ - Card & Accounts + Cards & Accounts diff --git a/src/app/pages/redeem/redeem.page.html b/src/app/pages/redeem/redeem.page.html index fa5c511..a11215d 100644 --- a/src/app/pages/redeem/redeem.page.html +++ b/src/app/pages/redeem/redeem.page.html @@ -6,474 +6,288 @@ - - - {{currency_description}} Wallet -
-
- +
+
+ +
+
+ +
+
+ + Wallet Balance: {{curr_balance| number : '1.2-2'}} {{currency_description}} +
+ +
+ + + + Redeem + + + My Banks + + + Reports + + + +
+ + + +
+ + + + Redeem from your {{currency_code}} + Wallet + + + + + + + Amount ({{currency_description}}) : + + + + + + Processing Fee : + + + + + + Total ({{currency_description}}) : + + + + + + Sending to Account (Recipient) : + + + + + + {{item.recipient}} + + + + + + + + + + + + + + + + + Add New Recipient Account + + + + + + + {{recipient_name}} + + + + + + + + Continue + + + + + + + +
+ +
+ + + Confirm Wallet Withdraw + + + + + + + + Amount({{currency_code}}) + +
{{amount}}
+
+
+ + Fee + +
{{fee_display}}
+
+
+ + Total + +
{{total_display}}
+
+
+ + Recipient + +
{{recipient_name}}
+
+
+ + + Confirm + + + + +
+
+
+ + +
+ + +
+ + + Withdraw Result + + + + + + + Amount({{currency_code}}) + +
{{amount}}
+
+
+ + Fee + +
{{fee_display}}
+
+
+ + Total + +
{{total_display}}
+
+
+ + Recipient + +
{{recipient_name}}
+
+
+ + + Confirmation + +
{{confirmation}}
+
+
+ + + + Estimated delivery time is 2 to 4 Hours. + + + + + + Return + + + +
+ +
+
+
+ +
+ +
+ + +
+ My Recipient Banks + + Add New + +
+ +
+
+
+ +
+ {{item.recipient}} + Added : {{item.added | date}} +
+
+
+ +
+
+ +
+ +
+ +
+
+
+
+
+ {{item.confirmation}}- {{item.amount}} +
+
+
+ +
+
+
+
+ +
-
- -
-
- - - - Balance: {{curr_balance| number : '1.2-2'}} {{currency_description}} -
- -
- - - - To Bank - - - My Banks - - - Reports - - - -
- - - -
- - - Redeem from {{currency_code}} Wallet - - - - - - - - Amount ({{currency_description}}) : - - - - - - Fee : - - - - - - Total ({{currency_description}}) : - - - - - - Sending to (recipient) : - - - - - - {{item.recipient}} - - - - - - - - - - - - - {{recipient_name}} - - - - - - Continue - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - Confirm Wallet Withdraw - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Amount({{currency_code}}) - -
{{amount}}
- -
-
- - Fee - -
{{fee_display}}
- -
-
- - Total - -
{{total_display}}
- -
-
- - Recipient - -
{{recipient_name}}
-
-
- - - - - - - - - - - - - - - - - - Confirm - - - -
-
-
- - - - -
- - -
- - - Withdraw Result - - - - - - - Amount({{currency_code}}) - -
{{amount}}
-
-
- - Fee - -
{{fee_display}}
- -
-
- - Total - -
{{total_display}}
- -
-
- - Recipient - -
{{recipient_name}}
-
-
- - - Confirmation - -
{{confirmation}}
-
-
- - - - Estimated delivery time is 2 to 4 Hours. - - - - - Return - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
- - -
- My Recipient Banks - - Add New - -
- -
-
-
- -
- {{item.recipient}} - Added : {{item.added | date}} -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
-
-
- -
- - - -
- {{item.confirmation}}- {{item.amount}} -
-
-
- -
-
- - - - - - - - - -
-
- - -
- - - - - - - - diff --git a/src/app/pages/redeem/redeem.page.scss b/src/app/pages/redeem/redeem.page.scss index 6891042..cd6fad5 100644 --- a/src/app/pages/redeem/redeem.page.scss +++ b/src/app/pages/redeem/redeem.page.scss @@ -1,11 +1,13 @@ ion-content { - ion-card{ + ion-card { margin: 10px 0px 10px 0px; } - ion-card-title{ + + ion-card-title { font-size: 18px; } + .back_image { width: 100%; height: 110px; @@ -16,7 +18,7 @@ ion-content { } } - .result-recipient{ + .result-recipient { width: 160px; text-align: right; background-color: white; @@ -26,7 +28,7 @@ ion-content { border-radius: 10px; } - .result-amount{ + .result-amount { width: 160px; text-align: right; background-color: white; @@ -35,6 +37,7 @@ ion-content { padding: 5px; border-radius: 10px; } + //.send-grid{ // background-color: #eff2f4; // border-radius: 10px; @@ -87,8 +90,8 @@ ion-content { .color_text { margin-top: 10px; - font-size: 22px; - font-family: 'semi-bold'; + font-size: 20px; + font-weight: bolder; color: var(--ion-color-primary); } @@ -389,7 +392,6 @@ ion-content { } - .bold_text { font-size: 20px; font-family: 'bold'; diff --git a/src/app/pages/redeem/redeem.page.ts b/src/app/pages/redeem/redeem.page.ts index 835f2e8..3af94cf 100644 --- a/src/app/pages/redeem/redeem.page.ts +++ b/src/app/pages/redeem/redeem.page.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {AlertController, LoadingController, NavController} from "@ionic/angular"; import {Router} from "@angular/router"; import {SessionDataProviderService} from "../../store/session-data-provider.service"; @@ -6,301 +6,312 @@ import {WrenchService} from "../../services/wrench.service"; import {RecipientsService} from "../../store/recipients.service"; @Component({ - selector: 'app-redeem', - templateUrl: './redeem.page.html', - styleUrls: ['./redeem.page.scss'], + selector: 'app-redeem', + templateUrl: './redeem.page.html', + styleUrls: ['./redeem.page.scss'], }) export class RedeemPage implements OnInit { - walletData:any; - tabs = 'bank_redeem'; - curr_balance:number =0; - currency_description : string=''; - currency_code:string=''; - wallet_uid:string=''; - isDisabled:boolean=false; + walletData: any; + tabs = 'bank_redeem'; + curr_balance: number = 0; + currency_description: string = ''; + currency_code: string = ''; + wallet_uid: string = ''; + isDisabled: boolean = false; - constructor( - private navctr: NavController, - private router: Router, - public sessionDataProviderService: SessionDataProviderService, - private wrenchService: WrenchService, - private alertController: AlertController, - private loadingCtrl: LoadingController, - public recipientsService: RecipientsService - ) { - this.walletData = this.router.getCurrentNavigation().extras.state; - if ( this.walletData != undefined ){ - this.curr_balance = this.walletData.amount*0.01; - this.currency_code = this.walletData.code; - this.currency_description = this.walletData.description; - this.wallet_uid= this.walletData.wallet_uid; - } - else{ - this.onBack(); - } - } - - myRecipientsData:any; - ngOnInit() { - //this.recipientsService.getMyRecipientsData(); - this.myRecipientsData = this.recipientsService.getMyRecipientsData(); - this.getPaymentHxData(); - //this.getMyRecipientsData(); - this.myRecipientsData = this.recipientsService.myRecipientsData; - } - - ionViewDidEnter(){ - console.log('Home page did enter - > ionViewDidEnter '); - //this.recipientsService.getMyRecipientsData(); - this.getMyRecipientsData(); - } - - ionViewWillEnter(){ - console.log('Home page did enter - > ionViewWillEnter'); - //this.recipientsService.getMyRecipientsData(); - this.myRecipientsData = this.recipientsService.myRecipientsData; - } - - onBack() { - this.navctr.back(); - } - - usrData: { - action:number, member_id: number, - uid: string, - sessionid: string, - limit:20, page:1, - offset: 0, - amount: number - }; - paymentHxData:any; - paymentData: []; - getPaymentHxData(){ - this.usrData = {action:11200, member_id: this.sessionDataProviderService.member_id, - uid: this.sessionDataProviderService.member_uid, sessionid: this.sessionDataProviderService.session , - limit:20, page:1,offset: 0, amount: 0} - this.wrenchService.getPaymentHx(this.usrData).subscribe( - paymentHxData => { - this.paymentHxData = paymentHxData; - console.log("PAH HX RETURN->", this.paymentHxData); - this.paymentData = this.paymentHxData.result_list; - // debugger; - console.log("BANNERS RETURN DATA->", this.paymentData); - // this.blogDataService.setBlogData(this.blogResult.blog_data); + constructor( + private navctr: NavController, + private router: Router, + public sessionDataProviderService: SessionDataProviderService, + private wrenchService: WrenchService, + private alertController: AlertController, + private loadingCtrl: LoadingController, + public recipientsService: RecipientsService + ) { + this.walletData = this.router.getCurrentNavigation().extras.state; + if (this.walletData != undefined) { + this.curr_balance = this.walletData.amount * 0.01; + this.currency_code = this.walletData.code; + this.currency_description = this.walletData.description; + this.wallet_uid = this.walletData.wallet_uid; + } else { + this.onBack(); } - ); + } + myRecipientsData: any; + + ngOnInit() { + //this.recipientsService.getMyRecipientsData(); + this.myRecipientsData = this.recipientsService.getMyRecipientsData(); + this.getPaymentHxData(); + //this.getMyRecipientsData(); + this.myRecipientsData = this.recipientsService.myRecipientsData; + } + + ionViewDidEnter() { + console.log('Home page did enter - > ionViewDidEnter '); + //this.recipientsService.getMyRecipientsData(); + this.getMyRecipientsData(); + } + + ionViewWillEnter() { + console.log('Home page did enter - > ionViewWillEnter'); + //this.recipientsService.getMyRecipientsData(); + this.myRecipientsData = this.recipientsService.myRecipientsData; + } + + onBack() { + this.navctr.back(); + } + + usrData: { + action: number, member_id: number, + uid: string, + sessionid: string, + limit: 20, page: 1, + offset: 0, + amount: number + }; + paymentHxData: any; + paymentData: []; + + getPaymentHxData() { + this.usrData = { + action: 11200, member_id: this.sessionDataProviderService.member_id, + uid: this.sessionDataProviderService.member_uid, sessionid: this.sessionDataProviderService.session, + limit: 20, page: 1, offset: 0, amount: 0 + } + this.wrenchService.getPaymentHx(this.usrData).subscribe( + paymentHxData => { + this.paymentHxData = paymentHxData; + console.log("PAH HX RETURN->", this.paymentHxData); + this.paymentData = this.paymentHxData.result_list; + // debugger; + console.log("BANNERS RETURN DATA->", this.paymentData); + // this.blogDataService.setBlogData(this.blogResult.blog_data); + } + ); + + } + + /* + array (size=5) + 'member_id' => int 1 + 'sessionid' => string '936571FD2E081B667930E7FFDF4D819938171883CA0CC951DC6C4FB184280EB3' (length=64) + 'uid' => string '3119b744-42ad-4834-bb83-b737588754ca' (length=36) + 'amount' => int 816 + 'action' => int 33025 + /var/www/html/public/wrenchboard/wrenchboard_class.php:209: + array (size=4) + 'processing_fee' => string '12008' (length=5) + 'result' => string 'YES I GET TO BACK END' (length=21) + 'total_amount' => string '12824' (length=5) + 'internal_return' => int 12008 + */ + + amount: number = 0; + fee: number = 0; + fee_display: string; + total: number = 0; + total_display: string; + recipient: string = ''; + recipient_name: string = ''; + + feeReturn: any; + + refreshFee() { + this.total = this.fee = 0; + console.log("Refresh Fee******************"); + this.usrData = { + action: 33025, + member_id: this.sessionDataProviderService.member_id, + uid: this.sessionDataProviderService.member_uid, + sessionid: this.sessionDataProviderService.session, + limit: 20, page: 1, offset: 0, amount: this.amount * 100 + } + if (this.amount <= 0) return; + + + this.wrenchService.sendMoneyFee(this.usrData).subscribe( + feeReturn => { + this.feeReturn = feeReturn; + if (this.feeReturn != null && this.feeReturn.processing_fee >= 0) { + this.fee = this.feeReturn.processing_fee * 0.01; + var num = new Number(this.fee); + this.fee_display = num.toFixed(2); + // parseFloat("123.456").toFixed(2); + this.total = this.feeReturn.total_amount * 0.01; + var numt = new Number(this.total); + this.total_display = numt.toFixed(2); + } + } + ); + + + // this.total = this.fee + this.amount; + } + + + curr_page: string = 'redeem_start' + recipient_uid: string = ''; + + contineRedeem() { + if (this.recipient == '') { + //alert("Select Recipient"); + this.showAlert("Error", "Select Recipient"); + return; + } + if (this.amount <= 0) { + this.showAlert("Error", "Enter valid Amount"); + //alert("Enter Amount"); + return; + } + + if (this.curr_balance < this.total) { + this.showAlert("Error", "Enter Amount less than your wallet"); + //alert("Enter Amount less than your wallet"); + return; + } + + const selRecipient = this.myRecipientsData.filter((item) => item.recipient_uid == this.recipient); + if (selRecipient?.length == 1 && this.amount > 0) { + this.recipient_uid = selRecipient[0].recipient_uid; + this.recipient_name = selRecipient[0].recipient; + this.curr_page = 'redeem_confirm'; + } + } + + checkSelectVal() { + if (this.recipient == 'ADD_NEW_RECIP') { + this.addNewBank(); + this.recipient = ''; + } + } + + async showAlert(mtitle: string, amessage: string) { + const alert = await this.alertController.create({ + header: 'WrenchBoard', + subHeader: mtitle, + message: amessage, + buttons: ['OK'], + }); + + await alert.present(); + } + + /* + + { + "recipient": "Olu Ameye 0690000034 Access Bank", + "account_no": "0690000034", + "recipient_id": "3", + "recipient_uid": "6bba49e2-dd92-403e-9459-927e37c852ef", + "country": "NG", + "added": "2017-03-22 11:55:25.133006", + "bank_name": "Access Bank", + "bank_uid": "a2c6c1a2-5cf2-4396-8630-50c47da15316" } - /* -array (size=5) + + array (size=9) 'member_id' => int 1 'sessionid' => string '936571FD2E081B667930E7FFDF4D819938171883CA0CC951DC6C4FB184280EB3' (length=64) 'uid' => string '3119b744-42ad-4834-bb83-b737588754ca' (length=36) - 'amount' => int 816 - 'action' => int 33025 -/var/www/html/public/wrenchboard/wrenchboard_class.php:209: -array (size=4) - 'processing_fee' => string '12008' (length=5) - 'result' => string 'YES I GET TO BACK END' (length=21) - 'total_amount' => string '12824' (length=5) - 'internal_return' => int 12008 + 'wallet_uid' => string 'cc0f8743-3f18-4214-ba4b-781e5dda9cb8' (length=36) + 'amount' => int 240800 + 'Fee' => float 2408 + 'recipient_uid' => string 'bfd7dc27-e2a6-4d52-957b-789fdb660eec' (length=36) + 'mode' => int 100 + 'action' => int 33020 + + this.usrData = {action:11200, member_id: this.sessionDataProviderService.member_id, + uid: this.sessionDataProviderService.member_uid, sessionid: this.sessionDataProviderService.session , + limit:20, page:1,offset: 0, amount: 0} */ - - amount:number =0; - fee:number = 0; - fee_display: string; - total:number = 0; - total_display: string; - recipient:string =''; - recipient_name:string =''; - - feeReturn: any; - refreshFee(){ - this.total = this.fee = 0; - console.log("Refresh Fee******************"); - this.usrData = {action:33025, - member_id: this.sessionDataProviderService.member_id, - uid: this.sessionDataProviderService.member_uid, - sessionid: this.sessionDataProviderService.session , - limit:20, page:1,offset: 0, amount: this.amount*100} - if (this.amount <= 0 ) return; - - - this.wrenchService.sendMoneyFee(this.usrData).subscribe( - feeReturn => { - this.feeReturn = feeReturn; - if ( this.feeReturn != null && this.feeReturn.processing_fee >= 0 ){ - this.fee = this.feeReturn.processing_fee*0.01; - var num = new Number(this.fee); - this.fee_display = num.toFixed(2); - // parseFloat("123.456").toFixed(2); - this.total = this.feeReturn.total_amount*0.01; - var numt = new Number(this.total); - this.total_display= numt.toFixed(2); - } - } - ); - - - // this.total = this.fee + this.amount; - } - - - - curr_page:string= 'redeem_start' - recipient_uid:string = ''; - contineRedeem(){ - if (this.recipient == ''){ - //alert("Select Recipient"); - this.showAlert("Error","Select Recipient"); - return; - } - if (this.amount <= 0 ) { - this.showAlert("Error","Enter valid Amount"); - //alert("Enter Amount"); - return; - } - - if (this.curr_balance < this.total){ - this.showAlert("Error","Enter Amount less than your wallet"); - //alert("Enter Amount less than your wallet"); - return; - } - - const selRecipient = this.myRecipientsData.filter((item) => item.recipient_uid == this.recipient); - if ( selRecipient.length == 1 && this.amount > 0){ - this.recipient_uid = selRecipient[0].recipient_uid; - this.recipient_name = selRecipient[0].recipient; - this.curr_page ='redeem_confirm'; - } - } - - checkSelectVal(){ - if (this.recipient == 'ADD_NEW_RECIP'){ - this.addNewBank(); - this.recipient=''; - } - } - async showAlert(mtitle: string, amessage: string) { - const alert = await this.alertController.create({ - header: 'WrenchBoard', - subHeader: mtitle, - message: amessage, - buttons: ['OK'], - }); - - await alert.present(); - } - /* - - { - "recipient": "Olu Ameye 0690000034 Access Bank", - "account_no": "0690000034", - "recipient_id": "3", - "recipient_uid": "6bba49e2-dd92-403e-9459-927e37c852ef", - "country": "NG", - "added": "2017-03-22 11:55:25.133006", - "bank_name": "Access Bank", - "bank_uid": "a2c6c1a2-5cf2-4396-8630-50c47da15316" -} - - -array (size=9) -'member_id' => int 1 -'sessionid' => string '936571FD2E081B667930E7FFDF4D819938171883CA0CC951DC6C4FB184280EB3' (length=64) -'uid' => string '3119b744-42ad-4834-bb83-b737588754ca' (length=36) -'wallet_uid' => string 'cc0f8743-3f18-4214-ba4b-781e5dda9cb8' (length=36) -'amount' => int 240800 -'Fee' => float 2408 -'recipient_uid' => string 'bfd7dc27-e2a6-4d52-957b-789fdb660eec' (length=36) -'mode' => int 100 -'action' => int 33020 - -this.usrData = {action:11200, member_id: this.sessionDataProviderService.member_id, - uid: this.sessionDataProviderService.member_uid, sessionid: this.sessionDataProviderService.session , - limit:20, page:1,offset: 0, amount: 0} - */ - sendMoneyData: { - action:number, - member_id: number, - uid: string, - sessionid: string, - wallet_uid:string, - recipient_uid:string, - amount:number, - Fee:number, - mode: 100, - }; - - sendMoneyResult:any; - confirmation:string =''; - async confirmRedeem(){ - - const loading = await this.loadingCtrl.create({ - message: 'Sending...', - duration: 8500, - }); - - - this.isDisabled = true; - this.sendMoneyData = { - action:33020, - member_id: this.sessionDataProviderService.member_id, - uid: this.sessionDataProviderService.member_uid, - sessionid: this.sessionDataProviderService.session, - wallet_uid: this.wallet_uid, - recipient_uid: this.recipient_uid, - amount: this.amount*100, - Fee:this.fee*100, - mode: 100, + sendMoneyData: { + action: number, + member_id: number, + uid: string, + sessionid: string, + wallet_uid: string, + recipient_uid: string, + amount: number, + Fee: number, + mode: 100, }; - loading.present(); - this.wrenchService.sendMoneyAction(this.sendMoneyData).subscribe( - sendMoneyResult => { - loading.dismiss(); - this.sendMoneyResult = sendMoneyResult; - // - // "status_message": "tranfer_amount_limit_error", - // "internal_return": -1, - // - if ( this.sendMoneyResult!.internal_return != null && this.sendMoneyResult.internal_return > 0 ){ - console.log("sendMoneyResult RETURN->", this.sendMoneyResult); - this.confirmation = this.sendMoneyResult.confirmation; - } - else{ - this.confirmation = "Unable to Process."; - this.showAlert("Error",this.sendMoneyResult.status_message); - } - this.curr_page ='redeem_result'; + sendMoneyResult: any; + confirmation: string = ''; + + async confirmRedeem() { + + const loading = await this.loadingCtrl.create({ + message: 'Sending...', + duration: 8500, + }); + + + this.isDisabled = true; + this.sendMoneyData = { + action: 33020, + member_id: this.sessionDataProviderService.member_id, + uid: this.sessionDataProviderService.member_uid, + sessionid: this.sessionDataProviderService.session, + wallet_uid: this.wallet_uid, + recipient_uid: this.recipient_uid, + amount: this.amount * 100, + Fee: this.fee * 100, + mode: 100, + }; + + loading.present(); + this.wrenchService.sendMoneyAction(this.sendMoneyData).subscribe( + sendMoneyResult => { + loading.dismiss(); + this.sendMoneyResult = sendMoneyResult; + // + // "status_message": "tranfer_amount_limit_error", + // "internal_return": -1, + // + if (this.sendMoneyResult!.internal_return != null && this.sendMoneyResult.internal_return > 0) { + console.log("sendMoneyResult RETURN->", this.sendMoneyResult); + this.confirmation = this.sendMoneyResult.confirmation; + } else { + this.confirmation = "Unable to Process."; + this.showAlert("Error", this.sendMoneyResult.status_message); + } + this.curr_page = 'redeem_result'; + } + ); + } + + myRecipientsTotalData: any; + + getMyRecipientsData() { + this.usrData = { + action: 11175, + member_id: this.sessionDataProviderService.member_id, + uid: this.sessionDataProviderService.member_uid, + sessionid: this.sessionDataProviderService.session, + limit: 20, page: 1, + offset: 0, amount: 0 } - ); - } - myRecipientsTotalData:any; - getMyRecipientsData(){ - this.usrData = {action:11175, - member_id: this.sessionDataProviderService.member_id, - uid: this.sessionDataProviderService.member_uid, - sessionid: this.sessionDataProviderService.session , - limit:20, page:1, - offset: 0, amount: 0} + this.wrenchService.recipientAccount(this.usrData).subscribe( + myRecipientsTotalData => { + this.myRecipientsTotalData = myRecipientsTotalData; + console.log("myRecipientsTotalData RETURN->", this.myRecipientsTotalData); + this.myRecipientsData = this.myRecipientsTotalData.result_list; + // debugger; + console.log("myRecipientsData RETURN DATA->", this.myRecipientsData); + } + ); + } - this.wrenchService.recipientAccount(this.usrData).subscribe( - myRecipientsTotalData => { - this.myRecipientsTotalData = myRecipientsTotalData; - console.log("myRecipientsTotalData RETURN->", this.myRecipientsTotalData); - this.myRecipientsData = this.myRecipientsTotalData.result_list; - // debugger; - console.log("myRecipientsData RETURN DATA->", this.myRecipientsData); - } - ); - } - - addNewBank(){ - // debugger; - this.router.navigate(['addbank'],{state: this.walletData}); - } + addNewBank() { + // debugger; + this.router.navigate(['addbank'], {state: this.walletData}); + } } diff --git a/src/app/pages/transaction/transaction.page.html b/src/app/pages/transaction/transaction.page.html index 2f53e2b..ce1a9a4 100644 --- a/src/app/pages/transaction/transaction.page.html +++ b/src/app/pages/transaction/transaction.page.html @@ -10,92 +10,104 @@ - - - - - + + + + +
- - - {{item.description}} Wallet - {{item.amount*0.01 | number : '1.2-2'}} {{item.description}} - + + + {{item.description}} Wallet + {{item.amount * 0.01 | number : '1.2-2'}} {{item.description}} + + - - - - + + + + - - + + - - - -
- Redeem -
-
-
-
-
-
+ + + +
+ + Redeem + +
+
+ + + +
- - - - - + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +
- - - - + + + + - {{item.description}} Balance {{item.amount*0.01 | number : '1.2-2'}} + {{item.description}} + Balance {{item.amount * 0.01 | number : '1.2-2'}} -
+
-
+
{{item.description}} - Balance {{item.amount*0.01 | number : '1.2-2'}} + Balance {{item.amount * 0.01 | number : '1.2-2'}} + - Add Credit + Add Credit + -
- Redeem +
+ Redeem +
@@ -108,58 +120,59 @@
- - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - + + + + + - - - - + + + +
- Recent Transactions + Recent Redeem Transactions
-
+
@@ -172,45 +185,44 @@
- - - + + +
- - - - + + + + - - + + - - - - - - - + + + + + + + - - - - - + + + + + - - - + + +
-