idpay-b2b-sdk 0.0.24 → 0.0.26

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/index.cjs CHANGED
@@ -9,7 +9,9 @@
9
9
  let _type;
10
10
  let _initialized = false;
11
11
  let _openWhileInitializing = false;
12
+ let _collectionId;
12
13
  const TYPE__IFRAME = 'IFRAME';
14
+ const TYPE_SILENT = 'SILENT';
13
15
  const ENV_DEV = 'dev';
14
16
  const ENV_UAT = 'uat';
15
17
  const ENV_PROD = 'prod';
@@ -50,7 +52,9 @@
50
52
  });
51
53
  IDPaySDKAssets.trackEvent(IDPaySDKAssets.EVENT_TYPES.INITIALIZE);
52
54
  _type = options?.type;
53
- if (_type === TYPE__IFRAME) {
55
+ if (_type === TYPE_SILENT) {
56
+ _collectionId = await IDPaySDKAssets.clientBoxControl.initSilent();
57
+ } else if (_type === TYPE__IFRAME) {
54
58
  await _createStyles({
55
59
  host
56
60
  });
@@ -63,6 +67,9 @@
63
67
  if (_openWhileInitializing) {
64
68
  startPayFlow(_openWhileInitializing);
65
69
  }
70
+ if (_collectionId) {
71
+ return _collectionId;
72
+ }
66
73
  };
67
74
  const startPayFlow = ({
68
75
  transactionId,
@@ -86,7 +93,14 @@
86
93
  transactionId,
87
94
  token
88
95
  });
89
- if (_type === TYPE__IFRAME) {
96
+ if (_type === TYPE_SILENT) {
97
+ IDPaySDKAssets.clientBoxControl.verify({
98
+ transactionId,
99
+ token,
100
+ collectionId: _collectionId,
101
+ onFinish
102
+ });
103
+ } else if (_type === TYPE__IFRAME) {
90
104
  IDPaySDKAssets.clientBoxControl.open({
91
105
  transactionId,
92
106
  token,
package/index.js CHANGED
@@ -3,7 +3,9 @@
3
3
  let _type;
4
4
  let _initialized = false;
5
5
  let _openWhileInitializing = false;
6
+ let _collectionId;
6
7
  const TYPE__IFRAME = 'IFRAME';
8
+ const TYPE_SILENT = 'SILENT';
7
9
  const ENV_DEV = 'dev';
8
10
  const ENV_UAT = 'uat';
9
11
  const ENV_PROD = 'prod';
@@ -44,7 +46,9 @@ const init = async options => {
44
46
  });
45
47
  IDPaySDKAssets.trackEvent(IDPaySDKAssets.EVENT_TYPES.INITIALIZE);
46
48
  _type = options?.type;
47
- if (_type === TYPE__IFRAME) {
49
+ if (_type === TYPE_SILENT) {
50
+ _collectionId = await IDPaySDKAssets.clientBoxControl.initSilent();
51
+ } else if (_type === TYPE__IFRAME) {
48
52
  await _createStyles({
49
53
  host
50
54
  });
@@ -57,6 +61,9 @@ const init = async options => {
57
61
  if (_openWhileInitializing) {
58
62
  startPayFlow(_openWhileInitializing);
59
63
  }
64
+ if (_collectionId) {
65
+ return _collectionId;
66
+ }
60
67
  };
61
68
  const startPayFlow = ({
62
69
  transactionId,
@@ -80,7 +87,14 @@ const startPayFlow = ({
80
87
  transactionId,
81
88
  token
82
89
  });
83
- if (_type === TYPE__IFRAME) {
90
+ if (_type === TYPE_SILENT) {
91
+ IDPaySDKAssets.clientBoxControl.verify({
92
+ transactionId,
93
+ token,
94
+ collectionId: _collectionId,
95
+ onFinish
96
+ });
97
+ } else if (_type === TYPE__IFRAME) {
84
98
  IDPaySDKAssets.clientBoxControl.open({
85
99
  transactionId,
86
100
  token,
package/index.umd.js CHANGED
@@ -9,7 +9,9 @@
9
9
  let _type;
10
10
  let _initialized = false;
11
11
  let _openWhileInitializing = false;
12
+ let _collectionId;
12
13
  const TYPE__IFRAME = 'IFRAME';
14
+ const TYPE_SILENT = 'SILENT';
13
15
  const ENV_DEV = 'dev';
14
16
  const ENV_UAT = 'uat';
15
17
  const ENV_PROD = 'prod';
@@ -50,7 +52,9 @@
50
52
  });
51
53
  IDPaySDKAssets.trackEvent(IDPaySDKAssets.EVENT_TYPES.INITIALIZE);
52
54
  _type = options?.type;
53
- if (_type === TYPE__IFRAME) {
55
+ if (_type === TYPE_SILENT) {
56
+ _collectionId = await IDPaySDKAssets.clientBoxControl.initSilent();
57
+ } else if (_type === TYPE__IFRAME) {
54
58
  await _createStyles({
55
59
  host
56
60
  });
@@ -63,6 +67,9 @@
63
67
  if (_openWhileInitializing) {
64
68
  startPayFlow(_openWhileInitializing);
65
69
  }
70
+ if (_collectionId) {
71
+ return _collectionId;
72
+ }
66
73
  };
67
74
  const startPayFlow = ({
68
75
  transactionId,
@@ -86,7 +93,14 @@
86
93
  transactionId,
87
94
  token
88
95
  });
89
- if (_type === TYPE__IFRAME) {
96
+ if (_type === TYPE_SILENT) {
97
+ IDPaySDKAssets.clientBoxControl.verify({
98
+ transactionId,
99
+ token,
100
+ collectionId: _collectionId,
101
+ onFinish
102
+ });
103
+ } else if (_type === TYPE__IFRAME) {
90
104
  IDPaySDKAssets.clientBoxControl.open({
91
105
  transactionId,
92
106
  token,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "idpay-b2b-sdk",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/acesso-io/frontend.git",