@salla.sa/applepay 2.14.471 → 2.14.473

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/index.js +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/applepay",
3
- "version": "2.14.471",
3
+ "version": "2.14.473",
4
4
  "description": "Salla Apple Pay light",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
@@ -26,5 +26,5 @@
26
26
  "dependencies": {
27
27
  "axios": "^1.10.0"
28
28
  },
29
- "gitHead": "ca421e7f24844eccb183b1520806f848782702f7"
29
+ "gitHead": "64cdde63bad68f783cc93216f182e208688e39d7"
30
30
  }
package/src/index.js CHANGED
@@ -151,7 +151,15 @@ window.SallaApplePay = {
151
151
  SallaApplePay.session.oncouponcodechanged = SallaApplePay.onCouponCodeChanged;
152
152
  SallaApplePay.session.onpaymentmethodselected = SallaApplePay.onPaymentMethodSelected;
153
153
 
154
- SallaApplePay.session.begin();
154
+ // Hook between session creation and begin(). Return truthy to skip
155
+ // begin() (caller handles it later, e.g. after async work).
156
+ let skipBegin;
157
+ if (typeof SallaApplePay.detail.onStartedSession === 'function') {
158
+ skipBegin = SallaApplePay.detail.onStartedSession(SallaApplePay.session);
159
+ }
160
+ if (!skipBegin) {
161
+ SallaApplePay.session.begin();
162
+ }
155
163
  },
156
164
  onPaymentMethodSelected: async (event) => {
157
165
  salla.logger.log('🍏 Pay: onPaymentMethodSelected', event);