@akinon/pz-masterpass 1.29.0 → 1.30.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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @akinon/pz-masterpass
2
2
 
3
+ ## 1.30.1
4
+
5
+ ## 1.30.0
6
+
7
+ ### Minor Changes
8
+
9
+ - 4084a13: ZERO-2515: Fix condition for isDirectPurchase
10
+ - a1d03d3: ZERO-2571:Make the sendSmsLanguage value dynamic for masterpass
11
+
12
+ ### Patch Changes
13
+
14
+ - 073fbd2: ZERO-2503: Add check changeset control script
15
+
3
16
  ## 1.29.0
4
17
 
5
18
  ## 1.27.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/pz-masterpass",
3
- "version": "1.29.0",
3
+ "version": "1.30.1",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.d.ts",
@@ -32,13 +32,15 @@ export const useCards = ({ skipData }: UseCardsProps = { skipData: true }) => {
32
32
  token: token
33
33
  });
34
34
 
35
+ const hasNoCards = !cards || cards.length === 0;
36
+
35
37
  if (description) {
36
38
  setError(description);
37
39
  }
38
40
 
39
41
  setLoading(false);
40
42
  dispatch(setCards(cards));
41
- dispatch(setIsDirectPurchase(cards?.length === 0));
43
+ dispatch(setIsDirectPurchase(hasNoCards));
42
44
  }, [msisdn, token]);
43
45
 
44
46
  useEffect(() => {
@@ -79,6 +79,7 @@ export const buildPurchaseForm = async ({
79
79
  selectedCard,
80
80
  amount,
81
81
  additionalParams,
82
+ language = 'eng',
82
83
  installmentCount
83
84
  }: {
84
85
  token: string;
@@ -91,6 +92,7 @@ export const buildPurchaseForm = async ({
91
92
  additionalParams?: {
92
93
  [key: string]: any;
93
94
  };
95
+ language: string;
94
96
  installmentCount: number;
95
97
  }) => {
96
98
  const session = await getSession();
@@ -115,7 +117,7 @@ export const buildPurchaseForm = async ({
115
117
  { name: 'msisdn', value: msisdn },
116
118
  { name: 'installmentCount', value: String(installmentCount) },
117
119
  { name: 'macroMerchantId', value: merchantId },
118
- { name: 'sendSmsLanguage', value: 'eng' },
120
+ { name: 'sendSmsLanguage', value: language },
119
121
  { name: 'sendSms', value: 'N' },
120
122
  { name: 'cardName', value: selectedCard?.Name ?? '' },
121
123
  { name: 'listAccountName', value: selectedCard?.Name ?? '' },
@@ -139,6 +141,7 @@ export const buildDirectPurchaseForm = async (
139
141
  merchantId,
140
142
  amount,
141
143
  additionalParams,
144
+ language = 'eng',
142
145
  installmentCount
143
146
  }: {
144
147
  token: string;
@@ -150,6 +153,7 @@ export const buildDirectPurchaseForm = async (
150
153
  additionalParams?: {
151
154
  [key: string]: any;
152
155
  };
156
+ language: string;
153
157
  installmentCount: number;
154
158
  },
155
159
  params?: CompleteCreditCardParams
@@ -182,7 +186,7 @@ export const buildDirectPurchaseForm = async (
182
186
  { name: 'msisdn', value: msisdn },
183
187
  { name: 'installmentCount', value: String(installmentCount) },
184
188
  { name: 'macroMerchantId', value: merchantId },
185
- { name: 'sendSmsLanguage', value: 'eng' },
189
+ { name: 'sendSmsLanguage', value: language },
186
190
  { name: 'sendSms', value: 'N' },
187
191
  { name: 'rtaPan', value: rtaPan },
188
192
  { name: 'expiryDate', value: expiryDate },