tonder-web-sdk 1.11.0-beta.3 → 1.11.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/.idea/aws.xml ADDED
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="accountSettings">
4
+ <option name="activeProfile" value="profile:default" />
5
+ <option name="activeRegion" value="us-east-1" />
6
+ <option name="recentlyUsedProfiles">
7
+ <list>
8
+ <option value="profile:default" />
9
+ </list>
10
+ </option>
11
+ <option name="recentlyUsedRegions">
12
+ <list>
13
+ <option value="us-east-1" />
14
+ </list>
15
+ </option>
16
+ </component>
17
+ </project>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,62 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="37fc62e5-7dd0-4a2e-b68c-304069cdf5bd" name="Changes" comment="">
5
+ <change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
6
+ <change beforePath="$PROJECT_DIR$/src/classes/inlineCheckout.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/classes/inlineCheckout.js" afterDir="false" />
7
+ </list>
8
+ <option name="SHOW_DIALOG" value="false" />
9
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
10
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
11
+ <option name="LAST_RESOLUTION" value="IGNORE" />
12
+ </component>
13
+ <component name="Git.Settings">
14
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
15
+ </component>
16
+ <component name="MarkdownSettingsMigration">
17
+ <option name="stateVersion" value="1" />
18
+ </component>
19
+ <component name="ProjectColorInfo"><![CDATA[{
20
+ "customColor": "",
21
+ "associatedIndex": 2
22
+ }]]></component>
23
+ <component name="ProjectId" id="2iy5RvaLleBBnn8yOfQNLpzKK66" />
24
+ <component name="ProjectViewState">
25
+ <option name="autoscrollFromSource" value="true" />
26
+ <option name="autoscrollToSource" value="true" />
27
+ <option name="hideEmptyMiddlePackages" value="true" />
28
+ <option name="openDirectoriesWithSingleClick" value="true" />
29
+ <option name="showLibraryContents" value="true" />
30
+ </component>
31
+ <component name="PropertiesComponent"><![CDATA[{
32
+ "keyToString": {
33
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
34
+ "RunOnceActivity.ShowReadmeOnStart": "true",
35
+ "git-widget-placeholder": "Merging TNDR-1140",
36
+ "nodejs_package_manager_path": "npm",
37
+ "vue.rearranger.settings.migration": "true"
38
+ }
39
+ }]]></component>
40
+ <component name="SharedIndexes">
41
+ <attachedChunks>
42
+ <set>
43
+ <option value="bundled-python-sdk-50da183f06c8-2887949eec09-com.jetbrains.pycharm.pro.sharedIndexes.bundled-PY-233.13135.95" />
44
+ </set>
45
+ </attachedChunks>
46
+ </component>
47
+ <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
48
+ <component name="TaskManager">
49
+ <task active="true" id="Default" summary="Default task">
50
+ <changelist id="37fc62e5-7dd0-4a2e-b68c-304069cdf5bd" name="Changes" comment="" />
51
+ <created>1720449973301</created>
52
+ <option name="number" value="Default" />
53
+ <option name="presentableId" value="Default" />
54
+ <updated>1720449973301</updated>
55
+ <workItem from="1720449976262" duration="22000" />
56
+ </task>
57
+ <servers />
58
+ </component>
59
+ <component name="TypeScriptGeneratedFilesManager">
60
+ <option name="version" value="3" />
61
+ </component>
62
+ </project>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tonder-web-sdk",
3
- "version": "1.11.0-beta.3",
3
+ "version": "1.11.1",
4
4
  "description": "tonder sdk for integrations",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -252,13 +252,18 @@ export class InlineCheckout {
252
252
  const routerItems = {
253
253
  checkout_id: response.checkout?.id,
254
254
  };
255
- const routerResponse = await startCheckoutRouter(
256
- this.baseUrl,
257
- this.apiKeyTonder,
258
- routerItems
259
- );
260
- globalLoader.remove()
261
- return routerResponse
255
+ try {
256
+ const routerResponse = await startCheckoutRouter(
257
+ this.baseUrl,
258
+ this.apiKeyTonder,
259
+ routerItems
260
+ );
261
+ return routerResponse
262
+ } catch (error) {
263
+ throw error
264
+ } finally {
265
+ globalLoader.remove()
266
+ }
262
267
  }
263
268
  return response
264
269
  }
@@ -444,7 +449,7 @@ export class InlineCheckout {
444
449
  );
445
450
 
446
451
  const selected_apm = this.apmsData ? this.apmsData.find((iapm) => iapm.pk === this.radioChecked):{};
447
-
452
+
448
453
  // Checkout router
449
454
  const routerItems = {
450
455
  name: this.firstName || "",
@@ -468,7 +473,7 @@ export class InlineCheckout {
468
473
  metadata: this.metadata,
469
474
  browser_info: getBrowserInfo(),
470
475
  currency: this.currency,
471
- ...( !!selected_apm
476
+ ...( selected_apm && Object.keys(selected_apm).length > 0
472
477
  ? {payment_method: selected_apm.payment_method}
473
478
  : {card: cardTokens}
474
479
  )
@@ -178,7 +178,6 @@ export const cardTemplate = (data) => `
178
178
  .apms-list-container {
179
179
  display: flex;
180
180
  flex-direction: column;
181
- padding: ;
182
181
  gap: 33% 20px;
183
182
  max-height: 300px;
184
183
  overflow-y: auto;
@@ -340,8 +340,11 @@ export const getAPMType = (scheme_data) => {
340
340
  },
341
341
  };
342
342
 
343
- const default_image = "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png";
344
- return PAYMENT_METHODS_CATALOG[scheme] || default_image;
343
+ const _default = {
344
+ icon: "https://d35a75syrgujp0.cloudfront.net/payment_methods/store.png",
345
+ label: ""
346
+ };
347
+ return PAYMENT_METHODS_CATALOG[scheme] || _default;
345
348
  }
346
349
 
347
350
 
package/src/index-dev.js CHANGED
@@ -108,8 +108,7 @@ const inlineCheckout = new InlineCheckout({
108
108
  apiKey,
109
109
  returnUrl,
110
110
  successUrl,
111
- styles: customStyles,
112
- renderPaymentButton: true
111
+ styles: customStyles
113
112
  });
114
113
  inlineCheckout.configureCheckout({customer: checkoutData.customer})
115
114
  inlineCheckout.injectCheckout();