@bloonio/lokotro-pay 1.0.0 → 1.0.1
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.
- package/fesm2022/bloonio-lokotro-pay.mjs +519 -1193
- package/fesm2022/bloonio-lokotro-pay.mjs.map +1 -1
- package/index.d.ts +6 -269
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as i1 from '@angular/common';
|
|
|
4
4
|
import * as i2 from '@angular/common/http';
|
|
5
5
|
import { HttpClient } from '@angular/common/http';
|
|
6
6
|
import * as i3 from '@angular/forms';
|
|
7
|
-
import { FormGroup, FormBuilder
|
|
7
|
+
import { FormGroup, FormBuilder } from '@angular/forms';
|
|
8
8
|
import { Observable } from 'rxjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -173,93 +173,6 @@ interface LokotroCountry {
|
|
|
173
173
|
countryCodes: LokotroCountryCode[];
|
|
174
174
|
phoneNumberPrefixes: LokotroPhonePrefix[];
|
|
175
175
|
}
|
|
176
|
-
/**
|
|
177
|
-
* Country helper utilities
|
|
178
|
-
*/
|
|
179
|
-
declare class LokotroCountryUtils {
|
|
180
|
-
/**
|
|
181
|
-
* Get the primary country code (first in the list)
|
|
182
|
-
*/
|
|
183
|
-
static getPrimaryCountryCode(country: LokotroCountry): string;
|
|
184
|
-
/**
|
|
185
|
-
* Get the country flag emoji
|
|
186
|
-
*/
|
|
187
|
-
static getFlag(country: LokotroCountry): string;
|
|
188
|
-
/**
|
|
189
|
-
* Get all valid phone prefixes as strings
|
|
190
|
-
*/
|
|
191
|
-
static getValidPrefixes(country: LokotroCountry): string[];
|
|
192
|
-
/**
|
|
193
|
-
* Get min phone chars
|
|
194
|
-
*/
|
|
195
|
-
static getMinPhoneChars(country: LokotroCountry): number;
|
|
196
|
-
/**
|
|
197
|
-
* Get max phone chars
|
|
198
|
-
*/
|
|
199
|
-
static getMaxPhoneChars(country: LokotroCountry): number;
|
|
200
|
-
/**
|
|
201
|
-
* Check if a phone number has a valid prefix for this country
|
|
202
|
-
*/
|
|
203
|
-
static hasValidPrefix(country: LokotroCountry, phoneNumber: string): boolean;
|
|
204
|
-
/**
|
|
205
|
-
* Check if phone number length is valid
|
|
206
|
-
*/
|
|
207
|
-
static isValidPhoneLength(country: LokotroCountry, phoneNumber: string): boolean;
|
|
208
|
-
/**
|
|
209
|
-
* Validate phone number completely
|
|
210
|
-
*/
|
|
211
|
-
static validatePhoneNumber(country: LokotroCountry, phoneNumber: string): {
|
|
212
|
-
isValid: boolean;
|
|
213
|
-
errorType?: 'empty' | 'invalidPrefix' | 'tooShort' | 'tooLong';
|
|
214
|
-
};
|
|
215
|
-
/**
|
|
216
|
-
* Parse country from API response
|
|
217
|
-
*/
|
|
218
|
-
static fromJson(json: Record<string, unknown>): LokotroCountry;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Bank entity (city) model
|
|
223
|
-
*/
|
|
224
|
-
interface LokotroBankEntity {
|
|
225
|
-
id: string;
|
|
226
|
-
name: string;
|
|
227
|
-
countryFlag?: string;
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Bank currency model
|
|
231
|
-
*/
|
|
232
|
-
interface LokotroBankCurrency {
|
|
233
|
-
id: string;
|
|
234
|
-
name: string;
|
|
235
|
-
code: string;
|
|
236
|
-
symbol?: string;
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Bank account model
|
|
240
|
-
*/
|
|
241
|
-
interface LokotroBankAccount {
|
|
242
|
-
id: string;
|
|
243
|
-
identifier: string;
|
|
244
|
-
accountNumber: string;
|
|
245
|
-
accountLabel: string;
|
|
246
|
-
createdAt?: string;
|
|
247
|
-
refBank?: LokotroBank;
|
|
248
|
-
refCurrency?: LokotroBankCurrency;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Bank model
|
|
252
|
-
*/
|
|
253
|
-
interface LokotroBank {
|
|
254
|
-
id: string;
|
|
255
|
-
name: string;
|
|
256
|
-
abreviation: string;
|
|
257
|
-
bankLogoUrl: string;
|
|
258
|
-
hasRibNomenclatureConstraint: boolean;
|
|
259
|
-
ribAccountNumberFormatStr: string;
|
|
260
|
-
bankAccounts: LokotroBankAccount[];
|
|
261
|
-
entityAvailables: LokotroBankEntity[];
|
|
262
|
-
}
|
|
263
176
|
|
|
264
177
|
/**
|
|
265
178
|
* Lokotro Pay - Core Models and Interfaces
|
|
@@ -690,11 +603,6 @@ declare class LokotroPaymentService {
|
|
|
690
603
|
* POST /payments/resend-otp
|
|
691
604
|
*/
|
|
692
605
|
resendOtp(request: LokotroOtpResendRequest): Observable<LokotroHttpResponse<OtpResendResponse>>;
|
|
693
|
-
/**
|
|
694
|
-
* Fetch available banks configuration
|
|
695
|
-
* GET /payments/get-config-bank
|
|
696
|
-
*/
|
|
697
|
-
fetchAvailableBanks(): Observable<LokotroHttpResponse<LokotroBank[]>>;
|
|
698
606
|
/**
|
|
699
607
|
* Select payment method
|
|
700
608
|
*/
|
|
@@ -735,22 +643,6 @@ declare class LokotroPaymentService {
|
|
|
735
643
|
* Parse submit response from API
|
|
736
644
|
*/
|
|
737
645
|
private parseSubmitResponse;
|
|
738
|
-
/**
|
|
739
|
-
* Parse bank from API response
|
|
740
|
-
*/
|
|
741
|
-
private parseBank;
|
|
742
|
-
/**
|
|
743
|
-
* Parse bank account
|
|
744
|
-
*/
|
|
745
|
-
private parseBankAccount;
|
|
746
|
-
/**
|
|
747
|
-
* Parse bank entity
|
|
748
|
-
*/
|
|
749
|
-
private parseBankEntity;
|
|
750
|
-
/**
|
|
751
|
-
* Parse bank currency
|
|
752
|
-
*/
|
|
753
|
-
private parseBankCurrency;
|
|
754
646
|
static ɵfac: i0.ɵɵFactoryDeclaration<LokotroPaymentService, never>;
|
|
755
647
|
static ɵprov: i0.ɵɵInjectableDeclaration<LokotroPaymentService>;
|
|
756
648
|
}
|
|
@@ -768,13 +660,10 @@ interface CreatePaymentResponse {
|
|
|
768
660
|
payment_url?: string;
|
|
769
661
|
show_user_info_form?: boolean;
|
|
770
662
|
show_payment_method_form?: boolean;
|
|
771
|
-
filling_info?: string;
|
|
772
663
|
}
|
|
773
664
|
interface TransactionDetailsResponse {
|
|
774
|
-
identifier?: string;
|
|
775
665
|
transaction_id?: string;
|
|
776
|
-
amount?:
|
|
777
|
-
currency_str?: string;
|
|
666
|
+
amount?: string;
|
|
778
667
|
currency?: string;
|
|
779
668
|
status?: string;
|
|
780
669
|
payment_method?: string;
|
|
@@ -1137,139 +1026,6 @@ declare class LokotroLoadingComponent {
|
|
|
1137
1026
|
static ɵcmp: i0.ɵɵComponentDeclaration<LokotroLoadingComponent, "lokotro-loading", never, { "message": { "alias": "message"; "required": false; }; }, {}, never, never, true, never>;
|
|
1138
1027
|
}
|
|
1139
1028
|
|
|
1140
|
-
/**
|
|
1141
|
-
* Service for fetching and caching country data
|
|
1142
|
-
*/
|
|
1143
|
-
declare class LokotroCountryService {
|
|
1144
|
-
private httpClient;
|
|
1145
|
-
private countriesCache?;
|
|
1146
|
-
private countriesSubject;
|
|
1147
|
-
private loadingRequest?;
|
|
1148
|
-
/** Cache validity duration: 30 minutes */
|
|
1149
|
-
private readonly cacheValidityMs;
|
|
1150
|
-
/** Observable of countries list */
|
|
1151
|
-
countries$: Observable<LokotroCountry[]>;
|
|
1152
|
-
constructor(httpClient: LokotroHttpClientService);
|
|
1153
|
-
/**
|
|
1154
|
-
* Fetch countries from API with caching
|
|
1155
|
-
*/
|
|
1156
|
-
fetchCountries(forceRefresh?: boolean): Observable<LokotroCountry[]>;
|
|
1157
|
-
/**
|
|
1158
|
-
* Check if cache is still valid
|
|
1159
|
-
*/
|
|
1160
|
-
private isCacheValid;
|
|
1161
|
-
/**
|
|
1162
|
-
* Get cached countries synchronously
|
|
1163
|
-
*/
|
|
1164
|
-
getCachedCountries(): LokotroCountry[];
|
|
1165
|
-
/**
|
|
1166
|
-
* Get country by country code (e.g., "243")
|
|
1167
|
-
*/
|
|
1168
|
-
getCountryByCode(countryCode: string): LokotroCountry | undefined;
|
|
1169
|
-
/**
|
|
1170
|
-
* Get country by ID
|
|
1171
|
-
*/
|
|
1172
|
-
getCountryById(id: string): LokotroCountry | undefined;
|
|
1173
|
-
/**
|
|
1174
|
-
* Get default country (DRC or first available)
|
|
1175
|
-
*/
|
|
1176
|
-
getDefaultCountry(): LokotroCountry | undefined;
|
|
1177
|
-
/**
|
|
1178
|
-
* Clear the cache
|
|
1179
|
-
*/
|
|
1180
|
-
clearCache(): void;
|
|
1181
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LokotroCountryService, never>;
|
|
1182
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<LokotroCountryService>;
|
|
1183
|
-
}
|
|
1184
|
-
|
|
1185
|
-
/**
|
|
1186
|
-
* Lokotro Pay - Mobile Money Phone Input Component
|
|
1187
|
-
* Phone input with country code selector and prefix validation
|
|
1188
|
-
*/
|
|
1189
|
-
|
|
1190
|
-
declare class LokotroMobileMoneyPhoneInputComponent implements OnInit, OnDestroy, ControlValueAccessor, Validator {
|
|
1191
|
-
private countryService;
|
|
1192
|
-
localization: LokotroLocalizationService;
|
|
1193
|
-
label?: string;
|
|
1194
|
-
placeholder: string;
|
|
1195
|
-
initialCountryCode: string;
|
|
1196
|
-
showPrefixHints: boolean;
|
|
1197
|
-
disabled: boolean;
|
|
1198
|
-
countryChanged: EventEmitter<LokotroCountry>;
|
|
1199
|
-
phoneChanged: EventEmitter<{
|
|
1200
|
-
phoneNumber: string;
|
|
1201
|
-
fullNumber: string;
|
|
1202
|
-
country: LokotroCountry | null;
|
|
1203
|
-
}>;
|
|
1204
|
-
countries: LokotroCountry[];
|
|
1205
|
-
selectedCountry?: LokotroCountry;
|
|
1206
|
-
phoneNumber: string;
|
|
1207
|
-
isLoading: boolean;
|
|
1208
|
-
showCountryPicker: boolean;
|
|
1209
|
-
prefixError?: string;
|
|
1210
|
-
hasError: boolean;
|
|
1211
|
-
private subscription?;
|
|
1212
|
-
private onChange;
|
|
1213
|
-
onTouched: () => void;
|
|
1214
|
-
constructor(countryService: LokotroCountryService, localization: LokotroLocalizationService);
|
|
1215
|
-
ngOnInit(): void;
|
|
1216
|
-
ngOnDestroy(): void;
|
|
1217
|
-
private loadCountries;
|
|
1218
|
-
getFlag(country: LokotroCountry): string;
|
|
1219
|
-
getPrimaryCode(country: LokotroCountry): string;
|
|
1220
|
-
getValidPrefixes(country: LokotroCountry): string[];
|
|
1221
|
-
getVisiblePrefixes(country: LokotroCountry): string[];
|
|
1222
|
-
getMaxChars(country: LokotroCountry): number;
|
|
1223
|
-
toggleCountryPicker(): void;
|
|
1224
|
-
closeCountryPicker(): void;
|
|
1225
|
-
selectCountry(country: LokotroCountry, emitChange?: boolean): void;
|
|
1226
|
-
onPhoneInput(event: Event): void;
|
|
1227
|
-
private validatePhoneNumber;
|
|
1228
|
-
private emitPhoneChange;
|
|
1229
|
-
getFullPhoneNumber(): string;
|
|
1230
|
-
writeValue(value: string): void;
|
|
1231
|
-
registerOnChange(fn: (value: string) => void): void;
|
|
1232
|
-
registerOnTouched(fn: () => void): void;
|
|
1233
|
-
setDisabledState(isDisabled: boolean): void;
|
|
1234
|
-
validate(control: AbstractControl): ValidationErrors | null;
|
|
1235
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LokotroMobileMoneyPhoneInputComponent, never>;
|
|
1236
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LokotroMobileMoneyPhoneInputComponent, "lokotro-mobile-money-phone-input", never, { "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "initialCountryCode": { "alias": "initialCountryCode"; "required": false; }; "showPrefixHints": { "alias": "showPrefixHints"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "countryChanged": "countryChanged"; "phoneChanged": "phoneChanged"; }, never, never, true, never>;
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
/**
|
|
1240
|
-
* Lokotro Pay - Bank Transfer Form Component
|
|
1241
|
-
*/
|
|
1242
|
-
|
|
1243
|
-
declare class LokotroBankTransferFormComponent implements OnInit {
|
|
1244
|
-
private fb;
|
|
1245
|
-
localization: LokotroLocalizationService;
|
|
1246
|
-
private paymentService;
|
|
1247
|
-
showUserInfoForm: boolean;
|
|
1248
|
-
formSubmitted: EventEmitter<Record<string, unknown>>;
|
|
1249
|
-
cancel: EventEmitter<void>;
|
|
1250
|
-
bankTransferForm: FormGroup;
|
|
1251
|
-
isLoading: boolean;
|
|
1252
|
-
allBanks: LokotroBank[];
|
|
1253
|
-
cities: LokotroBankEntity[];
|
|
1254
|
-
filteredBanks: LokotroBank[];
|
|
1255
|
-
accounts: LokotroBankAccount[];
|
|
1256
|
-
selectedCity: LokotroBankEntity | null;
|
|
1257
|
-
selectedBank: LokotroBank | null;
|
|
1258
|
-
selectedAccount: LokotroBankAccount | null;
|
|
1259
|
-
constructor(fb: FormBuilder, localization: LokotroLocalizationService, paymentService: LokotroPaymentService);
|
|
1260
|
-
ngOnInit(): void;
|
|
1261
|
-
private initForm;
|
|
1262
|
-
private fetchBanks;
|
|
1263
|
-
private extractCities;
|
|
1264
|
-
onCityChange(): void;
|
|
1265
|
-
onBankChange(): void;
|
|
1266
|
-
onAccountChange(): void;
|
|
1267
|
-
onSubmit(): void;
|
|
1268
|
-
onCancel(): void;
|
|
1269
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LokotroBankTransferFormComponent, never>;
|
|
1270
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LokotroBankTransferFormComponent, "lokotro-bank-transfer-form", never, { "showUserInfoForm": { "alias": "showUserInfoForm"; "required": false; }; }, { "formSubmitted": "formSubmitted"; "cancel": "cancel"; }, never, never, true, never>;
|
|
1271
|
-
}
|
|
1272
|
-
|
|
1273
1029
|
/**
|
|
1274
1030
|
* Environment configuration interface
|
|
1275
1031
|
*/
|
|
@@ -1324,7 +1080,7 @@ declare class LokotroPayModule {
|
|
|
1324
1080
|
defaultConfig: Partial<LokotroPayConfig>;
|
|
1325
1081
|
}>): ModuleWithProviders<LokotroPayModule>;
|
|
1326
1082
|
static ɵfac: i0.ɵɵFactoryDeclaration<LokotroPayModule, never>;
|
|
1327
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<LokotroPayModule, never, [typeof i1.CommonModule, typeof i2.HttpClientModule, typeof i3.ReactiveFormsModule, typeof i3.FormsModule, typeof LokotroPayCheckoutComponent, typeof LokotroPaymentMethodSelectionComponent, typeof LokotroPaymentFormComponent, typeof LokotroOtpVerificationComponent, typeof LokotroProcessingComponent, typeof LokotroResultComponent, typeof LokotroLoadingComponent
|
|
1083
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<LokotroPayModule, never, [typeof i1.CommonModule, typeof i2.HttpClientModule, typeof i3.ReactiveFormsModule, typeof i3.FormsModule, typeof LokotroPayCheckoutComponent, typeof LokotroPaymentMethodSelectionComponent, typeof LokotroPaymentFormComponent, typeof LokotroOtpVerificationComponent, typeof LokotroProcessingComponent, typeof LokotroResultComponent, typeof LokotroLoadingComponent], [typeof LokotroPayCheckoutComponent, typeof LokotroPaymentMethodSelectionComponent, typeof LokotroPaymentFormComponent, typeof LokotroOtpVerificationComponent, typeof LokotroProcessingComponent, typeof LokotroResultComponent, typeof LokotroLoadingComponent]>;
|
|
1328
1084
|
static ɵinj: i0.ɵɵInjectorDeclaration<LokotroPayModule>;
|
|
1329
1085
|
}
|
|
1330
1086
|
|
|
@@ -1526,14 +1282,11 @@ interface LokotroPaymentStatusResponse {
|
|
|
1526
1282
|
completedAt?: string;
|
|
1527
1283
|
createdAt?: string;
|
|
1528
1284
|
metadata?: Record<string, unknown>;
|
|
1529
|
-
successRedirectUrl?: string;
|
|
1530
|
-
failRedirectUrl?: string;
|
|
1531
|
-
notifyUrl?: string;
|
|
1532
1285
|
}
|
|
1533
1286
|
/**
|
|
1534
1287
|
* Internal screen states
|
|
1535
1288
|
*/
|
|
1536
|
-
type PaymentStatusScreen = 'loading' | 'pending' | 'processing' | '
|
|
1289
|
+
type PaymentStatusScreen = 'loading' | 'pending' | 'processing' | 'success' | 'error' | 'cancelled' | 'expired';
|
|
1537
1290
|
declare class LokotroPaymentStatusComponent implements OnInit, OnDestroy {
|
|
1538
1291
|
private paymentService;
|
|
1539
1292
|
localization: LokotroLocalizationService;
|
|
@@ -1573,10 +1326,6 @@ declare class LokotroPaymentStatusComponent implements OnInit, OnDestroy {
|
|
|
1573
1326
|
currentScreen: PaymentStatusScreen;
|
|
1574
1327
|
paymentDetails: LokotroPaymentStatusResponse | null;
|
|
1575
1328
|
errorMessage: string;
|
|
1576
|
-
/** OTP verification state */
|
|
1577
|
-
otpDestination: string;
|
|
1578
|
-
rawStatus: string;
|
|
1579
|
-
isVerifyingOtp: boolean;
|
|
1580
1329
|
private destroy$;
|
|
1581
1330
|
private pollingSubscription?;
|
|
1582
1331
|
private pollingAttempts;
|
|
@@ -1620,21 +1369,9 @@ declare class LokotroPaymentStatusComponent implements OnInit, OnDestroy {
|
|
|
1620
1369
|
* Handle done button click
|
|
1621
1370
|
*/
|
|
1622
1371
|
onDone(): void;
|
|
1623
|
-
/**
|
|
1624
|
-
* Handle OTP verification
|
|
1625
|
-
*/
|
|
1626
|
-
onOtpVerified(otp: string): void;
|
|
1627
|
-
/**
|
|
1628
|
-
* Handle OTP resend
|
|
1629
|
-
*/
|
|
1630
|
-
onResendOtp(): void;
|
|
1631
|
-
/**
|
|
1632
|
-
* Handle OTP cancellation
|
|
1633
|
-
*/
|
|
1634
|
-
onOtpCancel(): void;
|
|
1635
1372
|
static ɵfac: i0.ɵɵFactoryDeclaration<LokotroPaymentStatusComponent, never>;
|
|
1636
1373
|
static ɵcmp: i0.ɵɵComponentDeclaration<LokotroPaymentStatusComponent, "lokotro-payment-status", never, { "statusConfig": { "alias": "statusConfig"; "required": false; }; "showHeader": { "alias": "showHeader"; "required": false; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; }; }, { "statusChange": "statusChange"; "paymentComplete": "paymentComplete"; "paymentFailed": "paymentFailed"; "onClose": "onClose"; "onDoneEvent": "onDoneEvent"; }, never, never, true, never>;
|
|
1637
1374
|
}
|
|
1638
1375
|
|
|
1639
|
-
export { LOKOTRO_ENV_CONFIG, LOKOTRO_PAY_CONFIG,
|
|
1640
|
-
export type { LokotroCheckoutConfig,
|
|
1376
|
+
export { LOKOTRO_ENV_CONFIG, LOKOTRO_PAY_CONFIG, LokotroHttpClientService, LokotroLoadingComponent, LokotroLocalizationService, LokotroOtpVerificationComponent, LokotroPayApiResponseCode, LokotroPayApiResponseCodeInfo, LokotroPayChannel, LokotroPayChannelInfo, LokotroPayCheckoutComponent, LokotroPayColors, LokotroPayEnv, LokotroPayFillingInfo, LokotroPayLanguage, LokotroPayLanguageInfo, LokotroPayModule, LokotroPayResultScreen, LokotroPayScreenNavigation, LokotroPayScreenNavigationInfo, LokotroPaymentFormComponent, LokotroPaymentMethodSelectionComponent, LokotroPaymentService, LokotroPaymentStatus, LokotroPaymentStatusComponent, LokotroProcessingComponent, LokotroResultComponent };
|
|
1377
|
+
export type { LokotroCheckoutConfig, LokotroHttpResponse, LokotroMerchantInfo, LokotroOtpVerifyRequest, LokotroOtpVerifyResponse, LokotroPayConfig, LokotroPayError, LokotroPayOnError, LokotroPayOnResponse, LokotroPayResponse, LokotroPayThemeConfig, LokotroPaymentBody, LokotroPaymentFormData, LokotroPaymentInfo, LokotroPaymentMethod, LokotroPaymentMethodListItem, LokotroPaymentStatusConfig, LokotroPaymentStatusResponse, LokotroPaymentSubmitRequest, LokotroPaymentSubmitResponse, LokotroTransactionDetails };
|