@bloonio/lokotro-pay 1.1.1 → 1.2.0
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloonio/lokotro-pay",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Angular SDK for Lokotro Pay -
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Angular SDK for Lokotro Pay - Clean white-surface payment checkout with themeable brand colors and support for cards, mobile money, e-wallets, and more.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
7
7
|
"payment",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"url": "https://github.com/bloonio/lokotro-pay-angular.git"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@angular/common": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
|
22
|
-
"@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
|
23
|
-
"@angular/forms": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
|
21
|
+
"@angular/common": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0",
|
|
22
|
+
"@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0",
|
|
23
|
+
"@angular/forms": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0",
|
|
24
24
|
"rxjs": "^7.8.0"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
@@ -28,14 +28,15 @@
|
|
|
28
28
|
},
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"module": "fesm2022/bloonio-lokotro-pay.mjs",
|
|
31
|
-
"typings": "
|
|
31
|
+
"typings": "types/bloonio-lokotro-pay.d.ts",
|
|
32
32
|
"exports": {
|
|
33
33
|
"./package.json": {
|
|
34
34
|
"default": "./package.json"
|
|
35
35
|
},
|
|
36
36
|
".": {
|
|
37
|
-
"types": "./
|
|
37
|
+
"types": "./types/bloonio-lokotro-pay.d.ts",
|
|
38
38
|
"default": "./fesm2022/bloonio-lokotro-pay.mjs"
|
|
39
39
|
}
|
|
40
|
-
}
|
|
40
|
+
},
|
|
41
|
+
"type": "module"
|
|
41
42
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { OnInit, OnDestroy, EventEmitter, InjectionToken, ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import { OnInit, OnChanges, OnDestroy, EventEmitter, ElementRef, SimpleChanges, InjectionToken, ModuleWithProviders } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormGroup, FormBuilder } from '@angular/forms';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
@@ -447,14 +447,34 @@ interface LokotroOtpResendRequest {
|
|
|
447
447
|
paymentId?: string;
|
|
448
448
|
}
|
|
449
449
|
/**
|
|
450
|
-
* Theme configuration
|
|
450
|
+
* Theme configuration for the checkout widget.
|
|
451
|
+
*
|
|
452
|
+
* All fields are optional — anything left undefined falls back to the
|
|
453
|
+
* package's clean white default (or inherits from the host app's CSS).
|
|
454
|
+
*
|
|
455
|
+
* Pass to `<lokotro-pay-checkout [themeConfig]="...">` to brand the widget:
|
|
456
|
+
* ```ts
|
|
457
|
+
* themeConfig: LokotroPayThemeConfig = {
|
|
458
|
+
* primaryColor: '#2563EB',
|
|
459
|
+
* secondaryColor: '#1E40AF',
|
|
460
|
+
* tertiaryColor: '#3BFBDA',
|
|
461
|
+
* };
|
|
462
|
+
* ```
|
|
451
463
|
*/
|
|
452
464
|
interface LokotroPayThemeConfig {
|
|
465
|
+
/** Brand primary — primary buttons, focused inputs, key accents. */
|
|
453
466
|
primaryColor?: string;
|
|
467
|
+
/** Brand secondary — gradient companion to primary, secondary actions. */
|
|
454
468
|
secondaryColor?: string;
|
|
469
|
+
/** Brand tertiary — highlights, OTP focus rings, gradient end stop. */
|
|
470
|
+
tertiaryColor?: string;
|
|
471
|
+
/** @deprecated use `tertiaryColor`. Kept for backward compatibility. */
|
|
455
472
|
accentColor?: string;
|
|
456
473
|
backgroundColor?: string;
|
|
474
|
+
surfaceColor?: string;
|
|
457
475
|
textColor?: string;
|
|
476
|
+
secondaryTextColor?: string;
|
|
477
|
+
borderColor?: string;
|
|
458
478
|
errorColor?: string;
|
|
459
479
|
successColor?: string;
|
|
460
480
|
warningColor?: string;
|
|
@@ -927,9 +947,10 @@ declare class LokotroLocalizationService {
|
|
|
927
947
|
* Main checkout widget with clean, theme-based design
|
|
928
948
|
*/
|
|
929
949
|
|
|
930
|
-
declare class LokotroPayCheckoutComponent implements OnInit, OnDestroy {
|
|
950
|
+
declare class LokotroPayCheckoutComponent implements OnInit, OnChanges, OnDestroy {
|
|
931
951
|
private paymentService;
|
|
932
952
|
localization: LokotroLocalizationService;
|
|
953
|
+
private elementRef;
|
|
933
954
|
title?: string;
|
|
934
955
|
titleStyle?: Record<string, string>;
|
|
935
956
|
titleBackgroundColor?: string;
|
|
@@ -944,15 +965,24 @@ declare class LokotroPayCheckoutComponent implements OnInit, OnDestroy {
|
|
|
944
965
|
error: EventEmitter<LokotroPayOnError>;
|
|
945
966
|
closed: EventEmitter<void>;
|
|
946
967
|
state?: LokotroPaymentState;
|
|
968
|
+
/** Default to light theme — payment widgets should look like clean white cards. */
|
|
947
969
|
isDarkTheme: boolean;
|
|
948
970
|
private static readonly MAX_RETRY_ATTEMPTS;
|
|
949
971
|
private retryAttempts;
|
|
950
972
|
private stateSubscription?;
|
|
951
|
-
constructor(paymentService: LokotroPaymentService, localization: LokotroLocalizationService);
|
|
973
|
+
constructor(paymentService: LokotroPaymentService, localization: LokotroLocalizationService, elementRef: ElementRef<HTMLElement>);
|
|
952
974
|
/** Check if user has retries left */
|
|
953
975
|
get hasRetriesLeft(): boolean;
|
|
954
976
|
ngOnInit(): void;
|
|
977
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
955
978
|
ngOnDestroy(): void;
|
|
979
|
+
/**
|
|
980
|
+
* Apply the merchant-provided theme as CSS custom properties on the
|
|
981
|
+
* checkout host element. Only sets variables for fields the merchant
|
|
982
|
+
* provided — undefined fields fall back to the package defaults defined
|
|
983
|
+
* in lokotro-pay.scss.
|
|
984
|
+
*/
|
|
985
|
+
private applyThemeConfig;
|
|
956
986
|
private initializeEnvironment;
|
|
957
987
|
private initializeLocalization;
|
|
958
988
|
private subscribeToState;
|
|
@@ -1088,6 +1118,9 @@ declare class LokotroProcessingComponent {
|
|
|
1088
1118
|
/**
|
|
1089
1119
|
* Lokotro Pay - Result Component
|
|
1090
1120
|
* Success, Error, Warning, Info screens
|
|
1121
|
+
*
|
|
1122
|
+
* Designed for financial UX: clean white surface, prominent amount focal
|
|
1123
|
+
* on success, filled status badge, restrained transaction-detail panel.
|
|
1091
1124
|
*/
|
|
1092
1125
|
|
|
1093
1126
|
type ResultType = 'success' | 'error' | 'warning' | 'info';
|
|
@@ -1118,6 +1151,7 @@ declare class LokotroResultComponent implements OnInit, OnDestroy {
|
|
|
1118
1151
|
private clearCountdown;
|
|
1119
1152
|
private triggerAutoRedirect;
|
|
1120
1153
|
getCountdownProgress(): number;
|
|
1154
|
+
formatNumber(amount: number): string;
|
|
1121
1155
|
formatAmount(amount: number, currency?: string): string;
|
|
1122
1156
|
onPrimaryClick(): void;
|
|
1123
1157
|
onSecondaryClick(): void;
|
|
@@ -1191,10 +1225,11 @@ declare class LokotroPayModule {
|
|
|
1191
1225
|
|
|
1192
1226
|
/**
|
|
1193
1227
|
* Lokotro Pay - Color Constants
|
|
1194
|
-
*
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
*
|
|
1228
|
+
*
|
|
1229
|
+
* Neutral white-background palette intended for payment surfaces.
|
|
1230
|
+
* Brand colors (primary/secondary/tertiary) default to slate so the
|
|
1231
|
+
* widget renders correctly with no themeConfig provided. Merchants
|
|
1232
|
+
* override at runtime via `<lokotro-pay-checkout [themeConfig]>`.
|
|
1198
1233
|
*/
|
|
1199
1234
|
declare const LokotroPayColors: {
|
|
1200
1235
|
primary: string;
|
|
@@ -1205,6 +1240,9 @@ declare const LokotroPayColors: {
|
|
|
1205
1240
|
secondaryDark: string;
|
|
1206
1241
|
secondaryLight: string;
|
|
1207
1242
|
secondaryVariant: string;
|
|
1243
|
+
tertiary: string;
|
|
1244
|
+
tertiaryDark: string;
|
|
1245
|
+
tertiaryLight: string;
|
|
1208
1246
|
accent: string;
|
|
1209
1247
|
accentDark: string;
|
|
1210
1248
|
accentLight: string;
|