@medipass/checkout-sdk 3.0.1 → 3.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.
@@ -8,6 +8,7 @@ interface UpdatePaymentDetailsBase {
8
8
  onCancel: () => void;
9
9
  onClose: () => void;
10
10
  callbackOrigin: string;
11
+ sendSms?: boolean;
11
12
  }
12
13
  interface UpdatePaymentDetailsWithApiKey extends UpdatePaymentDetailsBase {
13
14
  apiKey: string;
@@ -18,5 +19,5 @@ interface UpdatePaymentDetailsWithToken extends UpdatePaymentDetailsBase {
18
19
  apiKey?: never;
19
20
  }
20
21
  export type UpdatePaymentDetails = UpdatePaymentDetailsWithApiKey | UpdatePaymentDetailsWithToken;
21
- declare const updatePaymentDetails: ({ appId, apiKey, token, patientRefId, env, onSuccess, onFailure, onCancel, onClose, callbackOrigin, }: UpdatePaymentDetails) => Promise<void>;
22
+ declare const updatePaymentDetails: ({ appId, apiKey, token, patientRefId, env, onSuccess, onFailure, onCancel, onClose, callbackOrigin, sendSms, }: UpdatePaymentDetails) => Promise<void>;
22
23
  export default updatePaymentDetails;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medipass/checkout-sdk",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "Medipass Checkout SDK",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -16,6 +16,7 @@ interface UpdatePaymentDetailsBase {
16
16
  onCancel: () => void;
17
17
  onClose: () => void;
18
18
  callbackOrigin: string;
19
+ sendSms?: boolean;
19
20
  }
20
21
 
21
22
  interface UpdatePaymentDetailsWithApiKey extends UpdatePaymentDetailsBase {
@@ -41,6 +42,7 @@ const updatePaymentDetails = async ({
41
42
  onCancel,
42
43
  onClose,
43
44
  callbackOrigin,
45
+ sendSms = true,
44
46
  }: UpdatePaymentDetails) => {
45
47
  if (!apiKey && !token) throw new Error(ERROR_MESSAGES.NO_API_KEY_OR_NO_TOKEN);
46
48
  if (!patientRefId) throw new Error(ERROR_MESSAGES.NO_PATIENT_REF_ID);
@@ -121,7 +123,7 @@ const updatePaymentDetails = async ({
121
123
  myBusinessId,
122
124
  patientId,
123
125
  {
124
- sms: { sendToPatientRecordMobile: false, mobile: patient.mobile },
126
+ ...(sendSms && { sms: { sendToPatientRecordMobile: false, mobile: patient.mobile } }),
125
127
  callbackOrigin: callbackOrigin,
126
128
  },
127
129
  );