diff --git a/package.json b/package.json index d75ccfb..26dd3b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tonder.io/ionic-lite-sdk", - "version": "0.0.50", + "version": "0.0.51", "description": "Tonder ionic lite SDK", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/classes/BaseInlineCheckout.ts b/src/classes/BaseInlineCheckout.ts index b6616b0..f66cf1d 100644 --- a/src/classes/BaseInlineCheckout.ts +++ b/src/classes/BaseInlineCheckout.ts @@ -305,8 +305,8 @@ export class BaseInlineCheckout { #setCheckoutData(data: IConfigureCheckout | IProcessPaymentRequest){ if(!data || (data && Object.keys(data).length === 0)) return; this.#handleCustomer(data.customer); - this._setCartTotal(data.cart?.total); - this.#setCartItems(data.cart?.items); + this._setCartTotal(data.cart?.total || 0); + this.#setCartItems(data.cart?.items || []); this.#handleMetadata(data); this.#handleCurrency(data); this.#handleCard(data); diff --git a/src/types/commons.ts b/src/types/commons.ts index 04cd16c..dc2d092 100644 --- a/src/types/commons.ts +++ b/src/types/commons.ts @@ -85,7 +85,7 @@ export type APM = { label: string; }; -export interface IConfigureCheckout extends IProcessPaymentRequest{ +export interface IConfigureCheckout extends Partial{ customer: ICustomer | { email: string }; secureToken: string }