Result withdraw
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
<div class="ion-padding">
|
||||
<div class="flex">
|
||||
<ion-label class="bold_text">Redeem from {{currency_code}} Wallet</ion-label>
|
||||
<ion-label class="bold_text">{{currency_description}} Wallet</ion-label>
|
||||
<!-- <ion-icon slot="end" name="bookmark-outline" color="primary"></ion-icon>-->
|
||||
</div>
|
||||
<ion-label class="color_text">Balance: {{curr_balance}} {{currency_description}}</ion-label>
|
||||
@@ -42,30 +42,29 @@
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>Amount({{currency_code}})</ion-label>
|
||||
<ion-input label="Stacked label" type="number" label="Amount(ggg)" placeholder="Enter Amount"></ion-input>
|
||||
<ion-input (ionChange)="refreshFee()" type="number" label="Amount(ggg)" placeholder="Enter Amount" [(ngModel)]='amount'></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label >Fee</ion-label>
|
||||
<ion-input label="Fee" type="number" placeholder="000"></ion-input>
|
||||
<ion-input label="Fee" type="number" placeholder="0" [(ngModel)]='fee' [readonly]="true"></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>Total</ion-label>
|
||||
<ion-input label="Total" type="number" placeholder="000"></ion-input>
|
||||
<ion-input label="Total" type="number" placeholder="0" [(ngModel)]='total' [readonly]="true"></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>Recipient</ion-label>
|
||||
<ion-select label="Default label" placeholder="Favorite Fruit">
|
||||
<ion-select-option value="apple">Apple</ion-select-option>
|
||||
<ion-select-option value="banana">Banana</ion-select-option>
|
||||
<ion-select-option value="orange">Orange</ion-select-option>
|
||||
|
||||
<ion-select label="Recipient" placeholder="Select Recipient" [(ngModel)]='recipient'>
|
||||
<ion-select-option value="{{item.recipient_uid}}" *ngFor="let item of myRecipientsData">{{item.recipient}}</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
|
||||
<ion-button expand="block" (click)="contineRedeem()">Continue</ion-button>
|
||||
<ion-button expand="block" color="secondary" (click)="contineRedeem()">Continue</ion-button>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
</div>
|
||||
@@ -82,30 +81,26 @@
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>Amount({{currency_code}})</ion-label>
|
||||
<ion-input label="Stacked label" type="number" label="Amount(ggg)" placeholder="Enter Amount"></ion-input>
|
||||
<ion-input label="Fee" type="number" placeholder="0" value="{{amount}}" [readonly]="true"></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label >Fee</ion-label>
|
||||
<ion-input label="Fee" type="number" placeholder="000"></ion-input>
|
||||
<ion-input label="Fee" type="number" placeholder="0" [(ngModel)]='fee' [readonly]="true"></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>Total</ion-label>
|
||||
<ion-input label="Total" type="number" placeholder="000"></ion-input>
|
||||
<ion-input label="Total" type="number" placeholder="0" [(ngModel)]='total' [readonly]="true"></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>Recipient</ion-label>
|
||||
<ion-select label="Default label" placeholder="Favorite Fruit">
|
||||
<ion-select-option value="apple">Apple</ion-select-option>
|
||||
<ion-select-option value="banana">Banana</ion-select-option>
|
||||
<ion-select-option value="orange">Orange</ion-select-option>
|
||||
</ion-select>
|
||||
<ion-label>{{recipient_name}}</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
|
||||
<ion-button expand="block" (click)="confirmRedeem()">Confirm</ion-button>
|
||||
<ion-button expand="block" color="secondary" (click)="confirmRedeem()">Confirm</ion-button>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
</div>
|
||||
@@ -123,26 +118,27 @@
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>Amount({{currency_code}})</ion-label>
|
||||
<ion-input label="Stacked label" type="number" label="Amount(ggg)" placeholder="Enter Amount"></ion-input>
|
||||
<ion-input label="Fee" type="number" placeholder="0" value="{{amount}}" [readonly]="true"></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label >Fee</ion-label>
|
||||
<ion-input label="Fee" type="number" placeholder="000"></ion-input>
|
||||
<ion-input label="Fee" type="number" placeholder="0" [(ngModel)]='fee' [readonly]="true"></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>Total</ion-label>
|
||||
<ion-input label="Total" type="number" placeholder="000"></ion-input>
|
||||
<ion-input label="Total" type="number" placeholder="0" [(ngModel)]='total' [readonly]="true"></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>Recipient</ion-label>
|
||||
<ion-select label="Default label" placeholder="Favorite Fruit">
|
||||
<ion-select-option value="apple">Apple</ion-select-option>
|
||||
<ion-select-option value="banana">Banana</ion-select-option>
|
||||
<ion-select-option value="orange">Orange</ion-select-option>
|
||||
</ion-select>
|
||||
<ion-label>{{recipient_name}}</ion-label>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>Confirmation</ion-label>
|
||||
<ion-label>{{confirmation}}</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
|
||||
ion-content {
|
||||
ion-card{
|
||||
margin: 10px 0px 10px 0px;
|
||||
}
|
||||
ion-card-title{
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ wallet_uid
|
||||
curr_balance:number =0;
|
||||
currency_description : string='';
|
||||
currency_code:string='';
|
||||
wallet_uid:string='';
|
||||
|
||||
constructor(
|
||||
private navctr: NavController,
|
||||
@@ -58,12 +59,14 @@ wallet_uid
|
||||
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;
|
||||
|
||||
|
||||
// debugger;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getMyRecipientsData();
|
||||
this.getPaymentHxData();
|
||||
}
|
||||
|
||||
@@ -72,12 +75,19 @@ wallet_uid
|
||||
}
|
||||
|
||||
usrData: {
|
||||
action:number, member_id: number, uid: string, sessionid: string, limit:20, page:1
|
||||
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}
|
||||
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;
|
||||
@@ -91,13 +101,173 @@ wallet_uid
|
||||
|
||||
}
|
||||
|
||||
curr_page:string= 'redeem_start'
|
||||
contineRedeem(){
|
||||
this.curr_page ='redeem_confirm';
|
||||
/*
|
||||
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;
|
||||
total:number = 0;
|
||||
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;
|
||||
// parseFloat("123.456").toFixed(2);
|
||||
this.total = this.feeReturn.total_amount*0.01;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// this.total = this.fee + this.amount;
|
||||
}
|
||||
|
||||
confirmRedeem(){
|
||||
this.curr_page ='redeem_result';
|
||||
|
||||
|
||||
curr_page:string= 'redeem_start'
|
||||
recipient_uid:string = '';
|
||||
contineRedeem(){
|
||||
if (this.recipient == ''){
|
||||
alert("Select Recipient");
|
||||
return;
|
||||
}
|
||||
if (this.amount <= 0 ) {
|
||||
alert("Enter Amount");
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.curr_balance < this.total){
|
||||
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';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
{
|
||||
"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 ='';
|
||||
confirmRedeem(){
|
||||
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,
|
||||
};
|
||||
|
||||
this.wrenchService.sendMoneyAction(this.sendMoneyData).subscribe(
|
||||
sendMoneyResult => {
|
||||
this.sendMoneyResult = sendMoneyResult;
|
||||
console.log("sendMoneyResult RETURN->", this.sendMoneyResult);
|
||||
this.confirmation = this.sendMoneyResult.confirmation;
|
||||
this.curr_page ='redeem_result';
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
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, 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);
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
//recipientAccount
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -169,6 +169,17 @@ export class WrenchService {
|
||||
return this.getPostData("jobmanageroffers", usrData);
|
||||
}
|
||||
|
||||
recipientAccount(usrData){
|
||||
return this.getPostData("recipients", usrData);
|
||||
}
|
||||
|
||||
sendMoneyFee(usrData){
|
||||
return this.getPostData("sendmoneyfee", usrData);
|
||||
}
|
||||
|
||||
sendMoneyAction(sendmoneyData){
|
||||
return this.getPostData("sendmoney", sendmoneyData);
|
||||
}
|
||||
// END POINT FOR WORKER TO MARK TASK AS COMPLETED
|
||||
workerJobAction(reqData) {
|
||||
var postData = {
|
||||
|
||||
Reference in New Issue
Block a user