@leatcom/portal-sessions 0.0.44 → 0.0.46

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 CHANGED
@@ -27,8 +27,9 @@ Currently, there are five Portal Session types:
27
27
  * `PORTAL`: This is the 'default' session type, which doesn't have a predefined aim, but rather allows for flexible use. See this as a way for customers to login to their own portal.
28
28
  * `REDEEM_GIFTCARD`: A session to use and redeem gift card(s). Best used as payment option.
29
29
  * `TOP_UP_GIFTCARD`: A session to sell and/or top up existing gift cards.
30
- * `PREPAID`: A session to handle prepaid transactions.
31
- * `SAVE`: A session to handle an order and a subsequent credit reception.
30
+ * `PAY_PREPAID`: A session to handle prepaid transactions.
31
+ * `TOP_UP_PREPAID`: A session to top up prepaid balance.
32
+ * `POINTS_TRANSACTION`: A session to handle an order and a subsequent credit reception.
32
33
  * `VOUCHER`: A session to redeem vouchers.
33
34
 
34
35
  Initiate a new Portal Session as follows:
@@ -37,7 +38,38 @@ Initiate a new Portal Session as follows:
37
38
  apiKey={apiKey}
38
39
  shopUuid={shopUuid}
39
40
  type="PORTAL"
40
- scannerType="camera"
41
41
  onRedeemVoucher={(voucher) => handleVoucherLogic(voucher)}
42
42
  />
43
43
  ```
44
+
45
+ ## Portal Session Props
46
+
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
+ | `enableEmailIdentification` | `boolean` | No | Optional alternative route to identify a contact. |
54
+ | `enableOnScreenKeyboard` | `boolean` | No | Optional on-screen keyboard. |
55
+ | `allowMultipleGiftcards` | `boolean` | No | Allow using multiple giftcards in one session. Applies to sessions with `PortalType` `"REDEEM_GIFTCARD"`. |
56
+ | `amountInCents` | `number` | No | A purchase amount in cents. Applies to sessions with `PortalType` `"REDEEM_GIFTCARD"` and `"PAY_PREPAID"`. |
57
+ | `onContactLink` | `(contact: ContactResource) => void` | No | Optional callback. Called when a contact is linked to the portal session. |
58
+ | `onClaimReward` | `(reward: RewardResource, transactionUuid?: string) => void` | No | Optional callback. Called when a reward is claimed. |
59
+ | `onRedeemVoucher` | `(voucher: VoucherResource) => void` | No | Optional callback. Called when a voucher is redeemed. |
60
+ | `onUseGiftcard` | `(giftcardTransaction: GiftcardTransactionResource) => void` | No | Optional callback. Called when a giftcard payment is made. |
61
+
62
+ ## Types
63
+
64
+ `PortalType`
65
+ ```javascript
66
+ export enum PortalType {
67
+ REDEEM_GIFTCARD = "REDEEM_GIFTCARD",
68
+ TOP_UP_GIFTCARD = "TOP_UP_GIFTCARD",
69
+ PORTAL = "PORTAL",
70
+ PAY_PREPAID = "PAY_PREPAID",
71
+ TOP_UP_PREPAID = "TOP_UP_PREPAID",
72
+ POINTS_TRANSACTION = "POINTS_TRANSACTION",
73
+ VOUCHER = "VOUCHER",
74
+ }
75
+ ```