@salla.sa/applepay 3.0.15 → 3.0.17

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/utils.js +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/applepay",
3
- "version": "3.0.15",
3
+ "version": "3.0.17",
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": "6d4ff7260a827c6a9aece62de41e1d10e2439953"
29
+ "gitHead": "a5342823e2e6bdff83f7ae1b97ed43666361e90b"
30
30
  }
package/src/utils.js CHANGED
@@ -34,7 +34,7 @@ export async function mutateShippingContact(SallaApplePay, shippingContact, isAu
34
34
  }
35
35
 
36
36
  if (isAuthorized) {
37
- if (isGuestCheckout()) {
37
+ if (isGuestCheckout(SallaApplePay)) {
38
38
 
39
39
  if (
40
40
  !shippingContact.emailAddress ||
@@ -180,8 +180,9 @@ export async function mutateShippingContact(SallaApplePay, shippingContact, isAu
180
180
  );
181
181
  }
182
182
 
183
- function isGuestCheckout() {
184
- return salla.config.isGuest() && salla.config.get('store.features').includes('guest-checkout');
183
+ // the caller passes guestContactSelected only when it decided on guest checkout (same signal as the QR flow)
184
+ function isGuestCheckout(SallaApplePay) {
185
+ return salla.config.isGuest() && !!SallaApplePay.detail?.guestContactSelected;
185
186
  }
186
187
 
187
188
  /**