add credit
This commit is contained in:
@@ -137,7 +137,7 @@ export class AddcreditPage implements OnInit {
|
||||
*/
|
||||
payViaPromise() {
|
||||
|
||||
this.customerDetails = { name: this.sessionDataProviderService.firstname+''+this.sessionDataProviderService.firstname,
|
||||
this.customerDetails = { name: this.sessionDataProviderService.firstname+' '+this.sessionDataProviderService.firstname,
|
||||
email: this.sessionDataProviderService.email, phone_number: '08100000000'};
|
||||
this.meta = { counsumer_id: this.sessionDataProviderService.member_id.toString(),
|
||||
consumer_mac: this.sessionDataProviderService.member_uid,};
|
||||
@@ -151,12 +151,55 @@ export class AddcreditPage implements OnInit {
|
||||
|
||||
this.flutterwave.asyncInlinePay(this.paymentData).then(
|
||||
(response) =>{
|
||||
console.log("Promise Res" , response)
|
||||
if (response == 'closed'){
|
||||
console.log("Promise Res FAILED" , response);
|
||||
}
|
||||
else {
|
||||
console.log("Promise Res GOOD" , response);
|
||||
//debugger;
|
||||
if (response?.status != undefined && response.status=='successful'){
|
||||
this.credit_confirmation = 'Successful';
|
||||
this.showCrediAlert("Payment Processing","Completed");
|
||||
//---------------------------------------------------
|
||||
var completeCredit = {
|
||||
action:11061,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
tx_ref: this.startCreditResult.credit_reference
|
||||
};
|
||||
console.log("completeCredit **************** ->", completeCredit);
|
||||
this.wrenchService.topupResultFLTW(completeCredit).subscribe(
|
||||
competeCreditResult => {
|
||||
console.log("startCreditResult TOTAL RETURN->", this.startCreditResult);
|
||||
// debugger;
|
||||
if ( competeCreditResult!=undefined && competeCreditResult.tx_ref!='' && competeCreditResult.confirmation!='' ){
|
||||
this.credit_confirmation = competeCreditResult.confirmation;
|
||||
// this.startCreditResult = startCreditResult;
|
||||
// this.flutterwave_key = this.startCreditResult.flutterwave_key;
|
||||
|
||||
// this.isModalOpen = true;
|
||||
// this.isModalOpenBackdrop= true;
|
||||
const event = new Event("app-wallet-refresh");
|
||||
dispatchEvent(event);
|
||||
}
|
||||
}
|
||||
);
|
||||
// ------------------------------------------------------
|
||||
}
|
||||
}
|
||||
|
||||
this.flutterwave.closePaymentModal(5)
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
topupResultFLTW(reqData){
|
||||
return this.getPostData("topupresult", reqData);
|
||||
}
|
||||
*/
|
||||
generateReference(): string {
|
||||
let date = new Date();
|
||||
return date.getTime().toString();
|
||||
|
||||
@@ -1,19 +1,24 @@
|
||||
<ion-content class="full-page">
|
||||
<ion-card>
|
||||
<div class="page_logo">
|
||||
<img alt="WrenchBoard" src="/assets/images/wrenchboard-line.png" />
|
||||
<img alt="WrenchBoard" src="/assets/images/wrenchboard-line.png" />
|
||||
</div>
|
||||
<img alt="WrenchBoard" src="https://www.wrenchboard.com/assets/images/apps/log-out.jpg" />
|
||||
<ion-card-header>
|
||||
<!-- <ion-card-title>Card Title</ion-card-title>-->
|
||||
<ion-card-subtitle>Thanks for visiting
|
||||
</ion-card-subtitle>
|
||||
</ion-card-header>
|
||||
<div class="boxed_contents">
|
||||
<ion-card style="border-color: white; margin-top: 20px">
|
||||
<!-- <div class="page_logo">-->
|
||||
<!-- <img alt="WrenchBoard" src="/assets/images/wrenchboard-line.png" />-->
|
||||
<!-- </div>-->
|
||||
<img alt="WrenchBoard" src="https://www.wrenchboard.com/assets/images/apps/log-out.jpg" />
|
||||
<ion-card-header>
|
||||
<!-- <ion-card-title>Card Title</ion-card-title>-->
|
||||
<ion-card-subtitle>Thanks for visiting
|
||||
</ion-card-subtitle>
|
||||
</ion-card-header>
|
||||
|
||||
<ion-card-content>
|
||||
You are now logged out of your account.
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
<ion-card-content>
|
||||
You are now logged out of your account.
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-footer>
|
||||
<ion-toolbar>
|
||||
|
||||
@@ -18,7 +18,12 @@ export class TransactionPage implements OnInit {
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
public recipientsService: RecipientsService
|
||||
) { }
|
||||
) {
|
||||
|
||||
addEventListener('app-wallet-refresh', () => {
|
||||
this.getWalletData();
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
// this.getWalletData();
|
||||
|
||||
@@ -269,6 +269,10 @@ export class WrenchService {
|
||||
return this.getPostData("familytransfer", reqData);
|
||||
}
|
||||
|
||||
topupResultFLTW(reqData){
|
||||
return this.getPostData("topupresult", reqData);
|
||||
}
|
||||
|
||||
startCredit(reqData){
|
||||
return this.getPostData("startcredit", reqData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user