@medipass/checkout-sdk 3.0.0 → 3.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.
@@ -1,5 +1,6 @@
1
1
  import { ENVS } from './constants';
2
2
  interface UpdatePaymentDetailsBase {
3
+ appId?: string;
3
4
  patientRefId: string;
4
5
  env: typeof ENVS[keyof typeof ENVS];
5
6
  onSuccess: () => void;
@@ -17,5 +18,5 @@ interface UpdatePaymentDetailsWithToken extends UpdatePaymentDetailsBase {
17
18
  apiKey?: never;
18
19
  }
19
20
  export type UpdatePaymentDetails = UpdatePaymentDetailsWithApiKey | UpdatePaymentDetailsWithToken;
20
- declare const updatePaymentDetails: ({ apiKey, token, patientRefId, env, onSuccess, onFailure, onCancel, onClose, callbackOrigin, }: UpdatePaymentDetails) => Promise<void>;
21
+ declare const updatePaymentDetails: ({ appId, apiKey, token, patientRefId, env, onSuccess, onFailure, onCancel, onClose, callbackOrigin, }: UpdatePaymentDetails) => Promise<void>;
21
22
  export default updatePaymentDetails;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medipass/checkout-sdk",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Medipass Checkout SDK",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -8,6 +8,7 @@ if (!coreSDK.hasInit) {
8
8
  }
9
9
 
10
10
  interface UpdatePaymentDetailsBase {
11
+ appId?: string;
11
12
  patientRefId: string;
12
13
  env: typeof ENVS[keyof typeof ENVS];
13
14
  onSuccess: () => void;
@@ -30,6 +31,7 @@ interface UpdatePaymentDetailsWithToken extends UpdatePaymentDetailsBase {
30
31
  export type UpdatePaymentDetails = UpdatePaymentDetailsWithApiKey | UpdatePaymentDetailsWithToken;
31
32
 
32
33
  const updatePaymentDetails = async ({
34
+ appId,
33
35
  apiKey,
34
36
  token,
35
37
  patientRefId,
@@ -46,7 +48,7 @@ const updatePaymentDetails = async ({
46
48
  if (!callbackOrigin) throw new Error(ERROR_MESSAGES.NO_CALLBACK_ORIGIN);
47
49
 
48
50
  let isSessionComplete = false;
49
- const sdkConfig: { env: typeof ENVS[keyof typeof ENVS] | 'staging' } = { env };
51
+ const sdkConfig: { env: typeof ENVS[keyof typeof ENVS] | 'staging'; appId?: string } = { env };
50
52
  if (env === ENVS.LOCAL) {
51
53
  sdkConfig.env = ENVS.DEV;
52
54
  }
@@ -54,6 +56,10 @@ const updatePaymentDetails = async ({
54
56
  sdkConfig.env = 'staging';
55
57
  }
56
58
 
59
+ if (appId) {
60
+ sdkConfig.appId = appId;
61
+ }
62
+
57
63
  // Set Medipass web-sdk config
58
64
  coreSDK.setConfig(sdkConfig);
59
65