add credit
This commit is contained in:
@@ -218,7 +218,7 @@
|
||||
</ion-content>
|
||||
<ion-footer>
|
||||
<ion-toolbar>
|
||||
<ion-button (click)="processPayment(processor)">Complete</ion-button>
|
||||
<ion-button [disabled]="isProcessDisabled" (click)="processPayment(processor)">Complete</ion-button>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
</ng-template>
|
||||
|
||||
@@ -20,6 +20,7 @@ export class AddcreditPage implements OnInit {
|
||||
currency_code:string='';
|
||||
wallet_uid:string='';
|
||||
isDisabled:boolean=true;
|
||||
isProcessDisabled:boolean=false;
|
||||
curr_page:string= 'redeem_start';
|
||||
processor:number=0;
|
||||
isModalOpen:boolean = false;
|
||||
@@ -113,6 +114,7 @@ export class AddcreditPage implements OnInit {
|
||||
loading.present();
|
||||
this.wrenchService.startCredit(this.startCreditData).subscribe(
|
||||
startCreditResult => {
|
||||
loading.dismiss();
|
||||
console.log("startCreditResult TOTAL RETURN->", this.startCreditResult);
|
||||
if ( startCreditResult!=undefined && startCreditResult.credit_reference!='' ){
|
||||
this.startCreditResult = startCreditResult;
|
||||
@@ -178,9 +180,58 @@ export class AddcreditPage implements OnInit {
|
||||
// this.total = this.fee + this.amount;
|
||||
}
|
||||
|
||||
processPayment(processor){
|
||||
creditResult:any;
|
||||
async processPayment(processor){
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Processing...',
|
||||
duration: 3500,
|
||||
});
|
||||
|
||||
if (this.processor == 5000){
|
||||
this.isProcessDisabled = true;
|
||||
this.payPevCreditData={
|
||||
member_id:this.sessionDataProviderService.member_id,
|
||||
sessionid:this.sessionDataProviderService.session,
|
||||
uid:this.sessionDataProviderService.member_uid,
|
||||
currency: this.currency_code,
|
||||
amount:this.startCreditResult.amount,
|
||||
credit_reference:this.startCreditResult.credit_reference,
|
||||
card_uid: this.startCreditResult.card_uid,
|
||||
action:11056
|
||||
};
|
||||
|
||||
|
||||
loading.present();
|
||||
this.wrenchService.payPrevCard(this.payPevCreditData).subscribe(
|
||||
creditResult => {
|
||||
loading.dismiss();
|
||||
console.log("creditResult TOTAL RETURN->", this.creditResult);
|
||||
if ( creditResult!=undefined && creditResult.internal_return > 0 && creditResult.confirmation !=''){
|
||||
alert("Completed");
|
||||
|
||||
// this.startCreditResult = startCreditResult;
|
||||
//
|
||||
//
|
||||
// this.isModalOpen = true;
|
||||
// this.isModalOpenBackdrop= true;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
payPevCreditData:{
|
||||
member_id:number,
|
||||
sessionid:string,
|
||||
uid:string,
|
||||
currency: string,
|
||||
amount:number,
|
||||
credit_reference:string,
|
||||
card_uid: string,
|
||||
action:number
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -273,6 +273,9 @@ export class WrenchService {
|
||||
return this.getPostData("startcredit", reqData);
|
||||
}
|
||||
|
||||
payPrevCard(reqData){
|
||||
return this.getPostData("payprevcard", reqData);
|
||||
}
|
||||
|
||||
familySuggestList(usrData){
|
||||
return this.getPostData("familysuggestlist", usrData);
|
||||
|
||||
Reference in New Issue
Block a user