@swirepay-developer/swirepay-card-sdk 2.0.3 → 2.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swirepay-developer/swirepay-card-sdk",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Swirepay Card Payment SDK (Web Component with Modal UI)",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -184,9 +184,9 @@ export class SwirepayCheckout extends HTMLElement {
184
184
  async connectedCallback() {
185
185
  this.amount = parseInt(this.getAttribute("amount")) || 0;
186
186
  this.test = this.getAttribute("mode") === "test";
187
- this.currencyCode = this.getAttribute("currencyCode");
187
+ this.currencyCode = this.getAttribute("currencycode");
188
188
  this.apiKey = this.getAttribute("api-key");
189
- this.isAddressRequired = this.getAttribute("isAddressRequired") === "true";
189
+ this.isAddressRequired = this.getAttribute("isaddressrequired") === "true";
190
190
  this.inventory = this.getAttribute("inventory") === "true";
191
191
  this.frequency = this.getAttribute("frequency");
192
192
  this.description = this.getAttribute("description");
@@ -254,10 +254,6 @@ export class SwirepayCheckout extends HTMLElement {
254
254
  this.isAddressRequired = newValue === "true";
255
255
  break;
256
256
 
257
- case "inventory":
258
- this.inventory = newValue === "true";
259
- break;
260
-
261
257
  case "frequency":
262
258
  this.frequency = newValue;
263
259
  break;
@@ -273,11 +269,23 @@ export class SwirepayCheckout extends HTMLElement {
273
269
  case "customer":
274
270
  this.customer = newValue ? JSON.parse(newValue) : {};
275
271
  break;
276
-
272
+
277
273
  case "inventoryorders":
278
274
  this.inventoryOrder = newValue ? JSON.parse(newValue) : {};
279
275
  break;
280
276
 
277
+ case "inventory":
278
+ this.inventory = newValue === "true";
279
+
280
+ if (this.inventory && this.inventoryOrder) {
281
+ this.getSplitUpDetails(this.inventoryOrder).then(res => {
282
+ this.splitUp = res?.entity;
283
+ this.render();
284
+ });
285
+ return;
286
+ }
287
+ break;
288
+
281
289
  default:
282
290
  break;
283
291
  }