@salla.sa/applepay 2.14.290 → 2.14.292
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/package.json +2 -2
- package/src/index.js +8 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salla.sa/applepay",
|
|
3
|
-
"version": "2.14.
|
|
3
|
+
"version": "2.14.292",
|
|
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": "
|
|
29
|
+
"gitHead": "918b71b51568ef0eb7d7ed29e61694b9b8ede346"
|
|
30
30
|
}
|
package/src/index.js
CHANGED
|
@@ -392,13 +392,18 @@ window.SallaApplePay = {
|
|
|
392
392
|
|
|
393
393
|
selectApplePayShippingMethod: (company_id, private_company_id) => {
|
|
394
394
|
salla.logger.log('🍏 Pay: select shipping method ', 'company_id : ' + company_id, 'private_company_id: ' + private_company_id);
|
|
395
|
-
|
|
396
|
-
return Http.requestWithSupportAjax(SallaApplePay.detail.shippingMethodSelected.url.replace('{id}', SallaApplePay.id), {
|
|
395
|
+
const payload = {
|
|
397
396
|
address_id: SallaApplePay.address_id,
|
|
398
397
|
company_id: company_id,
|
|
399
398
|
private_company_id: private_company_id,
|
|
400
399
|
payment_method: 'apple_pay'
|
|
401
|
-
}
|
|
400
|
+
}
|
|
401
|
+
const selectedShippingMethod = SallaApplePay.shipping_methods?.find((item)=> item.company === company_id || item.ship_id === company_id);
|
|
402
|
+
if (selectedShippingMethod?.route_id){
|
|
403
|
+
payload.shipping_route_id = selectedShippingMethod.route_id
|
|
404
|
+
payload.type = selectedShippingMethod.type
|
|
405
|
+
}
|
|
406
|
+
return Http.requestWithSupportAjax(SallaApplePay.detail.shippingMethodSelected.url.replace('{id}', SallaApplePay.id), payload, 'post').then(() => {
|
|
402
407
|
if (typeof SallaApplePay.detail.shippingMethodSelected.onSuccess === 'function') {
|
|
403
408
|
SallaApplePay.detail.shippingMethodSelected.onSuccess(data);
|
|
404
409
|
}
|