@salla.sa/applepay 2.14.313 → 2.14.339

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/deploy.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://cdn.assets.salla.network/json-schemas/deploy.json",
3
+ "type": "package",
4
+ "publish": {
5
+ "npm": true,
6
+ "cdn": false
7
+ }
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/applepay",
3
- "version": "2.14.313",
3
+ "version": "2.14.339",
4
4
  "description": "Salla Apple Pay light",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
@@ -25,6 +25,5 @@
25
25
  "homepage": "https://github.com/SallaApp/twilight#readme",
26
26
  "dependencies": {
27
27
  "axios": "^1.10.0"
28
- },
29
- "gitHead": "0dfc88041a08bcc7490f5e5e7977649824bd192b"
28
+ }
30
29
  }
package/src/index.js CHANGED
@@ -368,8 +368,10 @@ window.SallaApplePay = {
368
368
 
369
369
  return Http.requestWithSupportAjax(SallaApplePay.detail.recalculateTotal.url.replace('{id}', SallaApplePay.id), {}, 'get').then((data) => {
370
370
  let cart = data.data.initial_data?.cart || data.data.cart;
371
+ let payments = data.data.initial_data?.payments;
372
+
371
373
  // todo :: enhance response from backend
372
- SallaApplePay.detail.amount = cart.total;
374
+ SallaApplePay.detail.amount = payments?.gateways?.applePay?.supportedMultiCurrency ? cart.total_in_customer_currency : cart.total;
373
375
  SallaApplePay.detail.items = (cart.totals || cart.items).map((item) => {
374
376
  return {
375
377
  label: item.title,
@@ -398,7 +400,7 @@ window.SallaApplePay = {
398
400
  private_company_id: private_company_id,
399
401
  payment_method: 'apple_pay'
400
402
  }
401
- const selectedShippingMethod = SallaApplePay.shipping_methods?.find((item)=> item.company === company_id || item.ship_id === company_id);
403
+ const selectedShippingMethod = SallaApplePay.shipping_methods?.find((item)=> item.company == company_id || item.ship_id == company_id);
402
404
  if (selectedShippingMethod?.route_id){
403
405
  payload.shipping_route_id = selectedShippingMethod.route_id
404
406
  payload.type = selectedShippingMethod.type