straumur-web-component 0.1.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/README.md +1 -0
- package/dist/index.d.mts +102 -0
- package/dist/index.d.ts +102 -0
- package/dist/index.js +2018 -0
- package/dist/index.mjs +2000 -0
- package/package.json +47 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# straumur-web-component
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
declare const translations: {
|
|
2
|
+
"en-US": {
|
|
3
|
+
"cards.title": string;
|
|
4
|
+
"cards.cardNumber": string;
|
|
5
|
+
"cards.expiryDate": string;
|
|
6
|
+
"cards.securityCode3Digits": string;
|
|
7
|
+
"cards.securityCode3DigitsOptional": string;
|
|
8
|
+
"cards.securityCode3DigitsInfo": string;
|
|
9
|
+
"cards.securityCode4DigitsInfo": string;
|
|
10
|
+
"cards.storePaymentMethod": string;
|
|
11
|
+
"googlepay.title": string;
|
|
12
|
+
"stored-cards.expiryDate": string;
|
|
13
|
+
"stored-cards.securityCode3Digits": string;
|
|
14
|
+
"stored-cards.securityCode3DigitsOptional": string;
|
|
15
|
+
"stored-cards.securityCode3DigitsInfo": string;
|
|
16
|
+
"stored-cards.securityCode4DigitsInfo": string;
|
|
17
|
+
"stored-cards.removeStoredCard": string;
|
|
18
|
+
"stored-cards.removeStoredCardQuestion": string;
|
|
19
|
+
"stored-cards.removeStoredCardQuestionYesRemove": string;
|
|
20
|
+
"stored-cards.removeStoredCardQuestionCancel": string;
|
|
21
|
+
"success.paymentAuthorized": string;
|
|
22
|
+
"error.unknownError": string;
|
|
23
|
+
"error.failedToInitializeStraumurWebComponent": string;
|
|
24
|
+
"error.failedToInitializePaymentMethods": string;
|
|
25
|
+
"error.failedToSubmitPayment": string;
|
|
26
|
+
"error.paymentFailed": string;
|
|
27
|
+
"error.paymentUnsuccessful": string;
|
|
28
|
+
"error.failedToSubmitPaymentDetails": string;
|
|
29
|
+
"error.paymentDetailsFailed": string;
|
|
30
|
+
"error.googlePayNotAvailable": string;
|
|
31
|
+
"error.failedToSubmitRemoveStoredPaymentCard": string;
|
|
32
|
+
"error.failedToRemoveStoredPaymentCard": string;
|
|
33
|
+
};
|
|
34
|
+
"is-IS": {
|
|
35
|
+
"cards.title": string;
|
|
36
|
+
"cards.cardNumber": string;
|
|
37
|
+
"cards.expiryDate": string;
|
|
38
|
+
"cards.securityCode3Digits": string;
|
|
39
|
+
"cards.securityCode3DigitsOptional": string;
|
|
40
|
+
"cards.securityCode3DigitsInfo": string;
|
|
41
|
+
"cards.securityCode4DigitsInfo": string;
|
|
42
|
+
"cards.storePaymentMethod": string;
|
|
43
|
+
"googlepay.title": string;
|
|
44
|
+
"stored-cards.expiryDate": string;
|
|
45
|
+
"stored-cards.securityCode3Digits": string;
|
|
46
|
+
"stored-cards.securityCode3DigitsOptional": string;
|
|
47
|
+
"stored-cards.securityCode3DigitsInfo": string;
|
|
48
|
+
"stored-cards.securityCode4DigitsInfo": string;
|
|
49
|
+
"stored-cards.removeStoredCard": string;
|
|
50
|
+
"stored-cards.removeStoredCardQuestion": string;
|
|
51
|
+
"stored-cards.removeStoredCardQuestionYesRemove": string;
|
|
52
|
+
"stored-cards.removeStoredCardQuestionCancel": string;
|
|
53
|
+
"success.paymentAuthorized": string;
|
|
54
|
+
"error.unknownError": string;
|
|
55
|
+
"error.failedToInitializeStraumurWebComponent": string;
|
|
56
|
+
"error.failedToInitializePaymentMethods": string;
|
|
57
|
+
"error.failedToSubmitPayment": string;
|
|
58
|
+
"error.paymentFailed": string;
|
|
59
|
+
"error.paymentUnsuccessful": string;
|
|
60
|
+
"error.failedToSubmitPaymentDetails": string;
|
|
61
|
+
"error.paymentDetailsFailed": string;
|
|
62
|
+
"error.googlePayNotAvailable": string;
|
|
63
|
+
"error.failedToSubmitRemoveStoredPaymentCard": string;
|
|
64
|
+
"error.failedToRemoveStoredPaymentCard": string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
type Language = keyof typeof translations;
|
|
68
|
+
type TranslationKey = keyof (typeof translations)["en-US"] | keyof (typeof translations)["is-IS"];
|
|
69
|
+
|
|
70
|
+
type StraumurWebConfiguration = {
|
|
71
|
+
sessionId: string;
|
|
72
|
+
environment: "test" | "live";
|
|
73
|
+
onPaymentCompleted?: () => void;
|
|
74
|
+
onPaymentFailed?: () => void;
|
|
75
|
+
placeholders?: Placeholders;
|
|
76
|
+
locale?: Language;
|
|
77
|
+
};
|
|
78
|
+
type StraumurCheckoutConfiguration = {
|
|
79
|
+
sessionId: string;
|
|
80
|
+
environment: "test" | "live";
|
|
81
|
+
onPaymentCompleted?: () => void;
|
|
82
|
+
onPaymentFailed?: () => void;
|
|
83
|
+
placeholders?: Placeholders;
|
|
84
|
+
locale: Language;
|
|
85
|
+
};
|
|
86
|
+
type PlaceholderKeys = "cardNumber" | "expiryDate" | "expiryMonth" | "expiryYear" | "securityCodeThreeDigits" | "securityCodeFourDigits";
|
|
87
|
+
type Placeholders = Partial<Record<PlaceholderKeys, string>>;
|
|
88
|
+
|
|
89
|
+
declare class StraumurCheckout {
|
|
90
|
+
private configuration;
|
|
91
|
+
private paymentMethods;
|
|
92
|
+
private mountElement;
|
|
93
|
+
constructor(config: StraumurWebConfiguration);
|
|
94
|
+
mount(selector: HTMLElement | string): Promise<void>;
|
|
95
|
+
private renderComponent;
|
|
96
|
+
updateConfig(newConfig: Partial<StraumurCheckoutConfiguration>): void;
|
|
97
|
+
setLanguage(locale: Language): void;
|
|
98
|
+
destroy(): void;
|
|
99
|
+
handleError(message: TranslationKey): void;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export { StraumurCheckout };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
declare const translations: {
|
|
2
|
+
"en-US": {
|
|
3
|
+
"cards.title": string;
|
|
4
|
+
"cards.cardNumber": string;
|
|
5
|
+
"cards.expiryDate": string;
|
|
6
|
+
"cards.securityCode3Digits": string;
|
|
7
|
+
"cards.securityCode3DigitsOptional": string;
|
|
8
|
+
"cards.securityCode3DigitsInfo": string;
|
|
9
|
+
"cards.securityCode4DigitsInfo": string;
|
|
10
|
+
"cards.storePaymentMethod": string;
|
|
11
|
+
"googlepay.title": string;
|
|
12
|
+
"stored-cards.expiryDate": string;
|
|
13
|
+
"stored-cards.securityCode3Digits": string;
|
|
14
|
+
"stored-cards.securityCode3DigitsOptional": string;
|
|
15
|
+
"stored-cards.securityCode3DigitsInfo": string;
|
|
16
|
+
"stored-cards.securityCode4DigitsInfo": string;
|
|
17
|
+
"stored-cards.removeStoredCard": string;
|
|
18
|
+
"stored-cards.removeStoredCardQuestion": string;
|
|
19
|
+
"stored-cards.removeStoredCardQuestionYesRemove": string;
|
|
20
|
+
"stored-cards.removeStoredCardQuestionCancel": string;
|
|
21
|
+
"success.paymentAuthorized": string;
|
|
22
|
+
"error.unknownError": string;
|
|
23
|
+
"error.failedToInitializeStraumurWebComponent": string;
|
|
24
|
+
"error.failedToInitializePaymentMethods": string;
|
|
25
|
+
"error.failedToSubmitPayment": string;
|
|
26
|
+
"error.paymentFailed": string;
|
|
27
|
+
"error.paymentUnsuccessful": string;
|
|
28
|
+
"error.failedToSubmitPaymentDetails": string;
|
|
29
|
+
"error.paymentDetailsFailed": string;
|
|
30
|
+
"error.googlePayNotAvailable": string;
|
|
31
|
+
"error.failedToSubmitRemoveStoredPaymentCard": string;
|
|
32
|
+
"error.failedToRemoveStoredPaymentCard": string;
|
|
33
|
+
};
|
|
34
|
+
"is-IS": {
|
|
35
|
+
"cards.title": string;
|
|
36
|
+
"cards.cardNumber": string;
|
|
37
|
+
"cards.expiryDate": string;
|
|
38
|
+
"cards.securityCode3Digits": string;
|
|
39
|
+
"cards.securityCode3DigitsOptional": string;
|
|
40
|
+
"cards.securityCode3DigitsInfo": string;
|
|
41
|
+
"cards.securityCode4DigitsInfo": string;
|
|
42
|
+
"cards.storePaymentMethod": string;
|
|
43
|
+
"googlepay.title": string;
|
|
44
|
+
"stored-cards.expiryDate": string;
|
|
45
|
+
"stored-cards.securityCode3Digits": string;
|
|
46
|
+
"stored-cards.securityCode3DigitsOptional": string;
|
|
47
|
+
"stored-cards.securityCode3DigitsInfo": string;
|
|
48
|
+
"stored-cards.securityCode4DigitsInfo": string;
|
|
49
|
+
"stored-cards.removeStoredCard": string;
|
|
50
|
+
"stored-cards.removeStoredCardQuestion": string;
|
|
51
|
+
"stored-cards.removeStoredCardQuestionYesRemove": string;
|
|
52
|
+
"stored-cards.removeStoredCardQuestionCancel": string;
|
|
53
|
+
"success.paymentAuthorized": string;
|
|
54
|
+
"error.unknownError": string;
|
|
55
|
+
"error.failedToInitializeStraumurWebComponent": string;
|
|
56
|
+
"error.failedToInitializePaymentMethods": string;
|
|
57
|
+
"error.failedToSubmitPayment": string;
|
|
58
|
+
"error.paymentFailed": string;
|
|
59
|
+
"error.paymentUnsuccessful": string;
|
|
60
|
+
"error.failedToSubmitPaymentDetails": string;
|
|
61
|
+
"error.paymentDetailsFailed": string;
|
|
62
|
+
"error.googlePayNotAvailable": string;
|
|
63
|
+
"error.failedToSubmitRemoveStoredPaymentCard": string;
|
|
64
|
+
"error.failedToRemoveStoredPaymentCard": string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
type Language = keyof typeof translations;
|
|
68
|
+
type TranslationKey = keyof (typeof translations)["en-US"] | keyof (typeof translations)["is-IS"];
|
|
69
|
+
|
|
70
|
+
type StraumurWebConfiguration = {
|
|
71
|
+
sessionId: string;
|
|
72
|
+
environment: "test" | "live";
|
|
73
|
+
onPaymentCompleted?: () => void;
|
|
74
|
+
onPaymentFailed?: () => void;
|
|
75
|
+
placeholders?: Placeholders;
|
|
76
|
+
locale?: Language;
|
|
77
|
+
};
|
|
78
|
+
type StraumurCheckoutConfiguration = {
|
|
79
|
+
sessionId: string;
|
|
80
|
+
environment: "test" | "live";
|
|
81
|
+
onPaymentCompleted?: () => void;
|
|
82
|
+
onPaymentFailed?: () => void;
|
|
83
|
+
placeholders?: Placeholders;
|
|
84
|
+
locale: Language;
|
|
85
|
+
};
|
|
86
|
+
type PlaceholderKeys = "cardNumber" | "expiryDate" | "expiryMonth" | "expiryYear" | "securityCodeThreeDigits" | "securityCodeFourDigits";
|
|
87
|
+
type Placeholders = Partial<Record<PlaceholderKeys, string>>;
|
|
88
|
+
|
|
89
|
+
declare class StraumurCheckout {
|
|
90
|
+
private configuration;
|
|
91
|
+
private paymentMethods;
|
|
92
|
+
private mountElement;
|
|
93
|
+
constructor(config: StraumurWebConfiguration);
|
|
94
|
+
mount(selector: HTMLElement | string): Promise<void>;
|
|
95
|
+
private renderComponent;
|
|
96
|
+
updateConfig(newConfig: Partial<StraumurCheckoutConfiguration>): void;
|
|
97
|
+
setLanguage(locale: Language): void;
|
|
98
|
+
destroy(): void;
|
|
99
|
+
handleError(message: TranslationKey): void;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export { StraumurCheckout };
|