arky-sdk 0.3.138 → 0.3.139
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/dist/index.cjs +17 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.cts +1 -0
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -944,9 +944,25 @@ var createEshopApi = (apiConfig) => {
|
|
|
944
944
|
},
|
|
945
945
|
// ===== PAYMENTS =====
|
|
946
946
|
async getQuote(params, options) {
|
|
947
|
+
let blocks = params.blocks || [];
|
|
948
|
+
if (params.location && !blocks.some((b) => b.type === "ADDRESS")) {
|
|
949
|
+
const addressBlock = {
|
|
950
|
+
type: "ADDRESS",
|
|
951
|
+
key: "shipping_address",
|
|
952
|
+
properties: {
|
|
953
|
+
addressType: "SHIPPING"
|
|
954
|
+
},
|
|
955
|
+
value: [params.location]
|
|
956
|
+
};
|
|
957
|
+
blocks = [...blocks, addressBlock];
|
|
958
|
+
}
|
|
947
959
|
const payload = {
|
|
948
960
|
market: apiConfig.market,
|
|
949
|
-
|
|
961
|
+
items: params.items,
|
|
962
|
+
blocks,
|
|
963
|
+
paymentMethodId: params.paymentMethodId,
|
|
964
|
+
shippingMethodId: params.shippingMethodId,
|
|
965
|
+
promoCode: params.promoCode
|
|
950
966
|
};
|
|
951
967
|
return apiConfig.httpClient.post(
|
|
952
968
|
`/v1/businesses/${apiConfig.businessId}/orders/quote`,
|