@ikas/storefront 0.1.23 → 0.1.24-alpha.1

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/build/index.es.js CHANGED
@@ -19821,6 +19821,7 @@ var IkasCart = /** @class */ (function () {
19821
19821
  var IkasPaymentGateway = /** @class */ (function () {
19822
19822
  function IkasPaymentGateway(data) {
19823
19823
  var _a;
19824
+ this.supportedCurrencies = [];
19824
19825
  this.paymentMethods = data.paymentMethods || [];
19825
19826
  this.paymentMethodType =
19826
19827
  data.paymentMethodType || IkasPaymentMethodType.OTHER;
@@ -19834,6 +19835,7 @@ var IkasPaymentGateway = /** @class */ (function () {
19834
19835
  this.additionalPrices =
19835
19836
  ((_a = data.additionalPrices) === null || _a === void 0 ? void 0 : _a.map(function (ap) { return new IkasPaymentGatewayAdditionalPrice(ap); })) || null;
19836
19837
  this.translations = data.translations || null;
19838
+ this.supportedCurrencies = data.supportedCurrencies || [];
19837
19839
  this.setTranslations();
19838
19840
  makeAutoObservable(this);
19839
19841
  }
@@ -23349,6 +23351,7 @@ var CheckoutViewModel = /** @class */ (function () {
23349
23351
  }); };
23350
23352
  this.listPaymentGateways = function () { return __awaiter(_this, void 0, void 0, function () {
23351
23353
  var isLocal, idList, paymentGateways, orderedPaymentGateways;
23354
+ var _this = this;
23352
23355
  return __generator(this, function (_a) {
23353
23356
  switch (_a.label) {
23354
23357
  case 0:
@@ -23363,9 +23366,14 @@ var CheckoutViewModel = /** @class */ (function () {
23363
23366
  };
23364
23367
  return [2 /*return*/];
23365
23368
  }
23369
+ paymentGateways = paymentGateways.filter(function (pg) {
23370
+ return pg.supportedCurrencies.length
23371
+ ? pg.supportedCurrencies.includes(_this.checkout.cart.currencyCode)
23372
+ : true;
23373
+ });
23366
23374
  orderedPaymentGateways = [];
23367
23375
  sortBy_1(IkasStorefrontConfig.paymentGateways, "order").forEach(function (pg) {
23368
- var _pg = paymentGateways.find(function (p) { return p.id === pg.id; });
23376
+ var _pg = paymentGateways === null || paymentGateways === void 0 ? void 0 : paymentGateways.find(function (p) { return p.id === pg.id; });
23369
23377
  if (_pg)
23370
23378
  orderedPaymentGateways.push(_pg);
23371
23379
  });
@@ -41166,7 +41174,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
41166
41174
  return __generator(this, function (_b) {
41167
41175
  switch (_b.label) {
41168
41176
  case 0:
41169
- QUERY = src(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n }\n }\n "], ["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n }\n }\n "])));
41177
+ QUERY = src(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n }\n }\n "], ["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n }\n }\n "])));
41170
41178
  _b.label = 1;
41171
41179
  case 1:
41172
41180
  _b.trys.push([1, 3, , 4]);
package/build/index.js CHANGED
@@ -19836,6 +19836,7 @@ var IkasCart = /** @class */ (function () {
19836
19836
  var IkasPaymentGateway = /** @class */ (function () {
19837
19837
  function IkasPaymentGateway(data) {
19838
19838
  var _a;
19839
+ this.supportedCurrencies = [];
19839
19840
  this.paymentMethods = data.paymentMethods || [];
19840
19841
  this.paymentMethodType =
19841
19842
  data.paymentMethodType || IkasPaymentMethodType.OTHER;
@@ -19849,6 +19850,7 @@ var IkasPaymentGateway = /** @class */ (function () {
19849
19850
  this.additionalPrices =
19850
19851
  ((_a = data.additionalPrices) === null || _a === void 0 ? void 0 : _a.map(function (ap) { return new IkasPaymentGatewayAdditionalPrice(ap); })) || null;
19851
19852
  this.translations = data.translations || null;
19853
+ this.supportedCurrencies = data.supportedCurrencies || [];
19852
19854
  this.setTranslations();
19853
19855
  mobx.makeAutoObservable(this);
19854
19856
  }
@@ -23356,6 +23358,7 @@ var CheckoutViewModel = /** @class */ (function () {
23356
23358
  }); };
23357
23359
  this.listPaymentGateways = function () { return __awaiter(_this, void 0, void 0, function () {
23358
23360
  var isLocal, idList, paymentGateways, orderedPaymentGateways;
23361
+ var _this = this;
23359
23362
  return __generator(this, function (_a) {
23360
23363
  switch (_a.label) {
23361
23364
  case 0:
@@ -23370,9 +23373,14 @@ var CheckoutViewModel = /** @class */ (function () {
23370
23373
  };
23371
23374
  return [2 /*return*/];
23372
23375
  }
23376
+ paymentGateways = paymentGateways.filter(function (pg) {
23377
+ return pg.supportedCurrencies.length
23378
+ ? pg.supportedCurrencies.includes(_this.checkout.cart.currencyCode)
23379
+ : true;
23380
+ });
23373
23381
  orderedPaymentGateways = [];
23374
23382
  sortBy_1(IkasStorefrontConfig.paymentGateways, "order").forEach(function (pg) {
23375
- var _pg = paymentGateways.find(function (p) { return p.id === pg.id; });
23383
+ var _pg = paymentGateways === null || paymentGateways === void 0 ? void 0 : paymentGateways.find(function (p) { return p.id === pg.id; });
23376
23384
  if (_pg)
23377
23385
  orderedPaymentGateways.push(_pg);
23378
23386
  });
@@ -41145,7 +41153,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
41145
41153
  return __generator(this, function (_b) {
41146
41154
  switch (_b.label) {
41147
41155
  case 0:
41148
- QUERY = src(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n }\n }\n "], ["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n }\n }\n "])));
41156
+ QUERY = src(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n }\n }\n "], ["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n }\n }\n "])));
41149
41157
  _b.label = 1;
41150
41158
  case 1:
41151
41159
  _b.trys.push([1, 3, , 4]);
@@ -11,6 +11,7 @@ export declare class IkasPaymentGateway {
11
11
  description: string | null;
12
12
  additionalPrices: IkasPaymentGatewayAdditionalPrice[] | null;
13
13
  translations: IkasPaymentGatewayTranslation[] | null;
14
+ supportedCurrencies: string[];
14
15
  constructor(data: Partial<IkasPaymentGateway>);
15
16
  getCalculatedAdditionalPrices(totalFinalPrice: number, shippingLines: IkasOrderShippingLine[] | null): {
16
17
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.1.23",
3
+ "version": "0.1.24-alpha.1",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",