@medipass/checkout-sdk 3.0.0-alpha.8 → 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.
- package/README.md +10 -16
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/requestUpdatePaymentDetails.d.ts +2 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/requestUpdatePaymentDetails.d.ts +2 -1
- package/dist/umd/index.min.js +3 -3
- package/dist/umd/requestUpdatePaymentDetails.d.ts +2 -1
- package/package.json +3 -7
- package/src/requestUpdatePaymentDetails.ts +7 -1
|
@@ -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,21 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medipass/checkout-sdk",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
|
+
"description": "Medipass Checkout SDK",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "yarn rollup -c",
|
|
9
|
-
"build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
|
|
10
9
|
"check-types": "tsc --noEmit",
|
|
11
10
|
"clean": "rm -rf dist",
|
|
12
11
|
"develop": "nodemon -w src -x 'yarn build'",
|
|
13
12
|
"lint": "eslint \"**/*.{ts,tsx}\"",
|
|
14
13
|
"lint:fix": "eslint \"**/*.{ts,tsx}\" --fix",
|
|
15
|
-
"prepublishOnly": "
|
|
16
|
-
"test": "nwb test",
|
|
17
|
-
"test:coverage": "nwb test --coverage",
|
|
18
|
-
"test:watch": "nwb test --server"
|
|
14
|
+
"prepublishOnly": "yarn build"
|
|
19
15
|
},
|
|
20
16
|
"dependencies": {
|
|
21
17
|
"@medipass/utils": "11.80.7",
|
|
@@ -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
|
|