@leatcom/portal-sessions 0.0.50 → 0.0.52
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 +15 -14
- package/dist/portal-sessions.es.d.ts +12 -0
- package/dist/portal-sessions.es.js +3456 -3436
- package/dist/portal-sessions.umd.js +31 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,20 +44,21 @@ Initiate a new Portal Session as follows:
|
|
|
44
44
|
|
|
45
45
|
## Portal Session Props
|
|
46
46
|
|
|
47
|
-
| Prop
|
|
48
|
-
|
|
49
|
-
| `apiKey`
|
|
50
|
-
| `shopUuid`
|
|
51
|
-
| `contactUuid`
|
|
52
|
-
| `type`
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
47
|
+
| Prop | Type | Required | Description |
|
|
48
|
+
|-------------------------------|--------------------------------------------------------------|----------|------------------------------------------------------------------------------------------------------------|
|
|
49
|
+
| `apiKey` | `string` | Yes | API key used to authenticate. |
|
|
50
|
+
| `shopUuid` | `string` | Yes | The shop's uuid. |
|
|
51
|
+
| `contactUuid` | `string` | No | Optional contact uuid. This opens the portal session for this contact specifically. |
|
|
52
|
+
| `type` | `PortalType` | No | Optional portal type, defaults to `"PORTAL"`. |
|
|
53
|
+
| `primaryIdentificationMethod` | `string` | No | Start the identification flow with either `"email"` or `"identifier"`, defaults to `"identifier"`. |
|
|
54
|
+
| `enableEmailIdentification` | `boolean` | No | Optional alternative route to identify a contact. |
|
|
55
|
+
| `enableOnScreenKeyboard` | `boolean` | No | Optional on-screen keyboard. |
|
|
56
|
+
| `allowMultipleGiftcards` | `boolean` | No | Allow using multiple giftcards in one session. Applies to sessions with `PortalType` `"REDEEM_GIFTCARD"`. |
|
|
57
|
+
| `amountInCents` | `number` | No | A purchase amount in cents. Applies to sessions with `PortalType` `"REDEEM_GIFTCARD"` and `"PAY_PREPAID"`. |
|
|
58
|
+
| `onContactLink` | `(contact: ContactResource) => void` | No | Optional callback. Called when a contact is linked to the portal session. |
|
|
59
|
+
| `onClaimReward` | `(reward: RewardResource, transactionUuid?: string) => void` | No | Optional callback. Called when a reward is claimed. |
|
|
60
|
+
| `onRedeemVoucher` | `(voucher: VoucherResource) => void` | No | Optional callback. Called when a voucher is redeemed. |
|
|
61
|
+
| `onUseGiftcard` | `(giftcardTransaction: GiftcardTransactionResource) => void` | No | Optional callback. Called when a giftcard payment is made. |
|
|
61
62
|
|
|
62
63
|
## Types
|
|
63
64
|
|
|
@@ -107,6 +107,11 @@ export declare type DefaultSessionProps = {
|
|
|
107
107
|
host?: string;
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
+
export declare enum ErrorCodes {
|
|
111
|
+
INPUT_INVALID = 1003,
|
|
112
|
+
CONTACT_NOT_FOUND = 55031
|
|
113
|
+
}
|
|
114
|
+
|
|
110
115
|
declare type Event_2 = {
|
|
111
116
|
data: {
|
|
112
117
|
[p: string]: any;
|
|
@@ -196,6 +201,7 @@ export declare type InputData = {
|
|
|
196
201
|
enable_registration?: boolean;
|
|
197
202
|
amount_in_cents?: number;
|
|
198
203
|
allow_multiple_giftcards?: boolean;
|
|
204
|
+
primary_identification_method?: PrimaryIdentificationMethod;
|
|
199
205
|
};
|
|
200
206
|
|
|
201
207
|
export declare type LoyaltyProgram = {
|
|
@@ -267,6 +273,7 @@ export declare type PortalSessionProps = {
|
|
|
267
273
|
onRedeemVoucher?: (voucher: VoucherResource) => void;
|
|
268
274
|
onUseGiftcard?: (giftcardTransaction: GiftcardTransactionResource) => void;
|
|
269
275
|
onCreateTransaction?: (creditReceptionId: number) => void;
|
|
276
|
+
primaryIdentificationMethod?: PrimaryIdentificationMethod;
|
|
270
277
|
};
|
|
271
278
|
|
|
272
279
|
export declare enum PortalType {
|
|
@@ -288,6 +295,11 @@ export declare type PrepaidBalanceResource = {
|
|
|
288
295
|
balance: string;
|
|
289
296
|
};
|
|
290
297
|
|
|
298
|
+
export declare enum PrimaryIdentificationMethod {
|
|
299
|
+
IDENTIFIER = "identifier",
|
|
300
|
+
EMAIL = "email"
|
|
301
|
+
}
|
|
302
|
+
|
|
291
303
|
export declare type Promotion = {
|
|
292
304
|
uuid: string;
|
|
293
305
|
name: string;
|