Restore Interbank functionality
This commit is contained in:
@@ -114,4 +114,38 @@ export class AccountTransfersService {
|
||||
getViewAccountTransferDetails(transferId: any): Observable<any> {
|
||||
return this.http.get(`/accounttransfers/${transferId}`);
|
||||
}
|
||||
|
||||
getAccountByNumber(accountNumber: string, currency: string): Observable<any> {
|
||||
const payload = {
|
||||
partyId: accountNumber,
|
||||
partyIdType: 'MSISDN',
|
||||
currencyCode: currency
|
||||
};
|
||||
const headers = new HttpHeaders({ 'Content-Type': 'application/json' });
|
||||
return this.http
|
||||
.post(
|
||||
`${environment.vNextApiUrl}${environment.vNextApiVersion}${environment.vNextApiProvider}/participant`,
|
||||
JSON.stringify(payload),
|
||||
{ headers }
|
||||
)
|
||||
.pipe(
|
||||
switchMap((participant: any) => {
|
||||
const body = JSON.stringify({ ...payload, ownerFspId: participant.fspId });
|
||||
return this.http.post(
|
||||
`${environment.vNextApiUrl}${environment.vNextApiVersion}${environment.vNextApiProvider}/partyinfo`,
|
||||
body,
|
||||
{ headers }
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
sendInterbankTransfer(body: any): Observable<any> {
|
||||
const headers = new HttpHeaders({ 'Content-Type': 'application/json' });
|
||||
return this.http.post(
|
||||
`${environment.vNextApiUrl}${environment.vNextApiVersion}${environment.vNextApiProvider}/executetransfer`,
|
||||
body,
|
||||
{ headers }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+25
-1
@@ -318,7 +318,31 @@ export class MakeAccountTransfersComponent implements OnInit, AfterViewInit {
|
||||
},
|
||||
note: this.makeAccountTransferForm.controls.transferDescription.value
|
||||
};
|
||||
this.accountTransfersService.sendInterbankTransfer(JSON.stringify(payload)).subscribe(
|
||||
(trnsfr) => {
|
||||
if (trnsfr.systemMessage) {
|
||||
this.isLoading = false;
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
this.isLoading = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
searchAccountByNumber() {}
|
||||
searchAccountByNumber() {
|
||||
this.isLoading = true;
|
||||
this.accountTransfersService
|
||||
.getAccountByNumber(this.phoneAccount, this.accountTransferTemplateData.currency.code)
|
||||
.subscribe(
|
||||
(acc) => {
|
||||
this.interbankTransferForm = true;
|
||||
this.createMakeAccountInterbankTransferForm(acc);
|
||||
},
|
||||
(error) => {
|
||||
this.isLoading = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export class SavingsAccountViewComponent implements OnInit {
|
||||
taskPermissionName: 'CREATE_ACCOUNTTRANSFER'
|
||||
});
|
||||
}
|
||||
if (this.savingsAccountData.externalId) {
|
||||
if (this.savingsAccountData.externalId && environment.interbankTransfers === 'true') {
|
||||
this.buttonConfig.addOption({
|
||||
name: 'Interbank Transfer',
|
||||
taskPermissionName: 'CREATE_ACCOUNTTRANSFER'
|
||||
|
||||
@@ -47,4 +47,9 @@
|
||||
// Min Password length
|
||||
window['env']['minPasswordLength'] = '12';
|
||||
|
||||
window["env"]["vNextApiUrl"] = '';
|
||||
window["env"]["vNextApiProvider"] = '';
|
||||
window["env"]["vNextApiVersion"] = '';
|
||||
window["env"]["interbankTransfers"] = "false";
|
||||
|
||||
})(this);
|
||||
|
||||
@@ -46,4 +46,9 @@
|
||||
|
||||
// Min Password length
|
||||
window['env']['minPasswordLength'] = '$MIFOS_MIN_PASSWORD_LENGTH';
|
||||
|
||||
window['env']['vNextApiUrl'] = '$VNEXT_API_URL';
|
||||
window['env']['vNextApiProvider'] = '$VNEXT_API_PROVIDER';
|
||||
window['env']['vNextApiVersion'] = '$VNEXT_API_VERSION';
|
||||
window['env']['interbankTransfers'] = '$VNEXT_INTERBANK_TRANSFERS';
|
||||
})(this);
|
||||
|
||||
@@ -52,6 +52,11 @@ export const environment = {
|
||||
}
|
||||
},
|
||||
|
||||
vNextApiUrl: loadedEnv['vNextApiUrl'] || 'https://apis.mifos.community',
|
||||
vNextApiProvider: loadedEnv['vNextApiProvider'] || '/vnext1',
|
||||
vNextApiVersion: loadedEnv['vNextApiVersion'] || '/v1.0',
|
||||
interbankTransfers: loadedEnv['interbankTransfers'] || false,
|
||||
|
||||
minPasswordLength: loadedEnv['minPasswordLength'] || 12
|
||||
};
|
||||
|
||||
|
||||
@@ -55,7 +55,10 @@ export const environment = {
|
||||
idleTimeout: loadedEnv['sessionIdleTimeout'] || 300000 // 5 minutes
|
||||
}
|
||||
},
|
||||
|
||||
vNextApiUrl: loadedEnv['vNextApiUrl'] || 'https://apis.mifos.community',
|
||||
vNextApiProvider: loadedEnv['vNextApiProvider'] || '/vnext1',
|
||||
vNextApiVersion: loadedEnv['vNextApiVersion'] || '/v1.0',
|
||||
interbankTransfers: loadedEnv['interbankTransfers'] || false,
|
||||
minPasswordLength: loadedEnv['minPasswordLength'] || 12
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user