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