@salla.sa/twilight-components 2.12.57 → 2.12.59

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.
@@ -24676,8 +24676,9 @@ window.SallaApplePay = {
24676
24676
  SallaApplePay.session.completeMerchantValidation(data.data);
24677
24677
  }
24678
24678
 
24679
- }, ({response}) => {
24680
- SallaApplePay.abortValidateMerchant(response);
24679
+ }, (error) => {
24680
+ console.error(error);
24681
+ SallaApplePay.abortValidateMerchant(error?.response);
24681
24682
  });
24682
24683
  },
24683
24684
 
@@ -25003,17 +25004,15 @@ const SallaQuickBuy = class {
25003
25004
  supportedCountries: salla.config.get('store.settings.buy_now.countries'),
25004
25005
  validateMerchant: {
25005
25006
  url: salla.url.get('checkout/applepay/validate'),
25006
- onSuccess: () => {
25007
- debugger;
25008
- console.log('🍏 Pay: success', { this: this, applePayOnly: this.applePayOnly, productId: this.productId, cartId: this.cartId });
25007
+ onSuccess: (response) => {
25009
25008
  if (this.applePayOnly && !this.productId) { // the cart is not passes
25010
25009
  if (!this.cartId) {
25011
25010
  salla.logger.warn('🍏 Pay: trying to create applePay transaction without cartId/ProductId !');
25012
- return;
25011
+ return Promise.resolve(response);
25013
25012
  }
25014
25013
  window.SallaApplePay.id = this.cartId;
25015
25014
  salla.log('🍏 Pay: create checkout success: with id #' + this.cartId);
25016
- return;
25015
+ return Promise.resolve(response);
25017
25016
  }
25018
25017
  return salla.api.request('checkout/quick-purchase/' + this.productId, typeof data == 'object' ? data : undefined, 'post', {}).then(response => {
25019
25018
  var _a, _b;