digipay-utility-payment 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
@@ -198,6 +198,9 @@ class UserService {
|
|
|
198
198
|
getUserByIdUsingJava(id, params = {}) {
|
|
199
199
|
return this.http.get(`${this.baseUrl}/user/user_detail/${id}`, { params, headers: this.defaultHeaders });
|
|
200
200
|
}
|
|
201
|
+
getUserConfig(params = {}) {
|
|
202
|
+
return this.http.get(`${this.baseUrl}/user/user_config`, { params, headers: this.defaultHeaders });
|
|
203
|
+
}
|
|
201
204
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
202
205
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: UserService, providedIn: 'root' });
|
|
203
206
|
}
|
|
@@ -240,6 +243,28 @@ class WalletService {
|
|
|
240
243
|
getWalletUsingJava(params = {}) {
|
|
241
244
|
return this.http.get(`${this.baseUrl}/transaction/wallet`, { params, headers: this.defaultHeaders });
|
|
242
245
|
}
|
|
246
|
+
calculateCharges(params = {}) {
|
|
247
|
+
return this.http.post(`${this.baseUrl}/transaction/calculate_charges`, params, {
|
|
248
|
+
headers: this.defaultHeaders,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
calculateAgentCharges(params = {}) {
|
|
252
|
+
return this.http.post(`${this.baseUrl}/transaction/agent_calculate_charges`, params, {
|
|
253
|
+
headers: this.defaultHeaders,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
getAgentChargesListUsingJava(params = {}) {
|
|
257
|
+
return this.http.get(`${this.baseUrl}/agent_profile_threshold/agent_charges`, {
|
|
258
|
+
params,
|
|
259
|
+
headers: this.defaultHeaders,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
getAgentChargeDetailsByIdUsingJava(params) {
|
|
263
|
+
return this.http.get(`${this.baseUrl}/agent_profile_threshold/agent_charges_detail`, {
|
|
264
|
+
params,
|
|
265
|
+
headers: this.defaultHeaders,
|
|
266
|
+
});
|
|
267
|
+
}
|
|
243
268
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: WalletService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
244
269
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: WalletService, providedIn: 'root' });
|
|
245
270
|
}
|
|
@@ -757,10 +782,10 @@ class UtilitiesComponent {
|
|
|
757
782
|
this.getProviderCategories();
|
|
758
783
|
}
|
|
759
784
|
getProviderCategories() {
|
|
760
|
-
this.topupAndBillpaymentService.getTopupAndBillpaymentCategories().subscribe({
|
|
785
|
+
this.topupAndBillpaymentService.getTopupAndBillpaymentCategories({ is_active: true }).subscribe({
|
|
761
786
|
next: (res) => {
|
|
762
787
|
if (res?.success) {
|
|
763
|
-
this.providerCategories = res?.data?.provider_category_master;
|
|
788
|
+
this.providerCategories = res?.data?.provider_category_master?.filter((data) => data?.is_active);
|
|
764
789
|
}
|
|
765
790
|
else {
|
|
766
791
|
this.providerCategories = [];
|
|
@@ -3643,8 +3668,12 @@ class ViewBillsComponent {
|
|
|
3643
3668
|
}
|
|
3644
3669
|
else {
|
|
3645
3670
|
this.toasterService.error(this.translationService.translate(res?.error[0]));
|
|
3671
|
+
this.showLoader = false;
|
|
3646
3672
|
}
|
|
3647
3673
|
},
|
|
3674
|
+
error: () => {
|
|
3675
|
+
this.showLoader = false;
|
|
3676
|
+
}
|
|
3648
3677
|
});
|
|
3649
3678
|
}
|
|
3650
3679
|
handleBillClick(data) {
|
|
@@ -3851,6 +3880,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
3851
3880
|
}], ctorParameters: () => [] });
|
|
3852
3881
|
|
|
3853
3882
|
class UserProfileService {
|
|
3883
|
+
http = inject(HttpClient);
|
|
3884
|
+
config = inject(PaymentsConfigService);
|
|
3885
|
+
authProvider = inject(UTILITY_PAYMENTS_AUTH_PROVIDER, { optional: true });
|
|
3886
|
+
get baseUrl() {
|
|
3887
|
+
return this.config.getConfig()?.baseUrl ?? '';
|
|
3888
|
+
}
|
|
3889
|
+
get defaultHeaders() {
|
|
3890
|
+
const cfg = this.config.getConfig();
|
|
3891
|
+
const fromConfig = (cfg?.defaultHeaders ?? {});
|
|
3892
|
+
const fromAuth = this.buildAuthHeaders();
|
|
3893
|
+
return { ...fromAuth, ...fromConfig };
|
|
3894
|
+
}
|
|
3895
|
+
buildAuthHeaders() {
|
|
3896
|
+
const headers = {};
|
|
3897
|
+
if (!this.authProvider)
|
|
3898
|
+
return headers;
|
|
3899
|
+
const token = this.authProvider.getToken();
|
|
3900
|
+
const companyId = this.authProvider.getCompanyId();
|
|
3901
|
+
const userId = this.authProvider.getUserId();
|
|
3902
|
+
if (token)
|
|
3903
|
+
headers['Authorization'] = token.startsWith('Bearer ') ? token : `Bearer ${token}`;
|
|
3904
|
+
if (companyId != null)
|
|
3905
|
+
headers['companyid'] = String(companyId);
|
|
3906
|
+
if (userId != null)
|
|
3907
|
+
headers['userid'] = String(userId);
|
|
3908
|
+
return headers;
|
|
3909
|
+
}
|
|
3910
|
+
getProfileProductsDetailsUsingJava(params = {}) {
|
|
3911
|
+
return this.http.get(`${this.baseUrl}/profile_threshold/profile_products`, {
|
|
3912
|
+
params,
|
|
3913
|
+
headers: this.defaultHeaders,
|
|
3914
|
+
});
|
|
3915
|
+
}
|
|
3916
|
+
getProfileProductChargesUsingJava(params = {}) {
|
|
3917
|
+
return this.http.get(`${this.baseUrl}/profile_threshold/profile_product_charges`, {
|
|
3918
|
+
params,
|
|
3919
|
+
headers: this.defaultHeaders,
|
|
3920
|
+
});
|
|
3921
|
+
}
|
|
3922
|
+
getUserProfileUsingJava(params = {}) {
|
|
3923
|
+
return this.http.get(`${this.baseUrl}/profile_threshold/user_profile`, {
|
|
3924
|
+
params,
|
|
3925
|
+
headers: this.defaultHeaders,
|
|
3926
|
+
});
|
|
3927
|
+
}
|
|
3928
|
+
getAgentProfileById(id, params = {}) {
|
|
3929
|
+
return this.http.get(`${this.baseUrl}/agent_profile_threshold/agent_profile/${id}`, {
|
|
3930
|
+
params,
|
|
3931
|
+
headers: this.defaultHeaders,
|
|
3932
|
+
});
|
|
3933
|
+
}
|
|
3934
|
+
getAgentProfileProductDetailsUsingJava(params = {}) {
|
|
3935
|
+
return this.http.get(`${this.baseUrl}/agent_profile_threshold/agent_profile_products`, {
|
|
3936
|
+
params,
|
|
3937
|
+
headers: this.defaultHeaders,
|
|
3938
|
+
});
|
|
3939
|
+
}
|
|
3940
|
+
getAgentUserProfile(params = {}) {
|
|
3941
|
+
return this.http.get(`${this.baseUrl}/agent_profile_threshold/agent_user_profiles`, {
|
|
3942
|
+
params,
|
|
3943
|
+
headers: this.defaultHeaders,
|
|
3944
|
+
});
|
|
3945
|
+
}
|
|
3854
3946
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: UserProfileService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3855
3947
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: UserProfileService, providedIn: 'root' });
|
|
3856
3948
|
}
|
|
@@ -4179,14 +4271,134 @@ var AuthenticationMethod;
|
|
|
4179
4271
|
AuthenticationMethod["OTP"] = "OTP";
|
|
4180
4272
|
})(AuthenticationMethod || (AuthenticationMethod = {}));
|
|
4181
4273
|
|
|
4182
|
-
async function checkUserProfiles(
|
|
4183
|
-
|
|
4274
|
+
async function checkUserProfiles(data) {
|
|
4275
|
+
const params = {};
|
|
4276
|
+
const userType = data?.userType;
|
|
4277
|
+
let profileData = {};
|
|
4278
|
+
let productExists = false;
|
|
4279
|
+
params['user_id'] = data?.userId ?? null;
|
|
4280
|
+
params['wallet_id'] = data?.walletId ?? null;
|
|
4281
|
+
params['currency_id'] = data?.currencyId ?? null;
|
|
4282
|
+
if (userType === USER_TYPES.AGENT) {
|
|
4283
|
+
const agentProfileResponse = await firstValueFrom(data.userProfileService.getAgentUserProfile(params));
|
|
4284
|
+
const userProfileData = agentProfileResponse?.data?.agent_user_profile;
|
|
4285
|
+
const profile = Array.isArray(userProfileData)
|
|
4286
|
+
? userProfileData[0]
|
|
4287
|
+
: userProfileData
|
|
4288
|
+
? userProfileData
|
|
4289
|
+
: null;
|
|
4290
|
+
if (isNotNull(profile)) {
|
|
4291
|
+
const profileId = (profileData['profileId'] = profile?.agent_profile_id);
|
|
4292
|
+
const agentProfileByIdResponse = await firstValueFrom(data.userProfileService.getAgentProfileById(profileId));
|
|
4293
|
+
profileData =
|
|
4294
|
+
isNotNull(agentProfileByIdResponse?.data?.agent_profile) && agentProfileByIdResponse?.success
|
|
4295
|
+
? { ...agentProfileByIdResponse.data.agent_profile }
|
|
4296
|
+
: null;
|
|
4297
|
+
const productDetailsResponse = await firstValueFrom(data.userProfileService.getAgentProfileProductDetailsUsingJava({
|
|
4298
|
+
agent_profile_id: profileId,
|
|
4299
|
+
product_code: data?.product_code,
|
|
4300
|
+
}));
|
|
4301
|
+
productExists =
|
|
4302
|
+
isNotNull(productDetailsResponse?.data?.agent_profile_product) &&
|
|
4303
|
+
productDetailsResponse?.success;
|
|
4304
|
+
}
|
|
4305
|
+
}
|
|
4306
|
+
else {
|
|
4307
|
+
params['user_type'] = data?.userType ?? null;
|
|
4308
|
+
const userProfileResponse = await firstValueFrom(data.userProfileService.getUserProfileUsingJava(params));
|
|
4309
|
+
const userProfileData = isNotNull(userProfileResponse?.data?.user_profile)
|
|
4310
|
+
? userProfileResponse.data.user_profile
|
|
4311
|
+
: null;
|
|
4312
|
+
if (isNotNull(userProfileData)) {
|
|
4313
|
+
const profileId = (profileData['id'] = userProfileData?.profile_id);
|
|
4314
|
+
const productDetailsResponse = await firstValueFrom(data.userProfileService.getProfileProductsDetailsUsingJava({
|
|
4315
|
+
profile_id: profileId,
|
|
4316
|
+
product_code: data?.product_code,
|
|
4317
|
+
}));
|
|
4318
|
+
productExists =
|
|
4319
|
+
isNotNull(productDetailsResponse?.data?.profile_product) && productDetailsResponse?.success;
|
|
4320
|
+
}
|
|
4321
|
+
}
|
|
4322
|
+
return productExists ? profileData : null;
|
|
4184
4323
|
}
|
|
4185
|
-
async function calculateCharges(
|
|
4186
|
-
|
|
4324
|
+
async function calculateCharges(chargeParams) {
|
|
4325
|
+
const walletService = chargeParams.walletService;
|
|
4326
|
+
const userType = chargeParams.userType;
|
|
4327
|
+
let calculatedCharges = null;
|
|
4328
|
+
let calculateChargeResponse = null;
|
|
4329
|
+
let chargeListResponse = null;
|
|
4330
|
+
let agentChargeDetailsResponse = null;
|
|
4331
|
+
let profileProductChargesResponse = null;
|
|
4332
|
+
const params = {};
|
|
4333
|
+
params['wallet_id'] = chargeParams.walletId ?? null;
|
|
4334
|
+
params['currency_id'] = chargeParams.currencyId ?? null;
|
|
4335
|
+
params['product_code'] = chargeParams.productCode ?? null;
|
|
4336
|
+
params['txn_amount'] = chargeParams.amount ?? null;
|
|
4337
|
+
if (userType === USER_TYPES.AGENT) {
|
|
4338
|
+
params['tree_id'] = chargeParams.tree_id ?? null;
|
|
4339
|
+
params['tree_level_id'] = chargeParams.tree_level_id ?? null;
|
|
4340
|
+
calculateChargeResponse = await firstValueFrom(walletService.calculateAgentCharges(params));
|
|
4341
|
+
const listParams = {
|
|
4342
|
+
tree_id: chargeParams.tree_id ?? null,
|
|
4343
|
+
tree_level_id: chargeParams.tree_level_id ?? null,
|
|
4344
|
+
currency_id: chargeParams.currencyId ?? null,
|
|
4345
|
+
};
|
|
4346
|
+
chargeListResponse = await firstValueFrom(walletService.getAgentChargesListUsingJava(listParams));
|
|
4347
|
+
const agentChargeId = chargeListResponse?.success
|
|
4348
|
+
? chargeListResponse?.data?.agent_charges?.[0]?.id
|
|
4349
|
+
: null;
|
|
4350
|
+
if (agentChargeId && chargeParams.productCode) {
|
|
4351
|
+
agentChargeDetailsResponse = await firstValueFrom(walletService.getAgentChargeDetailsByIdUsingJava({
|
|
4352
|
+
agent_charges_id: agentChargeId,
|
|
4353
|
+
product_code: chargeParams.productCode,
|
|
4354
|
+
}));
|
|
4355
|
+
}
|
|
4356
|
+
}
|
|
4357
|
+
else {
|
|
4358
|
+
params['profile_id'] = chargeParams.profileId ?? null;
|
|
4359
|
+
calculateChargeResponse = await firstValueFrom(walletService.calculateCharges(params));
|
|
4360
|
+
const userProfileService = chargeParams.userProfileService;
|
|
4361
|
+
const profileId = chargeParams.profileId;
|
|
4362
|
+
const productCode = chargeParams.productCode;
|
|
4363
|
+
if (userProfileService && profileId && productCode) {
|
|
4364
|
+
profileProductChargesResponse = await firstValueFrom(userProfileService.getProfileProductChargesUsingJava({
|
|
4365
|
+
profile_id: profileId,
|
|
4366
|
+
product_code: productCode,
|
|
4367
|
+
}));
|
|
4368
|
+
}
|
|
4369
|
+
}
|
|
4370
|
+
calculatedCharges =
|
|
4371
|
+
isNotNull(calculateChargeResponse?.data?.charges_info) && calculateChargeResponse?.success
|
|
4372
|
+
? calculateChargeResponse.data.charges_info
|
|
4373
|
+
: null;
|
|
4374
|
+
const result = calculatedCharges ? { ...calculatedCharges } : null;
|
|
4375
|
+
if (result && userType === USER_TYPES.AGENT && agentChargeDetailsResponse?.success) {
|
|
4376
|
+
const raw = agentChargeDetailsResponse?.data?.agent_charge_detail ??
|
|
4377
|
+
agentChargeDetailsResponse?.data?.agent_charge_details;
|
|
4378
|
+
const detail = Array.isArray(raw) ? raw[0] : raw;
|
|
4379
|
+
if (detail?.allow_shared_charges) {
|
|
4380
|
+
result.allow_shared_charges = detail.allow_shared_charges;
|
|
4381
|
+
result.share_charge_config_id = detail.share_charge_config_id ?? null;
|
|
4382
|
+
}
|
|
4383
|
+
}
|
|
4384
|
+
if (result && userType !== USER_TYPES.AGENT && profileProductChargesResponse?.success) {
|
|
4385
|
+
const raw = profileProductChargesResponse?.data?.profile_product_charges ??
|
|
4386
|
+
profileProductChargesResponse?.data?.profile_product_charges;
|
|
4387
|
+
const detail = Array.isArray(raw) ? raw[0] : raw;
|
|
4388
|
+
if (detail?.allow_shared_charges) {
|
|
4389
|
+
result.allow_shared_charges = detail.allow_shared_charges;
|
|
4390
|
+
result.share_charge_config_id = detail.share_charge_config_id ?? null;
|
|
4391
|
+
}
|
|
4392
|
+
}
|
|
4393
|
+
return result;
|
|
4187
4394
|
}
|
|
4188
|
-
async function getUserConfigDetails(
|
|
4189
|
-
|
|
4395
|
+
async function getUserConfigDetails(userConfigDetails) {
|
|
4396
|
+
const params = {};
|
|
4397
|
+
if (userConfigDetails?.userId) {
|
|
4398
|
+
params['user_id'] = userConfigDetails.userId;
|
|
4399
|
+
}
|
|
4400
|
+
const userConfig = await firstValueFrom(userConfigDetails.userService.getUserConfig(params));
|
|
4401
|
+
return userConfig?.data?.user_config?.[0];
|
|
4190
4402
|
}
|
|
4191
4403
|
|
|
4192
4404
|
/// <reference path="../globals.d.ts" />
|
|
@@ -4468,10 +4680,13 @@ class TopupAndBillpaymentReviewComponent extends TransactionClass {
|
|
|
4468
4680
|
this.userDetail();
|
|
4469
4681
|
}
|
|
4470
4682
|
async calculatCharge() {
|
|
4683
|
+
const cfg = (this.paymentsConfigService.getConfig() ?? {});
|
|
4684
|
+
const cfgHeaders = (cfg?.defaultHeaders ?? {});
|
|
4685
|
+
const userId = (cfgHeaders["userid"] ?? cfgHeaders["userId"] ?? cfg?.userId ?? "").toString().trim();
|
|
4471
4686
|
this.showLoader = true;
|
|
4472
4687
|
let profileDetails = {
|
|
4473
4688
|
"userProfileService": this.userprofileService,
|
|
4474
|
-
"userId":
|
|
4689
|
+
"userId": userId,
|
|
4475
4690
|
"walletId": this.walletId,
|
|
4476
4691
|
"userType": USER_TYPES.AGENT,
|
|
4477
4692
|
"currencyId": this.currencyId,
|
|
@@ -4827,7 +5042,7 @@ class TopupAndBillpaymentReviewComponent extends TransactionClass {
|
|
|
4827
5042
|
submitPINForm() {
|
|
4828
5043
|
this.otpConfirm = true;
|
|
4829
5044
|
this.formErrors = {};
|
|
4830
|
-
this.showLoader =
|
|
5045
|
+
this.showLoader = true;
|
|
4831
5046
|
if (this.txnPINForm.valid) {
|
|
4832
5047
|
const pin = this.txnPINForm.value.pin;
|
|
4833
5048
|
if (!this.isTxnPinCreated) {
|
|
@@ -4835,6 +5050,7 @@ class TopupAndBillpaymentReviewComponent extends TransactionClass {
|
|
|
4835
5050
|
this.txnPINForm.reset();
|
|
4836
5051
|
this.hideModal("TransactionPIN");
|
|
4837
5052
|
this.showModal("ConfirmTransactionPIN");
|
|
5053
|
+
this.showLoader = true;
|
|
4838
5054
|
}
|
|
4839
5055
|
else {
|
|
4840
5056
|
this.verifyTransactionPin(pin);
|
|
@@ -4853,6 +5069,7 @@ class TopupAndBillpaymentReviewComponent extends TransactionClass {
|
|
|
4853
5069
|
this.hideModal("OTPVerification");
|
|
4854
5070
|
this.otpReset = true;
|
|
4855
5071
|
this.createIntent();
|
|
5072
|
+
this.showLoader = false;
|
|
4856
5073
|
}
|
|
4857
5074
|
else {
|
|
4858
5075
|
this.otpReset = true;
|
|
@@ -4860,6 +5077,7 @@ class TopupAndBillpaymentReviewComponent extends TransactionClass {
|
|
|
4860
5077
|
this.inValidTxnPin = true;
|
|
4861
5078
|
const apiError = res?.error?.[0] || res?.error || this.translationService.translate("LABEL_SOMETHING_WENT_WRONG");
|
|
4862
5079
|
this.toasterService.error(this.translationService.translate(apiError));
|
|
5080
|
+
this.showLoader = false;
|
|
4863
5081
|
}
|
|
4864
5082
|
},
|
|
4865
5083
|
error: (error) => {
|
|
@@ -5656,12 +5874,24 @@ class UtilityPaymentsContainerComponent {
|
|
|
5656
5874
|
}
|
|
5657
5875
|
buildRuntimeConfig(value) {
|
|
5658
5876
|
const normalizedBaseUrl = (value.baseUrl ?? '').trim().replace(/\/+$/, '');
|
|
5659
|
-
const
|
|
5660
|
-
const
|
|
5661
|
-
|
|
5877
|
+
const incomingHeaders = (value.defaultHeaders ?? {});
|
|
5878
|
+
const normalizedExtraHeaders = Object.entries(incomingHeaders).reduce((acc, [key, rawValue]) => {
|
|
5879
|
+
if (['Authorization', 'authorization', 'companyid', 'companyId', 'userid', 'userId'].includes(key)) {
|
|
5880
|
+
return acc;
|
|
5881
|
+
}
|
|
5882
|
+
const normalizedValue = this.normalizeHeaderValue(rawValue);
|
|
5883
|
+
if (normalizedValue) {
|
|
5884
|
+
acc[key] = normalizedValue;
|
|
5885
|
+
}
|
|
5886
|
+
return acc;
|
|
5887
|
+
}, {});
|
|
5888
|
+
const token = this.normalizeHeaderValue(value.token ?? incomingHeaders['Authorization'] ?? incomingHeaders['authorization']);
|
|
5889
|
+
const companyId = this.normalizeHeaderValue(value.companyId ?? incomingHeaders['companyid'] ?? incomingHeaders['companyId']);
|
|
5890
|
+
const userId = this.normalizeHeaderValue(value.userId ?? incomingHeaders['userid'] ?? incomingHeaders['userId']);
|
|
5662
5891
|
return {
|
|
5663
5892
|
baseUrl: normalizedBaseUrl,
|
|
5664
5893
|
defaultHeaders: {
|
|
5894
|
+
...normalizedExtraHeaders,
|
|
5665
5895
|
...(token ? { Authorization: token.includes(' ') ? token : `Bearer ${token}` } : {}),
|
|
5666
5896
|
...(companyId ? { companyid: companyId } : {}),
|
|
5667
5897
|
...(userId ? { userid: userId } : {}),
|
|
@@ -5669,18 +5899,18 @@ class UtilityPaymentsContainerComponent {
|
|
|
5669
5899
|
};
|
|
5670
5900
|
}
|
|
5671
5901
|
normalizeConfig(inputConfig) {
|
|
5672
|
-
const formValue = this.configForm.getRawValue();
|
|
5673
5902
|
const incomingHeaders = (inputConfig?.defaultHeaders ?? {});
|
|
5674
|
-
const tokenFromIncoming = incomingHeaders['Authorization'] ?? inputConfig?.token ?? '';
|
|
5675
|
-
const companyIdFromIncoming = incomingHeaders['companyid'] ?? inputConfig?.companyId ?? '';
|
|
5676
|
-
const userIdFromIncoming = incomingHeaders['userid'] ?? inputConfig?.userId ?? '';
|
|
5677
5903
|
return this.buildRuntimeConfig({
|
|
5678
|
-
baseUrl: inputConfig?.baseUrl ??
|
|
5679
|
-
token:
|
|
5680
|
-
companyId:
|
|
5681
|
-
userId:
|
|
5904
|
+
baseUrl: inputConfig?.baseUrl ?? '',
|
|
5905
|
+
token: inputConfig?.token ?? incomingHeaders['Authorization'] ?? incomingHeaders['authorization'] ?? '',
|
|
5906
|
+
companyId: inputConfig?.companyId ?? incomingHeaders['companyid'] ?? incomingHeaders['companyId'] ?? '',
|
|
5907
|
+
userId: inputConfig?.userId ?? incomingHeaders['userid'] ?? incomingHeaders['userId'] ?? '',
|
|
5908
|
+
defaultHeaders: incomingHeaders,
|
|
5682
5909
|
});
|
|
5683
5910
|
}
|
|
5911
|
+
normalizeHeaderValue(value) {
|
|
5912
|
+
return value == null ? '' : String(value).trim();
|
|
5913
|
+
}
|
|
5684
5914
|
loadRuntimeConfigFromStorage() {
|
|
5685
5915
|
try {
|
|
5686
5916
|
const raw = localStorage.getItem(this.runtimeConfigStorageKey);
|
|
@@ -5807,7 +6037,7 @@ class UtilityPaymentsContainerComponent {
|
|
|
5807
6037
|
}
|
|
5808
6038
|
}
|
|
5809
6039
|
</div>
|
|
5810
|
-
`, isInline: true, styles: [":host{display:block}:host ::ng-deep .sdk-utility-payments-container{font-size:13px;line-height:1.3}:host ::ng-deep .content{padding:.
|
|
6040
|
+
`, isInline: true, styles: [":host{display:block}:host ::ng-deep .sdk-utility-payments-container{font-size:13px;line-height:1.3}:host ::ng-deep .content{padding:.25rem!important}:host ::ng-deep .page-header{margin-bottom:.6rem!important}:host ::ng-deep .page-header h1{font-size:1.75rem!important;margin-bottom:.25rem!important}:host ::ng-deep sdk-utilities .utilities-title{font-size:1.875rem!important;font-weight:700!important;line-height:1.2!important;letter-spacing:-.02em}:host ::ng-deep .card{border-radius:8px}:host ::ng-deep .card-header{padding:.6rem .9rem!important}:host ::ng-deep .card-title{font-size:1rem!important;margin-bottom:0!important}:host ::ng-deep .card-body{padding:.8rem!important}:host ::ng-deep .form-control,:host ::ng-deep .ng-select .ng-select-container{min-height:34px!important;font-size:13px!important}:host ::ng-deep .form-label,:host ::ng-deep label{font-size:13px!important;margin-bottom:.25rem!important}:host ::ng-deep .btn{font-size:13px!important;padding:.3rem .65rem!important}:host ::ng-deep .work-flow-card{max-width:400px!important;width:100%!important;margin-left:auto!important;margin-right:auto!important}:host ::ng-deep .work-flow-page-header .page-title,:host ::ng-deep .work-flow-page-header h1{font-size:.95rem!important}:host ::ng-deep .work-flow-card .card-header{padding:.4rem .6rem!important}:host ::ng-deep .work-flow-card .card-title{font-size:.85rem!important}:host ::ng-deep .work-flow-card .card-body{padding:.55rem .65rem .7rem!important}:host ::ng-deep .work-flow-card .form-group.form-row{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;margin-bottom:.55rem!important}:host ::ng-deep .work-flow-card .form-group.form-row>label.control-label{flex:0 0 8.5rem!important;max-width:8.5rem!important;width:8.5rem!important;margin-bottom:0!important;padding-top:0!important;text-align:right!important;font-size:.72rem!important}:host ::ng-deep .work-flow-card .form-group.form-row>.col-md-8{flex:1 1 auto!important;max-width:none!important;width:auto!important}:host ::ng-deep .work-flow-card .form-control{min-height:26px!important;height:26px!important;max-width:200px!important;width:60%!important;font-size:.72rem!important;padding:.1rem .35rem!important}:host ::ng-deep .work-flow-card textarea.form-control{height:auto!important;min-height:3rem!important;max-width:100%!important}:host ::ng-deep .work-flow-card .work-flow-footer .btn{font-size:.7rem!important;padding:.15rem .45rem!important}:host ::ng-deep .vendor-products-shell>.card-body{padding:1.25rem 1.35rem 1.5rem!important}:host ::ng-deep .vendor-products-shell .vendor-product-card .form-control{min-height:auto!important;height:auto!important;max-width:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: UtilitiesComponent, selector: "sdk-utilities" }, { kind: "component", type: VendorProvidersComponent, selector: "sdk-vendor-providers" }, { kind: "component", type: WorkFlowComponent, selector: "sdk-work-flow" }, { kind: "component", type: RegionCommuneComponent, selector: "sdk-region-commune" }, { kind: "component", type: VendorProductsComponent, selector: "sdk-vendor-products", inputs: ["billData"], outputs: ["workflowCompleted"] }, { kind: "component", type: VendorPlansComponent, selector: "sdk-vendor-plans" }, { kind: "component", type: ViewBillsComponent, selector: "sdk-view-bills" }, { kind: "component", type: TopupAndBillpaymentReviewComponent, selector: "sdk-topup-and-billpayment-review" }] });
|
|
5811
6041
|
}
|
|
5812
6042
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: UtilityPaymentsContainerComponent, decorators: [{
|
|
5813
6043
|
type: Component,
|
|
@@ -5907,7 +6137,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
5907
6137
|
}
|
|
5908
6138
|
}
|
|
5909
6139
|
</div>
|
|
5910
|
-
`, styles: [":host{display:block}:host ::ng-deep .sdk-utility-payments-container{font-size:13px;line-height:1.3}:host ::ng-deep .content{padding:.
|
|
6140
|
+
`, styles: [":host{display:block}:host ::ng-deep .sdk-utility-payments-container{font-size:13px;line-height:1.3}:host ::ng-deep .content{padding:.25rem!important}:host ::ng-deep .page-header{margin-bottom:.6rem!important}:host ::ng-deep .page-header h1{font-size:1.75rem!important;margin-bottom:.25rem!important}:host ::ng-deep sdk-utilities .utilities-title{font-size:1.875rem!important;font-weight:700!important;line-height:1.2!important;letter-spacing:-.02em}:host ::ng-deep .card{border-radius:8px}:host ::ng-deep .card-header{padding:.6rem .9rem!important}:host ::ng-deep .card-title{font-size:1rem!important;margin-bottom:0!important}:host ::ng-deep .card-body{padding:.8rem!important}:host ::ng-deep .form-control,:host ::ng-deep .ng-select .ng-select-container{min-height:34px!important;font-size:13px!important}:host ::ng-deep .form-label,:host ::ng-deep label{font-size:13px!important;margin-bottom:.25rem!important}:host ::ng-deep .btn{font-size:13px!important;padding:.3rem .65rem!important}:host ::ng-deep .work-flow-card{max-width:400px!important;width:100%!important;margin-left:auto!important;margin-right:auto!important}:host ::ng-deep .work-flow-page-header .page-title,:host ::ng-deep .work-flow-page-header h1{font-size:.95rem!important}:host ::ng-deep .work-flow-card .card-header{padding:.4rem .6rem!important}:host ::ng-deep .work-flow-card .card-title{font-size:.85rem!important}:host ::ng-deep .work-flow-card .card-body{padding:.55rem .65rem .7rem!important}:host ::ng-deep .work-flow-card .form-group.form-row{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;margin-bottom:.55rem!important}:host ::ng-deep .work-flow-card .form-group.form-row>label.control-label{flex:0 0 8.5rem!important;max-width:8.5rem!important;width:8.5rem!important;margin-bottom:0!important;padding-top:0!important;text-align:right!important;font-size:.72rem!important}:host ::ng-deep .work-flow-card .form-group.form-row>.col-md-8{flex:1 1 auto!important;max-width:none!important;width:auto!important}:host ::ng-deep .work-flow-card .form-control{min-height:26px!important;height:26px!important;max-width:200px!important;width:60%!important;font-size:.72rem!important;padding:.1rem .35rem!important}:host ::ng-deep .work-flow-card textarea.form-control{height:auto!important;min-height:3rem!important;max-width:100%!important}:host ::ng-deep .work-flow-card .work-flow-footer .btn{font-size:.7rem!important;padding:.15rem .45rem!important}:host ::ng-deep .vendor-products-shell>.card-body{padding:1.25rem 1.35rem 1.5rem!important}:host ::ng-deep .vendor-products-shell .vendor-product-card .form-control{min-height:auto!important;height:auto!important;max-width:none!important}\n"] }]
|
|
5911
6141
|
}], propDecorators: { config: [{
|
|
5912
6142
|
type: Input
|
|
5913
6143
|
}] } });
|
package/index.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ declare class UtilityPaymentsContainerComponent implements OnInit, OnDestroy, On
|
|
|
60
60
|
private resolveTestMode;
|
|
61
61
|
private buildRuntimeConfig;
|
|
62
62
|
private normalizeConfig;
|
|
63
|
+
private normalizeHeaderValue;
|
|
63
64
|
private loadRuntimeConfigFromStorage;
|
|
64
65
|
private persistRuntimeConfigToStorage;
|
|
65
66
|
ngOnDestroy(): void;
|