diff --git a/CHANGELOG.md b/CHANGELOG.md index d357a22538..9661916a68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,104 @@ -# CHANGE LOG (1.3.5-beta.3) - v1.8.4-prerelease-v3 +# CHANGE LOG (1.3.5-beta.4) - v1.8.4-prerelease-v4 + +## Application Client + + + +### Cart + + + +#### checkoutCart + +- ##### What's Deprecated + - [Deleted] Possible nullable value from `true` from property `id` of schema `CartCheckoutDetailRequest` in request body + - [Deleted] Possible nullable value from `true` from property `customerDetails` of schema `CartCheckoutDetailRequest` in request body + - [Breaking] [Deleted] Default value from property `callbackUrl` of schema `CartCheckoutDetailRequest` in request body + - [Deleted] Possible nullable value from `true` from property `callbackUrl` of schema `CartCheckoutDetailRequest` in request body + - [Deleted] Possible nullable value from `true` from property `orderingStore` of schema `CartCheckoutDetailRequest` in request body + - [Deleted] Possible nullable value from `true` from property `paymentIdentifier` of schema `CartCheckoutDetailRequest` in request body + - [Deleted] Possible nullable value from `true` from property `paymentParams` of schema `CartCheckoutDetailRequest` in request body + + +### Order + + + +#### getOrders + +- ##### What's New + - [Added] property `items[].shipments[].bags[].item.attributes` of schema `Item` in response with status code 200 + + +#### getOrderById + +- ##### What's New + - [Added] property `order.shipments[].bags[].item.attributes` of schema `Item` in response with status code 200 + + +#### getPosOrderById + +- ##### What's New + - [Added] property `order.shipments[].bags[].item.attributes` of schema `Item` in response with status code 200 + + +#### getShipmentById + +- ##### What's New + - [Added] property `shipment.bags[].item.attributes` of schema `Item` in response with status code 200 + ## Platform Client +### Cart + + + +#### getStoreAddressByUid + +- ##### What's New + - [Added] property `items[].storeManagerName` of schema `PickupStoreDetail` in response with status code 200 + + ### Catalog +#### createCollection + +- ##### What's New + - [Added] property `seo.sitemap` of schema `SeoDetail` in request body + - [Added] property `seo.breadcrumbs` of schema `SeoDetail` in request body + - [Added] property `seo.metaTags` of schema `SeoDetail` in request body + + +#### updateCollection + +- ##### What's New + - [Added] property `seo.sitemap` of schema `SeoDetail` in request body + - [Added] property `seo.breadcrumbs` of schema `SeoDetail` in request body + - [Added] property `seo.metaTags` of schema `SeoDetail` in request body + - [Added] property `seo.sitemap` of schema `SeoDetail` in response with status code 200 + - [Added] property `seo.breadcrumbs` of schema `SeoDetail` in response with status code 200 + - [Added] property `seo.metaTags` of schema `SeoDetail` in response with status code 200 + + +#### getAppProduct + +- ##### What's New + - [Added] Default value to property `seo` of schema `OwnerAppItemResponse` in response with status code 200 + - [Added] Default value `` to property `seo` of schema `OwnerAppItemResponse` in response with status code 200 + - [Added] Default value `` to property `seo` of schema `OwnerAppItemResponse` in response with status code 200 + + +#### updateAppProduct + +- ##### What's New + - [Added] property `sizePromotionThreshold` of schema `ApplicationItemMeta` in request body + + #### getProductBulkUploadHistory - ##### What's New @@ -20,6 +111,99 @@ - [Breaking] [Changed] Type from `object` to `array` of property `items` of schema `ProductBulkRequest` in response with status code 200 +### Discount + + + +#### validateDiscountFile + +- ##### What's New + - [Added] property `filePath` of schema `FileJobResponse` in response with status code 200 + +- ##### What's Changed + - [Breaking] [Changed] Possible values from `validation` to `validate` of property `type` of schema `FileJobResponse` in response with status code 200 + + +#### downloadDiscountFile + +- ##### What's New + - [Added] property `filePath` of schema `FileJobResponse` in response with status code 200 + +- ##### What's Changed + - [Breaking] [Changed] Possible values from `validation` to `validate` of property `type` of schema `FileJobResponse` in response with status code 200 + + +#### getValidationJob + +- ##### What's New + - [Added] property `filePath` of schema `FileJobResponse` in response with status code 200 + +- ##### What's Changed + - [Breaking] [Changed] Possible values from `validation` to `validate` of property `type` of schema `FileJobResponse` in response with status code 200 + + +#### getDownloadJob + +- ##### What's New + - [Added] property `filePath` of schema `FileJobResponse` in response with status code 200 + +- ##### What's Changed + - [Breaking] [Changed] Possible values from `validation` to `validate` of property `type` of schema `FileJobResponse` in response with status code 200 + + +### Order + + + +#### createOrder + +- ##### What's New + - [Added] property `shipments[].orderType` of schema `Shipment` in request body + - [Added] property `userInfo` of schema `CreateOrderAPI` in request body + - [Breaking] [Added] Required status to property `user_info` in request body + + +#### getShipmentById + +- ##### What's New + - [Added] property `shipments[].status.currentShipmentStatus` of schema `ShipmentStatusData` in response with status code 200 + + +#### getOrderById + +- ##### What's New + - [Added] `query` parameter `myOrders` (type: `boolean`) + + - [Added] property `shipments[].status.currentShipmentStatus` of schema `ShipmentStatusData` in response with status code 200 + + +#### getOrders + +- ##### What's New + - [Added] property `items[].shipments[].status.currentShipmentStatus` of schema `ShipmentStatusData` in response with status code 200 + + +### Payment + + + +#### updatePaymentSession + +- ##### What's New + - [Added] property `meta` of schema `PaymentSessionRequestSerializer` in request body + +- ##### What's Deprecated + - [Deleted] Possible values from `test,live` from property `paymentDetails[].mode` of schema `PaymentSessionDetail` in request body + - [Deleted] Required status from property `paymentDetails[].billing_address` in request body + - [Deleted] Required status from property `paymentDetails[].shipping_address` in request body + + +#### updateRefundSession + +- ##### What's New + - [Added] property `meta` of schema `RefundSessionRequestSerializer` in request body + + ### User diff --git a/FDKClient.podspec b/FDKClient.podspec index 9721436d15..ad498f2855 100644 --- a/FDKClient.podspec +++ b/FDKClient.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |s| s.name = 'FDKClient' - s.version = '1.3.5-beta.3' + s.version = '1.3.5-beta.4' s.summary = 'FDK Client SDK for Swift language' s.description = 'FDK Client SDK for Swift language that can be used to make Apps or extensions.' diff --git a/Sources/code/application/ApplicationAPIClient.swift b/Sources/code/application/ApplicationAPIClient.swift index 1d65edf95d..4eef3340a1 100644 --- a/Sources/code/application/ApplicationAPIClient.swift +++ b/Sources/code/application/ApplicationAPIClient.swift @@ -13,7 +13,7 @@ class ApplicationAPIClient { var headers = [ (key: "Authorization", value: "Bearer " + "\(config.applicationId):\(config.applicationToken)".asBase64) ] - headers.append((key: "x-fp-sdk-version", value: "1.3.5-beta.3")) + headers.append((key: "x-fp-sdk-version", value: "1.3.5-beta.4")) headers.append(contentsOf: extraHeaders) headers.append(contentsOf: config.extraHeaders) if let userAgent = config.userAgent { diff --git a/Sources/code/application/Models/Cart/CartCheckoutDetailRequestCartAppModel.swift b/Sources/code/application/Models/Cart/CartCheckoutDetailRequestCartAppModel.swift index 46eacf3c95..b78284e7be 100644 --- a/Sources/code/application/Models/Cart/CartCheckoutDetailRequestCartAppModel.swift +++ b/Sources/code/application/Models/Cart/CartCheckoutDetailRequestCartAppModel.swift @@ -385,7 +385,7 @@ public extension ApplicationClient.Cart { - try? container.encode(customerDetails, forKey: .customerDetails) + try? container.encodeIfPresent(customerDetails, forKey: .customerDetails) @@ -395,7 +395,7 @@ public extension ApplicationClient.Cart { - try? container.encode(id, forKey: .id) + try? container.encodeIfPresent(id, forKey: .id) @@ -420,7 +420,7 @@ public extension ApplicationClient.Cart { - try? container.encode(callbackUrl, forKey: .callbackUrl) + try? container.encodeIfPresent(callbackUrl, forKey: .callbackUrl) @@ -440,7 +440,7 @@ public extension ApplicationClient.Cart { - try? container.encode(orderingStore, forKey: .orderingStore) + try? container.encodeIfPresent(orderingStore, forKey: .orderingStore) @@ -450,7 +450,7 @@ public extension ApplicationClient.Cart { - try? container.encode(paymentIdentifier, forKey: .paymentIdentifier) + try? container.encodeIfPresent(paymentIdentifier, forKey: .paymentIdentifier) @@ -460,7 +460,7 @@ public extension ApplicationClient.Cart { - try? container.encode(paymentParams, forKey: .paymentParams) + try? container.encodeIfPresent(paymentParams, forKey: .paymentParams) diff --git a/Sources/code/application/Models/Cart/CustomerDetailsCartAppModel.swift b/Sources/code/application/Models/Cart/CustomerDetailsCartAppModel.swift index 777fd520e8..ef25e78e1b 100644 --- a/Sources/code/application/Models/Cart/CustomerDetailsCartAppModel.swift +++ b/Sources/code/application/Models/Cart/CustomerDetailsCartAppModel.swift @@ -74,7 +74,7 @@ public extension ApplicationClient.Cart { - try? container.encode(email, forKey: .email) + try? container.encodeIfPresent(email, forKey: .email) diff --git a/Sources/code/application/Models/Order/ItemOrderAppModel.swift b/Sources/code/application/Models/Order/ItemOrderAppModel.swift index 27f1e9eea8..97c1bbd8e0 100644 --- a/Sources/code/application/Models/Order/ItemOrderAppModel.swift +++ b/Sources/code/application/Models/Order/ItemOrderAppModel.swift @@ -30,6 +30,8 @@ public extension ApplicationClient.Order { public var size: String? + public var attributes: [String: Any]? + public enum CodingKeys: String, CodingKey { @@ -55,9 +57,11 @@ public extension ApplicationClient.Order { case size = "size" + case attributes = "attributes" + } - public init(brand: ItemBrand? = nil, code: String? = nil, id: Double? = nil, image: [String]? = nil, l1Categories: [String]? = nil, l2Categories: [String]? = nil, l3CategoryName: String? = nil, name: String? = nil, sellerIdentifier: String? = nil, size: String? = nil, slugKey: String? = nil) { + public init(attributes: [String: Any]? = nil, brand: ItemBrand? = nil, code: String? = nil, id: Double? = nil, image: [String]? = nil, l1Categories: [String]? = nil, l2Categories: [String]? = nil, l3CategoryName: String? = nil, name: String? = nil, sellerIdentifier: String? = nil, size: String? = nil, slugKey: String? = nil) { self.image = image @@ -81,6 +85,8 @@ public extension ApplicationClient.Order { self.size = size + self.attributes = attributes + } required public init(from decoder: Decoder) throws { @@ -218,6 +224,18 @@ public extension ApplicationClient.Order { } + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + } public func encode(to encoder: Encoder) throws { @@ -278,6 +296,11 @@ public extension ApplicationClient.Order { try? container.encodeIfPresent(size, forKey: .size) + + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + } } diff --git a/Sources/code/platform/Client/OrderPlatformClient.swift b/Sources/code/platform/Client/OrderPlatformClient.swift index 8d2c4ac88f..3bd1e3ecbc 100644 --- a/Sources/code/platform/Client/OrderPlatformClient.swift +++ b/Sources/code/platform/Client/OrderPlatformClient.swift @@ -2299,6 +2299,7 @@ if let value = shipmentId { **/ public func getOrderById( orderId: String, + myOrders: Bool?, onResponse: @escaping (_ response: OrderDetailsResponse?, _ error: FDKError?) -> Void ) { @@ -2310,6 +2311,13 @@ var xQuery: [String: Any] = [:] +if let value = myOrders { + + xQuery["my_orders"] = value + +} + + diff --git a/Sources/code/platform/Models/Cart/PickupStoreDetailCartPlatformModel.swift b/Sources/code/platform/Models/Cart/PickupStoreDetailCartPlatformModel.swift index 725bf5df48..189edd8b4c 100644 --- a/Sources/code/platform/Models/Cart/PickupStoreDetailCartPlatformModel.swift +++ b/Sources/code/platform/Models/Cart/PickupStoreDetailCartPlatformModel.swift @@ -34,6 +34,8 @@ public extension PlatformClient.ApplicationClient.Cart { public var id: Int? + public var storeManagerName: String? + public var name: String? public var storeCode: String? @@ -69,6 +71,8 @@ public extension PlatformClient.ApplicationClient.Cart { case id = "id" + case storeManagerName = "store_manager_name" + case name = "name" case storeCode = "store_code" @@ -83,7 +87,7 @@ public extension PlatformClient.ApplicationClient.Cart { } - public init(address: String? = nil, addressType: String? = nil, area: String? = nil, areaCode: String? = nil, areaCodeSlug: String? = nil, city: String? = nil, country: String? = nil, email: String? = nil, id: Int? = nil, landmark: String? = nil, name: String? = nil, phone: String? = nil, pincode: Int? = nil, state: String? = nil, storeCode: String? = nil, uid: Int? = nil) { + public init(address: String? = nil, addressType: String? = nil, area: String? = nil, areaCode: String? = nil, areaCodeSlug: String? = nil, city: String? = nil, country: String? = nil, email: String? = nil, id: Int? = nil, landmark: String? = nil, name: String? = nil, phone: String? = nil, pincode: Int? = nil, state: String? = nil, storeCode: String? = nil, storeManagerName: String? = nil, uid: Int? = nil) { self.country = country @@ -105,6 +109,8 @@ public extension PlatformClient.ApplicationClient.Cart { self.id = id + self.storeManagerName = storeManagerName + self.name = name self.storeCode = storeCode @@ -243,6 +249,18 @@ public extension PlatformClient.ApplicationClient.Cart { + do { + storeManagerName = try container.decode(String.self, forKey: .storeManagerName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + do { name = try container.decode(String.self, forKey: .name) @@ -371,6 +389,11 @@ public extension PlatformClient.ApplicationClient.Cart { + try? container.encodeIfPresent(storeManagerName, forKey: .storeManagerName) + + + + try? container.encodeIfPresent(name, forKey: .name) diff --git a/Sources/code/platform/Models/Catalog/ApplicationItemMetaCatalogPlatformModel.swift b/Sources/code/platform/Models/Catalog/ApplicationItemMetaCatalogPlatformModel.swift index 3e7a57fa68..ac7d939d59 100644 --- a/Sources/code/platform/Models/Catalog/ApplicationItemMetaCatalogPlatformModel.swift +++ b/Sources/code/platform/Models/Catalog/ApplicationItemMetaCatalogPlatformModel.swift @@ -26,6 +26,8 @@ public extension PlatformClient.Catalog { public var seo: ApplicationItemSEO? + public var sizePromotionThreshold: SizePromotionThreshold? + public enum CodingKeys: String, CodingKey { @@ -43,9 +45,11 @@ public extension PlatformClient.Catalog { case seo = "seo" + case sizePromotionThreshold = "size_promotion_threshold" + } - public init(altText: [String: Any]? = nil, isCod: Bool? = nil, isGift: Bool? = nil, moq: ApplicationItemMOQ? = nil, seo: ApplicationItemSEO? = nil, customJson: [String: Any]? = nil, customMeta: [MetaFields]? = nil) { + public init(altText: [String: Any]? = nil, isCod: Bool? = nil, isGift: Bool? = nil, moq: ApplicationItemMOQ? = nil, seo: ApplicationItemSEO? = nil, sizePromotionThreshold: SizePromotionThreshold? = nil, customJson: [String: Any]? = nil, customMeta: [MetaFields]? = nil) { self.customJson = customJson @@ -61,6 +65,8 @@ public extension PlatformClient.Catalog { self.seo = seo + self.sizePromotionThreshold = sizePromotionThreshold + } required public init(from decoder: Decoder) throws { @@ -150,6 +156,18 @@ public extension PlatformClient.Catalog { } + + do { + sizePromotionThreshold = try container.decode(SizePromotionThreshold.self, forKey: .sizePromotionThreshold) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + } public func encode(to encoder: Encoder) throws { @@ -190,6 +208,11 @@ public extension PlatformClient.Catalog { try? container.encodeIfPresent(seo, forKey: .seo) + + + try? container.encodeIfPresent(sizePromotionThreshold, forKey: .sizePromotionThreshold) + + } } @@ -220,6 +243,8 @@ public extension PlatformClient.ApplicationClient.Catalog { public var seo: ApplicationItemSEO? + public var sizePromotionThreshold: SizePromotionThreshold? + public enum CodingKeys: String, CodingKey { @@ -237,9 +262,11 @@ public extension PlatformClient.ApplicationClient.Catalog { case seo = "seo" + case sizePromotionThreshold = "size_promotion_threshold" + } - public init(altText: [String: Any]? = nil, isCod: Bool? = nil, isGift: Bool? = nil, moq: ApplicationItemMOQ? = nil, seo: ApplicationItemSEO? = nil, customJson: [String: Any]? = nil, customMeta: [MetaFields]? = nil) { + public init(altText: [String: Any]? = nil, isCod: Bool? = nil, isGift: Bool? = nil, moq: ApplicationItemMOQ? = nil, seo: ApplicationItemSEO? = nil, sizePromotionThreshold: SizePromotionThreshold? = nil, customJson: [String: Any]? = nil, customMeta: [MetaFields]? = nil) { self.customJson = customJson @@ -255,6 +282,8 @@ public extension PlatformClient.ApplicationClient.Catalog { self.seo = seo + self.sizePromotionThreshold = sizePromotionThreshold + } required public init(from decoder: Decoder) throws { @@ -344,6 +373,18 @@ public extension PlatformClient.ApplicationClient.Catalog { } + + do { + sizePromotionThreshold = try container.decode(SizePromotionThreshold.self, forKey: .sizePromotionThreshold) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + } public func encode(to encoder: Encoder) throws { @@ -384,6 +425,11 @@ public extension PlatformClient.ApplicationClient.Catalog { try? container.encodeIfPresent(seo, forKey: .seo) + + + try? container.encodeIfPresent(sizePromotionThreshold, forKey: .sizePromotionThreshold) + + } } diff --git a/Sources/code/platform/Models/Catalog/ApplicationItemSeoActionCatalogPlatformModel.swift b/Sources/code/platform/Models/Catalog/ApplicationItemSeoActionCatalogPlatformModel.swift new file mode 100644 index 0000000000..da58bb0743 --- /dev/null +++ b/Sources/code/platform/Models/Catalog/ApplicationItemSeoActionCatalogPlatformModel.swift @@ -0,0 +1,162 @@ + + +import Foundation + + +public extension PlatformClient.Catalog { + /* + Model: ApplicationItemSeoAction + Used By: Catalog + */ + + class ApplicationItemSeoAction: Codable { + + + public var page: [String: Any]? + + public var type: String? + + + public enum CodingKeys: String, CodingKey { + + case page = "page" + + case type = "type" + + } + + public init(page: [String: Any]? = nil, type: String? = nil) { + + self.page = page + + self.type = type + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + page = try container.decode([String: Any].self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(page, forKey: .page) + + + + + try? container.encodeIfPresent(type, forKey: .type) + + + } + + } +} + + + +public extension PlatformClient.ApplicationClient.Catalog { + /* + Model: ApplicationItemSeoAction + Used By: Catalog + */ + + class ApplicationItemSeoAction: Codable { + + + public var page: [String: Any]? + + public var type: String? + + + public enum CodingKeys: String, CodingKey { + + case page = "page" + + case type = "type" + + } + + public init(page: [String: Any]? = nil, type: String? = nil) { + + self.page = page + + self.type = type + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + page = try container.decode([String: Any].self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(page, forKey: .page) + + + + + try? container.encodeIfPresent(type, forKey: .type) + + + } + + } +} + + diff --git a/Sources/code/platform/Models/Catalog/ApplicationItemSeoBreadcrumbsCatalogPlatformModel.swift b/Sources/code/platform/Models/Catalog/ApplicationItemSeoBreadcrumbsCatalogPlatformModel.swift new file mode 100644 index 0000000000..0a1a5e7173 --- /dev/null +++ b/Sources/code/platform/Models/Catalog/ApplicationItemSeoBreadcrumbsCatalogPlatformModel.swift @@ -0,0 +1,162 @@ + + +import Foundation + + +public extension PlatformClient.Catalog { + /* + Model: ApplicationItemSeoBreadcrumbs + Used By: Catalog + */ + + class ApplicationItemSeoBreadcrumbs: Codable { + + + public var url: String? + + public var action: [ApplicationItemSeoAction]? + + + public enum CodingKeys: String, CodingKey { + + case url = "url" + + case action = "action" + + } + + public init(action: [ApplicationItemSeoAction]? = nil, url: String? = nil) { + + self.url = url + + self.action = action + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + action = try container.decode([ApplicationItemSeoAction].self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(url, forKey: .url) + + + + + try? container.encodeIfPresent(action, forKey: .action) + + + } + + } +} + + + +public extension PlatformClient.ApplicationClient.Catalog { + /* + Model: ApplicationItemSeoBreadcrumbs + Used By: Catalog + */ + + class ApplicationItemSeoBreadcrumbs: Codable { + + + public var url: String? + + public var action: [ApplicationItemSeoAction]? + + + public enum CodingKeys: String, CodingKey { + + case url = "url" + + case action = "action" + + } + + public init(action: [ApplicationItemSeoAction]? = nil, url: String? = nil) { + + self.url = url + + self.action = action + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + action = try container.decode([ApplicationItemSeoAction].self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(url, forKey: .url) + + + + + try? container.encodeIfPresent(action, forKey: .action) + + + } + + } +} + + diff --git a/Sources/code/platform/Models/Catalog/ApplicationItemSeoMetaTagItemCatalogPlatformModel.swift b/Sources/code/platform/Models/Catalog/ApplicationItemSeoMetaTagItemCatalogPlatformModel.swift new file mode 100644 index 0000000000..f49feba6b8 --- /dev/null +++ b/Sources/code/platform/Models/Catalog/ApplicationItemSeoMetaTagItemCatalogPlatformModel.swift @@ -0,0 +1,162 @@ + + +import Foundation + + +public extension PlatformClient.Catalog { + /* + Model: ApplicationItemSeoMetaTagItem + Used By: Catalog + */ + + class ApplicationItemSeoMetaTagItem: Codable { + + + public var key: String? + + public var value: String? + + + public enum CodingKeys: String, CodingKey { + + case key = "key" + + case value = "value" + + } + + public init(key: String? = nil, value: String? = nil) { + + self.key = key + + self.value = value + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(key, forKey: .key) + + + + + try? container.encodeIfPresent(value, forKey: .value) + + + } + + } +} + + + +public extension PlatformClient.ApplicationClient.Catalog { + /* + Model: ApplicationItemSeoMetaTagItem + Used By: Catalog + */ + + class ApplicationItemSeoMetaTagItem: Codable { + + + public var key: String? + + public var value: String? + + + public enum CodingKeys: String, CodingKey { + + case key = "key" + + case value = "value" + + } + + public init(key: String? = nil, value: String? = nil) { + + self.key = key + + self.value = value + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(key, forKey: .key) + + + + + try? container.encodeIfPresent(value, forKey: .value) + + + } + + } +} + + diff --git a/Sources/code/platform/Models/Catalog/ApplicationItemSeoMetaTagsCatalogPlatformModel.swift b/Sources/code/platform/Models/Catalog/ApplicationItemSeoMetaTagsCatalogPlatformModel.swift new file mode 100644 index 0000000000..e5fa3b3e95 --- /dev/null +++ b/Sources/code/platform/Models/Catalog/ApplicationItemSeoMetaTagsCatalogPlatformModel.swift @@ -0,0 +1,162 @@ + + +import Foundation + + +public extension PlatformClient.Catalog { + /* + Model: ApplicationItemSeoMetaTags + Used By: Catalog + */ + + class ApplicationItemSeoMetaTags: Codable { + + + public var title: String? + + public var items: [ApplicationItemSeoMetaTagItem]? + + + public enum CodingKeys: String, CodingKey { + + case title = "title" + + case items = "items" + + } + + public init(items: [ApplicationItemSeoMetaTagItem]? = nil, title: String? = nil) { + + self.title = title + + self.items = items + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + items = try container.decode([ApplicationItemSeoMetaTagItem].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(title, forKey: .title) + + + + + try? container.encodeIfPresent(items, forKey: .items) + + + } + + } +} + + + +public extension PlatformClient.ApplicationClient.Catalog { + /* + Model: ApplicationItemSeoMetaTags + Used By: Catalog + */ + + class ApplicationItemSeoMetaTags: Codable { + + + public var title: String? + + public var items: [ApplicationItemSeoMetaTagItem]? + + + public enum CodingKeys: String, CodingKey { + + case title = "title" + + case items = "items" + + } + + public init(items: [ApplicationItemSeoMetaTagItem]? = nil, title: String? = nil) { + + self.title = title + + self.items = items + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + items = try container.decode([ApplicationItemSeoMetaTagItem].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(title, forKey: .title) + + + + + try? container.encodeIfPresent(items, forKey: .items) + + + } + + } +} + + diff --git a/Sources/code/platform/Models/Catalog/MetatagsCatalogPlatformModel.swift b/Sources/code/platform/Models/Catalog/MetatagsCatalogPlatformModel.swift new file mode 100644 index 0000000000..656d6e1e68 --- /dev/null +++ b/Sources/code/platform/Models/Catalog/MetatagsCatalogPlatformModel.swift @@ -0,0 +1,162 @@ + + +import Foundation + + +public extension PlatformClient.Catalog { + /* + Model: Metatags + Used By: Catalog + */ + + class Metatags: Codable { + + + public var title: String? + + public var items: [ApplicationItemSeoMetaTags]? + + + public enum CodingKeys: String, CodingKey { + + case title = "title" + + case items = "items" + + } + + public init(items: [ApplicationItemSeoMetaTags]? = nil, title: String? = nil) { + + self.title = title + + self.items = items + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + items = try container.decode([ApplicationItemSeoMetaTags].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(title, forKey: .title) + + + + + try? container.encodeIfPresent(items, forKey: .items) + + + } + + } +} + + + +public extension PlatformClient.ApplicationClient.Catalog { + /* + Model: Metatags + Used By: Catalog + */ + + class Metatags: Codable { + + + public var title: String? + + public var items: [ApplicationItemSeoMetaTags]? + + + public enum CodingKeys: String, CodingKey { + + case title = "title" + + case items = "items" + + } + + public init(items: [ApplicationItemSeoMetaTags]? = nil, title: String? = nil) { + + self.title = title + + self.items = items + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + items = try container.decode([ApplicationItemSeoMetaTags].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(title, forKey: .title) + + + + + try? container.encodeIfPresent(items, forKey: .items) + + + } + + } +} + + diff --git a/Sources/code/platform/Models/Catalog/SEODataCatalogPlatformModel.swift b/Sources/code/platform/Models/Catalog/SEODataCatalogPlatformModel.swift index d6b62734e4..e909686ff8 100644 --- a/Sources/code/platform/Models/Catalog/SEODataCatalogPlatformModel.swift +++ b/Sources/code/platform/Models/Catalog/SEODataCatalogPlatformModel.swift @@ -16,6 +16,12 @@ public extension PlatformClient.Catalog { public var title: String? + public var sitemap: Sitemap? + + public var breadcrumbs: [ApplicationItemSeoBreadcrumbs]? + + public var metaTags: [Metatags]? + public enum CodingKeys: String, CodingKey { @@ -23,14 +29,26 @@ public extension PlatformClient.Catalog { case title = "title" + case sitemap = "sitemap" + + case breadcrumbs = "breadcrumbs" + + case metaTags = "meta_tags" + } - public init(description: String? = nil, title: String? = nil) { + public init(breadcrumbs: [ApplicationItemSeoBreadcrumbs]? = nil, description: String? = nil, metaTags: [Metatags]? = nil, sitemap: Sitemap? = nil, title: String? = nil) { self.description = description self.title = title + self.sitemap = sitemap + + self.breadcrumbs = breadcrumbs + + self.metaTags = metaTags + } required public init(from decoder: Decoder) throws { @@ -60,6 +78,42 @@ public extension PlatformClient.Catalog { } + + do { + sitemap = try container.decode(Sitemap.self, forKey: .sitemap) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + breadcrumbs = try container.decode([ApplicationItemSeoBreadcrumbs].self, forKey: .breadcrumbs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + metaTags = try container.decode([Metatags].self, forKey: .metaTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + } public func encode(to encoder: Encoder) throws { @@ -75,6 +129,21 @@ public extension PlatformClient.Catalog { try? container.encodeIfPresent(title, forKey: .title) + + + try? container.encodeIfPresent(sitemap, forKey: .sitemap) + + + + + try? container.encodeIfPresent(breadcrumbs, forKey: .breadcrumbs) + + + + + try? container.encodeIfPresent(metaTags, forKey: .metaTags) + + } } @@ -95,6 +164,12 @@ public extension PlatformClient.ApplicationClient.Catalog { public var title: String? + public var sitemap: Sitemap? + + public var breadcrumbs: [ApplicationItemSeoBreadcrumbs]? + + public var metaTags: [Metatags]? + public enum CodingKeys: String, CodingKey { @@ -102,14 +177,26 @@ public extension PlatformClient.ApplicationClient.Catalog { case title = "title" + case sitemap = "sitemap" + + case breadcrumbs = "breadcrumbs" + + case metaTags = "meta_tags" + } - public init(description: String? = nil, title: String? = nil) { + public init(breadcrumbs: [ApplicationItemSeoBreadcrumbs]? = nil, description: String? = nil, metaTags: [Metatags]? = nil, sitemap: Sitemap? = nil, title: String? = nil) { self.description = description self.title = title + self.sitemap = sitemap + + self.breadcrumbs = breadcrumbs + + self.metaTags = metaTags + } required public init(from decoder: Decoder) throws { @@ -139,6 +226,42 @@ public extension PlatformClient.ApplicationClient.Catalog { } + + do { + sitemap = try container.decode(Sitemap.self, forKey: .sitemap) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + breadcrumbs = try container.decode([ApplicationItemSeoBreadcrumbs].self, forKey: .breadcrumbs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + metaTags = try container.decode([Metatags].self, forKey: .metaTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + } public func encode(to encoder: Encoder) throws { @@ -154,6 +277,21 @@ public extension PlatformClient.ApplicationClient.Catalog { try? container.encodeIfPresent(title, forKey: .title) + + + try? container.encodeIfPresent(sitemap, forKey: .sitemap) + + + + + try? container.encodeIfPresent(breadcrumbs, forKey: .breadcrumbs) + + + + + try? container.encodeIfPresent(metaTags, forKey: .metaTags) + + } } diff --git a/Sources/code/platform/Models/Catalog/SeoDetailCatalogPlatformModel.swift b/Sources/code/platform/Models/Catalog/SeoDetailCatalogPlatformModel.swift index cb9d89a54f..5273eebb1d 100644 --- a/Sources/code/platform/Models/Catalog/SeoDetailCatalogPlatformModel.swift +++ b/Sources/code/platform/Models/Catalog/SeoDetailCatalogPlatformModel.swift @@ -16,6 +16,12 @@ public extension PlatformClient.Catalog { public var title: String? + public var sitemap: [String: Any]? + + public var breadcrumbs: [ApplicationItemSeoBreadcrumbs]? + + public var metaTags: [Metatags]? + public enum CodingKeys: String, CodingKey { @@ -23,14 +29,26 @@ public extension PlatformClient.Catalog { case title = "title" + case sitemap = "sitemap" + + case breadcrumbs = "breadcrumbs" + + case metaTags = "meta_tags" + } - public init(description: String? = nil, title: String? = nil) { + public init(breadcrumbs: [ApplicationItemSeoBreadcrumbs]? = nil, description: String? = nil, metaTags: [Metatags]? = nil, sitemap: [String: Any]? = nil, title: String? = nil) { self.description = description self.title = title + self.sitemap = sitemap + + self.breadcrumbs = breadcrumbs + + self.metaTags = metaTags + } required public init(from decoder: Decoder) throws { @@ -60,6 +78,42 @@ public extension PlatformClient.Catalog { } + + do { + sitemap = try container.decode([String: Any].self, forKey: .sitemap) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + breadcrumbs = try container.decode([ApplicationItemSeoBreadcrumbs].self, forKey: .breadcrumbs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + metaTags = try container.decode([Metatags].self, forKey: .metaTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + } public func encode(to encoder: Encoder) throws { @@ -75,6 +129,21 @@ public extension PlatformClient.Catalog { try? container.encodeIfPresent(title, forKey: .title) + + + try? container.encodeIfPresent(sitemap, forKey: .sitemap) + + + + + try? container.encodeIfPresent(breadcrumbs, forKey: .breadcrumbs) + + + + + try? container.encodeIfPresent(metaTags, forKey: .metaTags) + + } } @@ -95,6 +164,12 @@ public extension PlatformClient.ApplicationClient.Catalog { public var title: String? + public var sitemap: [String: Any]? + + public var breadcrumbs: [ApplicationItemSeoBreadcrumbs]? + + public var metaTags: [Metatags]? + public enum CodingKeys: String, CodingKey { @@ -102,14 +177,26 @@ public extension PlatformClient.ApplicationClient.Catalog { case title = "title" + case sitemap = "sitemap" + + case breadcrumbs = "breadcrumbs" + + case metaTags = "meta_tags" + } - public init(description: String? = nil, title: String? = nil) { + public init(breadcrumbs: [ApplicationItemSeoBreadcrumbs]? = nil, description: String? = nil, metaTags: [Metatags]? = nil, sitemap: [String: Any]? = nil, title: String? = nil) { self.description = description self.title = title + self.sitemap = sitemap + + self.breadcrumbs = breadcrumbs + + self.metaTags = metaTags + } required public init(from decoder: Decoder) throws { @@ -139,6 +226,42 @@ public extension PlatformClient.ApplicationClient.Catalog { } + + do { + sitemap = try container.decode([String: Any].self, forKey: .sitemap) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + breadcrumbs = try container.decode([ApplicationItemSeoBreadcrumbs].self, forKey: .breadcrumbs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + metaTags = try container.decode([Metatags].self, forKey: .metaTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + } public func encode(to encoder: Encoder) throws { @@ -154,6 +277,21 @@ public extension PlatformClient.ApplicationClient.Catalog { try? container.encodeIfPresent(title, forKey: .title) + + + try? container.encodeIfPresent(sitemap, forKey: .sitemap) + + + + + try? container.encodeIfPresent(breadcrumbs, forKey: .breadcrumbs) + + + + + try? container.encodeIfPresent(metaTags, forKey: .metaTags) + + } } diff --git a/Sources/code/platform/Models/Catalog/SitemapCatalogPlatformModel.swift b/Sources/code/platform/Models/Catalog/SitemapCatalogPlatformModel.swift new file mode 100644 index 0000000000..5e2879cdd0 --- /dev/null +++ b/Sources/code/platform/Models/Catalog/SitemapCatalogPlatformModel.swift @@ -0,0 +1,162 @@ + + +import Foundation + + +public extension PlatformClient.Catalog { + /* + Model: Sitemap + Used By: Catalog + */ + + class Sitemap: Codable { + + + public var priority: Double? + + public var frequency: String? + + + public enum CodingKeys: String, CodingKey { + + case priority = "priority" + + case frequency = "frequency" + + } + + public init(frequency: String? = nil, priority: Double? = nil) { + + self.priority = priority + + self.frequency = frequency + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + priority = try container.decode(Double.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + frequency = try container.decode(String.self, forKey: .frequency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(priority, forKey: .priority) + + + + + try? container.encodeIfPresent(frequency, forKey: .frequency) + + + } + + } +} + + + +public extension PlatformClient.ApplicationClient.Catalog { + /* + Model: Sitemap + Used By: Catalog + */ + + class Sitemap: Codable { + + + public var priority: Double? + + public var frequency: String? + + + public enum CodingKeys: String, CodingKey { + + case priority = "priority" + + case frequency = "frequency" + + } + + public init(frequency: String? = nil, priority: Double? = nil) { + + self.priority = priority + + self.frequency = frequency + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + priority = try container.decode(Double.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + frequency = try container.decode(String.self, forKey: .frequency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(priority, forKey: .priority) + + + + + try? container.encodeIfPresent(frequency, forKey: .frequency) + + + } + + } +} + + diff --git a/Sources/code/platform/Models/Catalog/SizePromotionThresholdCatalogPlatformModel.swift b/Sources/code/platform/Models/Catalog/SizePromotionThresholdCatalogPlatformModel.swift new file mode 100644 index 0000000000..89b9099fd9 --- /dev/null +++ b/Sources/code/platform/Models/Catalog/SizePromotionThresholdCatalogPlatformModel.swift @@ -0,0 +1,162 @@ + + +import Foundation + + +public extension PlatformClient.Catalog { + /* + Model: SizePromotionThreshold + Used By: Catalog + */ + + class SizePromotionThreshold: Codable { + + + public var thresholdType: String? + + public var thresholdValue: Int? + + + public enum CodingKeys: String, CodingKey { + + case thresholdType = "threshold_type" + + case thresholdValue = "threshold_value" + + } + + public init(thresholdType: String? = nil, thresholdValue: Int? = nil) { + + self.thresholdType = thresholdType + + self.thresholdValue = thresholdValue + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + thresholdType = try container.decode(String.self, forKey: .thresholdType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + thresholdValue = try container.decode(Int.self, forKey: .thresholdValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(thresholdType, forKey: .thresholdType) + + + + + try? container.encodeIfPresent(thresholdValue, forKey: .thresholdValue) + + + } + + } +} + + + +public extension PlatformClient.ApplicationClient.Catalog { + /* + Model: SizePromotionThreshold + Used By: Catalog + */ + + class SizePromotionThreshold: Codable { + + + public var thresholdType: String? + + public var thresholdValue: Int? + + + public enum CodingKeys: String, CodingKey { + + case thresholdType = "threshold_type" + + case thresholdValue = "threshold_value" + + } + + public init(thresholdType: String? = nil, thresholdValue: Int? = nil) { + + self.thresholdType = thresholdType + + self.thresholdValue = thresholdValue + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + thresholdType = try container.decode(String.self, forKey: .thresholdType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + thresholdValue = try container.decode(Int.self, forKey: .thresholdValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(thresholdType, forKey: .thresholdType) + + + + + try? container.encodeIfPresent(thresholdValue, forKey: .thresholdValue) + + + } + + } +} + + diff --git a/Sources/code/platform/Models/Discount/FileJobResponseDiscountPlatformModel.swift b/Sources/code/platform/Models/Discount/FileJobResponseDiscountPlatformModel.swift index 1632216f19..0f0615061c 100644 --- a/Sources/code/platform/Models/Discount/FileJobResponseDiscountPlatformModel.swift +++ b/Sources/code/platform/Models/Discount/FileJobResponseDiscountPlatformModel.swift @@ -28,6 +28,8 @@ public extension PlatformClient.Discount { public var id: String + public var filePath: String + public enum CodingKeys: String, CodingKey { @@ -47,9 +49,11 @@ public extension PlatformClient.Discount { case id = "_id" + case filePath = "file_path" + } - public init(body: [String: Any]? = nil, companyId: Int, failed: Int, fileType: String, stage: String, total: Int, type: String, id: String) { + public init(body: [String: Any]? = nil, companyId: Int, failed: Int, filePath: String, fileType: String, stage: String, total: Int, type: String, id: String) { self.stage = stage @@ -67,6 +71,8 @@ public extension PlatformClient.Discount { self.id = id + self.filePath = filePath + } required public init(from decoder: Decoder) throws { @@ -119,6 +125,11 @@ public extension PlatformClient.Discount { + + filePath = try container.decode(String.self, forKey: .filePath) + + + } public func encode(to encoder: Encoder) throws { @@ -164,6 +175,11 @@ public extension PlatformClient.Discount { try? container.encodeIfPresent(id, forKey: .id) + + + try? container.encodeIfPresent(filePath, forKey: .filePath) + + } } diff --git a/Sources/code/platform/Models/Order/CreateOrderAPIOrderPlatformModel.swift b/Sources/code/platform/Models/Order/CreateOrderAPIOrderPlatformModel.swift index 4308b0c513..ca046f8a1b 100644 --- a/Sources/code/platform/Models/Order/CreateOrderAPIOrderPlatformModel.swift +++ b/Sources/code/platform/Models/Order/CreateOrderAPIOrderPlatformModel.swift @@ -34,6 +34,8 @@ public extension PlatformClient.Order { public var paymentInfo: PaymentInfo + public var userInfo: UserInfo + public enum CodingKeys: String, CodingKey { @@ -59,9 +61,11 @@ public extension PlatformClient.Order { case paymentInfo = "payment_info" + case userInfo = "user_info" + } - public init(billingInfo: BillingInfo, charges: [Charge]? = nil, config: [String: Any]? = nil, currencyInfo: [String: Any]? = nil, externalCreationDate: String? = nil, externalOrderId: String? = nil, meta: [String: Any]? = nil, paymentInfo: PaymentInfo, shipments: [Shipment], shippingInfo: ShippingInfo, taxInfo: TaxInfo? = nil) { + public init(billingInfo: BillingInfo, charges: [Charge]? = nil, config: [String: Any]? = nil, currencyInfo: [String: Any]? = nil, externalCreationDate: String? = nil, externalOrderId: String? = nil, meta: [String: Any]? = nil, paymentInfo: PaymentInfo, shipments: [Shipment], shippingInfo: ShippingInfo, taxInfo: TaxInfo? = nil, userInfo: UserInfo) { self.shipments = shipments @@ -85,6 +89,8 @@ public extension PlatformClient.Order { self.paymentInfo = paymentInfo + self.userInfo = userInfo + } required public init(from decoder: Decoder) throws { @@ -194,6 +200,11 @@ public extension PlatformClient.Order { + + userInfo = try container.decode(UserInfo.self, forKey: .userInfo) + + + } public func encode(to encoder: Encoder) throws { @@ -254,6 +265,11 @@ public extension PlatformClient.Order { try? container.encodeIfPresent(paymentInfo, forKey: .paymentInfo) + + + try? container.encodeIfPresent(userInfo, forKey: .userInfo) + + } } @@ -292,6 +308,8 @@ public extension PlatformClient.ApplicationClient.Order { public var paymentInfo: PaymentInfo + public var userInfo: UserInfo + public enum CodingKeys: String, CodingKey { @@ -317,9 +335,11 @@ public extension PlatformClient.ApplicationClient.Order { case paymentInfo = "payment_info" + case userInfo = "user_info" + } - public init(billingInfo: BillingInfo, charges: [Charge]? = nil, config: [String: Any]? = nil, currencyInfo: [String: Any]? = nil, externalCreationDate: String? = nil, externalOrderId: String? = nil, meta: [String: Any]? = nil, paymentInfo: PaymentInfo, shipments: [Shipment], shippingInfo: ShippingInfo, taxInfo: TaxInfo? = nil) { + public init(billingInfo: BillingInfo, charges: [Charge]? = nil, config: [String: Any]? = nil, currencyInfo: [String: Any]? = nil, externalCreationDate: String? = nil, externalOrderId: String? = nil, meta: [String: Any]? = nil, paymentInfo: PaymentInfo, shipments: [Shipment], shippingInfo: ShippingInfo, taxInfo: TaxInfo? = nil, userInfo: UserInfo) { self.shipments = shipments @@ -343,6 +363,8 @@ public extension PlatformClient.ApplicationClient.Order { self.paymentInfo = paymentInfo + self.userInfo = userInfo + } required public init(from decoder: Decoder) throws { @@ -452,6 +474,11 @@ public extension PlatformClient.ApplicationClient.Order { + + userInfo = try container.decode(UserInfo.self, forKey: .userInfo) + + + } public func encode(to encoder: Encoder) throws { @@ -512,6 +539,11 @@ public extension PlatformClient.ApplicationClient.Order { try? container.encodeIfPresent(paymentInfo, forKey: .paymentInfo) + + + try? container.encodeIfPresent(userInfo, forKey: .userInfo) + + } } diff --git a/Sources/code/platform/Models/Order/ShipmentOrderPlatformModel.swift b/Sources/code/platform/Models/Order/ShipmentOrderPlatformModel.swift index 73c595772d..7819a3b0b4 100644 --- a/Sources/code/platform/Models/Order/ShipmentOrderPlatformModel.swift +++ b/Sources/code/platform/Models/Order/ShipmentOrderPlatformModel.swift @@ -24,6 +24,8 @@ public extension PlatformClient.Order { public var locationId: Int + public var orderType: String? + public enum CodingKeys: String, CodingKey { @@ -39,9 +41,11 @@ public extension PlatformClient.Order { case locationId = "location_id" + case orderType = "order_type" + } - public init(externalShipmentId: String? = nil, lineItems: [LineItem], locationId: Int, meta: [String: Any]? = nil, priority: Int? = nil, processingDates: ProcessingDates? = nil) { + public init(externalShipmentId: String? = nil, lineItems: [LineItem], locationId: Int, meta: [String: Any]? = nil, orderType: String? = nil, priority: Int? = nil, processingDates: ProcessingDates? = nil) { self.lineItems = lineItems @@ -55,6 +59,8 @@ public extension PlatformClient.Order { self.locationId = locationId + self.orderType = orderType + } required public init(from decoder: Decoder) throws { @@ -118,6 +124,18 @@ public extension PlatformClient.Order { + + do { + orderType = try container.decode(String.self, forKey: .orderType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + } public func encode(to encoder: Encoder) throws { @@ -153,6 +171,11 @@ public extension PlatformClient.Order { try? container.encodeIfPresent(locationId, forKey: .locationId) + + + try? container.encodeIfPresent(orderType, forKey: .orderType) + + } } @@ -181,6 +204,8 @@ public extension PlatformClient.ApplicationClient.Order { public var locationId: Int + public var orderType: String? + public enum CodingKeys: String, CodingKey { @@ -196,9 +221,11 @@ public extension PlatformClient.ApplicationClient.Order { case locationId = "location_id" + case orderType = "order_type" + } - public init(externalShipmentId: String? = nil, lineItems: [LineItem], locationId: Int, meta: [String: Any]? = nil, priority: Int? = nil, processingDates: ProcessingDates? = nil) { + public init(externalShipmentId: String? = nil, lineItems: [LineItem], locationId: Int, meta: [String: Any]? = nil, orderType: String? = nil, priority: Int? = nil, processingDates: ProcessingDates? = nil) { self.lineItems = lineItems @@ -212,6 +239,8 @@ public extension PlatformClient.ApplicationClient.Order { self.locationId = locationId + self.orderType = orderType + } required public init(from decoder: Decoder) throws { @@ -275,6 +304,18 @@ public extension PlatformClient.ApplicationClient.Order { + + do { + orderType = try container.decode(String.self, forKey: .orderType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + } public func encode(to encoder: Encoder) throws { @@ -310,6 +351,11 @@ public extension PlatformClient.ApplicationClient.Order { try? container.encodeIfPresent(locationId, forKey: .locationId) + + + try? container.encodeIfPresent(orderType, forKey: .orderType) + + } } diff --git a/Sources/code/platform/Models/Order/ShipmentStatusDataOrderPlatformModel.swift b/Sources/code/platform/Models/Order/ShipmentStatusDataOrderPlatformModel.swift index 2b955b1bf0..c0639d1a18 100644 --- a/Sources/code/platform/Models/Order/ShipmentStatusDataOrderPlatformModel.swift +++ b/Sources/code/platform/Models/Order/ShipmentStatusDataOrderPlatformModel.swift @@ -26,6 +26,8 @@ public extension PlatformClient.Order { public var displayName: String? + public var currentShipmentStatus: String? + public enum CodingKeys: String, CodingKey { @@ -43,9 +45,11 @@ public extension PlatformClient.Order { case displayName = "display_name" + case currentShipmentStatus = "current_shipment_status" + } - public init(bagList: [String]? = nil, createdAt: String? = nil, displayName: String? = nil, id: Int? = nil, meta: [String: Any]? = nil, shipmentId: String? = nil, status: String? = nil) { + public init(bagList: [String]? = nil, createdAt: String? = nil, currentShipmentStatus: String? = nil, displayName: String? = nil, id: Int? = nil, meta: [String: Any]? = nil, shipmentId: String? = nil, status: String? = nil) { self.meta = meta @@ -61,6 +65,8 @@ public extension PlatformClient.Order { self.displayName = displayName + self.currentShipmentStatus = currentShipmentStatus + } required public init(from decoder: Decoder) throws { @@ -150,6 +156,18 @@ public extension PlatformClient.Order { } + + do { + currentShipmentStatus = try container.decode(String.self, forKey: .currentShipmentStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + } public func encode(to encoder: Encoder) throws { @@ -190,6 +208,11 @@ public extension PlatformClient.Order { try? container.encode(displayName, forKey: .displayName) + + + try? container.encode(currentShipmentStatus, forKey: .currentShipmentStatus) + + } } @@ -220,6 +243,8 @@ public extension PlatformClient.ApplicationClient.Order { public var displayName: String? + public var currentShipmentStatus: String? + public enum CodingKeys: String, CodingKey { @@ -237,9 +262,11 @@ public extension PlatformClient.ApplicationClient.Order { case displayName = "display_name" + case currentShipmentStatus = "current_shipment_status" + } - public init(bagList: [String]? = nil, createdAt: String? = nil, displayName: String? = nil, id: Int? = nil, meta: [String: Any]? = nil, shipmentId: String? = nil, status: String? = nil) { + public init(bagList: [String]? = nil, createdAt: String? = nil, currentShipmentStatus: String? = nil, displayName: String? = nil, id: Int? = nil, meta: [String: Any]? = nil, shipmentId: String? = nil, status: String? = nil) { self.meta = meta @@ -255,6 +282,8 @@ public extension PlatformClient.ApplicationClient.Order { self.displayName = displayName + self.currentShipmentStatus = currentShipmentStatus + } required public init(from decoder: Decoder) throws { @@ -344,6 +373,18 @@ public extension PlatformClient.ApplicationClient.Order { } + + do { + currentShipmentStatus = try container.decode(String.self, forKey: .currentShipmentStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + } public func encode(to encoder: Encoder) throws { @@ -384,6 +425,11 @@ public extension PlatformClient.ApplicationClient.Order { try? container.encode(displayName, forKey: .displayName) + + + try? container.encode(currentShipmentStatus, forKey: .currentShipmentStatus) + + } } diff --git a/Sources/code/platform/Models/Order/UserInfoOrderPlatformModel.swift b/Sources/code/platform/Models/Order/UserInfoOrderPlatformModel.swift new file mode 100644 index 0000000000..c41113e8ec --- /dev/null +++ b/Sources/code/platform/Models/Order/UserInfoOrderPlatformModel.swift @@ -0,0 +1,350 @@ + + +import Foundation + + +public extension PlatformClient.Order { + /* + Model: UserInfo + Used By: Order + */ + + class UserInfo: Codable { + + + public var userId: String? + + public var userType: String? + + public var email: String + + public var gender: String? + + public var firstName: String + + public var lastName: String? + + public var mobile: String + + + public enum CodingKeys: String, CodingKey { + + case userId = "user_id" + + case userType = "user_type" + + case email = "email" + + case gender = "gender" + + case firstName = "first_name" + + case lastName = "last_name" + + case mobile = "mobile" + + } + + public init(email: String, firstName: String, gender: String? = nil, lastName: String? = nil, mobile: String, userId: String? = nil, userType: String? = nil) { + + self.userId = userId + + self.userType = userType + + self.email = email + + self.gender = gender + + self.firstName = firstName + + self.lastName = lastName + + self.mobile = mobile + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + userType = try container.decode(String.self, forKey: .userType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + email = try container.decode(String.self, forKey: .email) + + + + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + firstName = try container.decode(String.self, forKey: .firstName) + + + + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + mobile = try container.decode(String.self, forKey: .mobile) + + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(userId, forKey: .userId) + + + + + try? container.encodeIfPresent(userType, forKey: .userType) + + + + + try? container.encodeIfPresent(email, forKey: .email) + + + + + try? container.encodeIfPresent(gender, forKey: .gender) + + + + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + + + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + + + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + + } + + } +} + + + +public extension PlatformClient.ApplicationClient.Order { + /* + Model: UserInfo + Used By: Order + */ + + class UserInfo: Codable { + + + public var userId: String? + + public var userType: String? + + public var email: String + + public var gender: String? + + public var firstName: String + + public var lastName: String? + + public var mobile: String + + + public enum CodingKeys: String, CodingKey { + + case userId = "user_id" + + case userType = "user_type" + + case email = "email" + + case gender = "gender" + + case firstName = "first_name" + + case lastName = "last_name" + + case mobile = "mobile" + + } + + public init(email: String, firstName: String, gender: String? = nil, lastName: String? = nil, mobile: String, userId: String? = nil, userType: String? = nil) { + + self.userId = userId + + self.userType = userType + + self.email = email + + self.gender = gender + + self.firstName = firstName + + self.lastName = lastName + + self.mobile = mobile + + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + do { + userType = try container.decode(String.self, forKey: .userType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + email = try container.decode(String.self, forKey: .email) + + + + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + firstName = try container.decode(String.self, forKey: .firstName) + + + + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + mobile = try container.decode(String.self, forKey: .mobile) + + + + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + + + try? container.encodeIfPresent(userId, forKey: .userId) + + + + + try? container.encodeIfPresent(userType, forKey: .userType) + + + + + try? container.encodeIfPresent(email, forKey: .email) + + + + + try? container.encodeIfPresent(gender, forKey: .gender) + + + + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + + + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + + + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + + } + + } +} + + diff --git a/Sources/code/platform/Models/Payment/AddressDetailPaymentPlatformModel.swift b/Sources/code/platform/Models/Payment/AddressDetailPaymentPlatformModel.swift index d25b8663ff..50fdfba7b5 100644 --- a/Sources/code/platform/Models/Payment/AddressDetailPaymentPlatformModel.swift +++ b/Sources/code/platform/Models/Payment/AddressDetailPaymentPlatformModel.swift @@ -12,126 +12,126 @@ public extension PlatformClient.Payment { class AddressDetail: Codable { - public var countryIsoCode: String - public var googleMapPoint: [String: Any]? - public var country: String - - public var email: String? - - public var areaCode: String - - public var city: String + public var landmark: String? public var phone: String - public var expireAt: String? + public var countryIsoCode: String - public var address: String + public var areaCode: String - public var gAddressId: String + public var country: String - public var tags: [[String: Any]]? + public var expireAt: String? - public var name: String + public var geoLocation: [String: Any]? public var state: String - public var landmark: String? - public var area: String + public var gAddressId: String + public var areaCodeSlug: String + public var countryPhoneCode: String + + public var name: String + public var addressType: String - public var countryPhoneCode: String + public var address: String - public var geoLocation: [String: Any]? + public var email: String? + + public var city: String + + public var tags: [[String: Any]]? public enum CodingKeys: String, CodingKey { - case countryIsoCode = "country_iso_code" - case googleMapPoint = "google_map_point" - case country = "country" - - case email = "email" - - case areaCode = "area_code" - - case city = "city" + case landmark = "landmark" case phone = "phone" - case expireAt = "expire_at" + case countryIsoCode = "country_iso_code" - case address = "address" + case areaCode = "area_code" - case gAddressId = "g_address_id" + case country = "country" - case tags = "tags" + case expireAt = "expire_at" - case name = "name" + case geoLocation = "geo_location" case state = "state" - case landmark = "landmark" - case area = "area" + case gAddressId = "g_address_id" + case areaCodeSlug = "area_code_slug" + case countryPhoneCode = "country_phone_code" + + case name = "name" + case addressType = "address_type" - case countryPhoneCode = "country_phone_code" + case address = "address" - case geoLocation = "geo_location" + case email = "email" + + case city = "city" + + case tags = "tags" } public init(address: String, addressType: String, area: String, areaCode: String, areaCodeSlug: String, city: String, country: String, countryIsoCode: String, countryPhoneCode: String, email: String? = nil, expireAt: String? = nil, geoLocation: [String: Any]? = nil, googleMapPoint: [String: Any]? = nil, gAddressId: String, landmark: String? = nil, name: String, phone: String, state: String, tags: [[String: Any]]? = nil) { - self.countryIsoCode = countryIsoCode - self.googleMapPoint = googleMapPoint - self.country = country - - self.email = email - - self.areaCode = areaCode - - self.city = city + self.landmark = landmark self.phone = phone - self.expireAt = expireAt + self.countryIsoCode = countryIsoCode - self.address = address + self.areaCode = areaCode - self.gAddressId = gAddressId + self.country = country - self.tags = tags + self.expireAt = expireAt - self.name = name + self.geoLocation = geoLocation self.state = state - self.landmark = landmark - self.area = area + self.gAddressId = gAddressId + self.areaCodeSlug = areaCodeSlug + self.countryPhoneCode = countryPhoneCode + + self.name = name + self.addressType = addressType - self.countryPhoneCode = countryPhoneCode + self.address = address - self.geoLocation = geoLocation + self.email = email + + self.city = city + + self.tags = tags } @@ -139,11 +139,6 @@ public extension PlatformClient.Payment { let container = try decoder.container(keyedBy: CodingKeys.self) - countryIsoCode = try container.decode(String.self, forKey: .countryIsoCode) - - - - do { googleMapPoint = try container.decode([String: Any].self, forKey: .googleMapPoint) @@ -156,13 +151,8 @@ public extension PlatformClient.Payment { - country = try container.decode(String.self, forKey: .country) - - - - do { - email = try container.decode(String.self, forKey: .email) + landmark = try container.decode(String.self, forKey: .landmark) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -173,17 +163,22 @@ public extension PlatformClient.Payment { - areaCode = try container.decode(String.self, forKey: .areaCode) + phone = try container.decode(String.self, forKey: .phone) - city = try container.decode(String.self, forKey: .city) + countryIsoCode = try container.decode(String.self, forKey: .countryIsoCode) - phone = try container.decode(String.self, forKey: .phone) + areaCode = try container.decode(String.self, forKey: .areaCode) + + + + + country = try container.decode(String.self, forKey: .country) @@ -200,18 +195,8 @@ public extension PlatformClient.Payment { - address = try container.decode(String.self, forKey: .address) - - - - - gAddressId = try container.decode(String.self, forKey: .gAddressId) - - - - do { - tags = try container.decode([[String: Any]].self, forKey: .tags) + geoLocation = try container.decode([String: Any].self, forKey: .geoLocation) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -222,34 +207,32 @@ public extension PlatformClient.Payment { - name = try container.decode(String.self, forKey: .name) + state = try container.decode(String.self, forKey: .state) - state = try container.decode(String.self, forKey: .state) + area = try container.decode(String.self, forKey: .area) - do { - landmark = try container.decode(String.self, forKey: .landmark) + gAddressId = try container.decode(String.self, forKey: .gAddressId) - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } + + + + areaCodeSlug = try container.decode(String.self, forKey: .areaCodeSlug) - area = try container.decode(String.self, forKey: .area) + + countryPhoneCode = try container.decode(String.self, forKey: .countryPhoneCode) - areaCodeSlug = try container.decode(String.self, forKey: .areaCodeSlug) + name = try container.decode(String.self, forKey: .name) @@ -259,13 +242,30 @@ public extension PlatformClient.Payment { - countryPhoneCode = try container.decode(String.self, forKey: .countryPhoneCode) + address = try container.decode(String.self, forKey: .address) do { - geoLocation = try container.decode([String: Any].self, forKey: .geoLocation) + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + city = try container.decode(String.self, forKey: .city) + + + + + do { + tags = try container.decode([[String: Any]].self, forKey: .tags) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -282,22 +282,22 @@ public extension PlatformClient.Payment { - try? container.encodeIfPresent(countryIsoCode, forKey: .countryIsoCode) + try? container.encodeIfPresent(googleMapPoint, forKey: .googleMapPoint) - try? container.encodeIfPresent(googleMapPoint, forKey: .googleMapPoint) + try? container.encodeIfPresent(landmark, forKey: .landmark) - try? container.encodeIfPresent(country, forKey: .country) + try? container.encodeIfPresent(phone, forKey: .phone) - try? container.encodeIfPresent(email, forKey: .email) + try? container.encodeIfPresent(countryIsoCode, forKey: .countryIsoCode) @@ -307,72 +307,72 @@ public extension PlatformClient.Payment { - try? container.encodeIfPresent(city, forKey: .city) + try? container.encodeIfPresent(country, forKey: .country) - try? container.encodeIfPresent(phone, forKey: .phone) + try? container.encodeIfPresent(expireAt, forKey: .expireAt) - try? container.encodeIfPresent(expireAt, forKey: .expireAt) + try? container.encodeIfPresent(geoLocation, forKey: .geoLocation) - try? container.encodeIfPresent(address, forKey: .address) + try? container.encodeIfPresent(state, forKey: .state) - try? container.encodeIfPresent(gAddressId, forKey: .gAddressId) + try? container.encodeIfPresent(area, forKey: .area) - try? container.encodeIfPresent(tags, forKey: .tags) + try? container.encodeIfPresent(gAddressId, forKey: .gAddressId) - try? container.encodeIfPresent(name, forKey: .name) + try? container.encodeIfPresent(areaCodeSlug, forKey: .areaCodeSlug) - try? container.encodeIfPresent(state, forKey: .state) + try? container.encodeIfPresent(countryPhoneCode, forKey: .countryPhoneCode) - try? container.encodeIfPresent(landmark, forKey: .landmark) + try? container.encodeIfPresent(name, forKey: .name) - try? container.encodeIfPresent(area, forKey: .area) + try? container.encodeIfPresent(addressType, forKey: .addressType) - try? container.encodeIfPresent(areaCodeSlug, forKey: .areaCodeSlug) + try? container.encodeIfPresent(address, forKey: .address) - try? container.encodeIfPresent(addressType, forKey: .addressType) + try? container.encodeIfPresent(email, forKey: .email) - try? container.encodeIfPresent(countryPhoneCode, forKey: .countryPhoneCode) + try? container.encodeIfPresent(city, forKey: .city) - try? container.encodeIfPresent(geoLocation, forKey: .geoLocation) + try? container.encodeIfPresent(tags, forKey: .tags) } @@ -391,126 +391,126 @@ public extension PlatformClient.ApplicationClient.Payment { class AddressDetail: Codable { - public var countryIsoCode: String - public var googleMapPoint: [String: Any]? - public var country: String - - public var email: String? - - public var areaCode: String - - public var city: String + public var landmark: String? public var phone: String - public var expireAt: String? + public var countryIsoCode: String - public var address: String + public var areaCode: String - public var gAddressId: String + public var country: String - public var tags: [[String: Any]]? + public var expireAt: String? - public var name: String + public var geoLocation: [String: Any]? public var state: String - public var landmark: String? - public var area: String + public var gAddressId: String + public var areaCodeSlug: String + public var countryPhoneCode: String + + public var name: String + public var addressType: String - public var countryPhoneCode: String + public var address: String - public var geoLocation: [String: Any]? + public var email: String? + + public var city: String + + public var tags: [[String: Any]]? public enum CodingKeys: String, CodingKey { - case countryIsoCode = "country_iso_code" - case googleMapPoint = "google_map_point" - case country = "country" - - case email = "email" - - case areaCode = "area_code" - - case city = "city" + case landmark = "landmark" case phone = "phone" - case expireAt = "expire_at" + case countryIsoCode = "country_iso_code" - case address = "address" + case areaCode = "area_code" - case gAddressId = "g_address_id" + case country = "country" - case tags = "tags" + case expireAt = "expire_at" - case name = "name" + case geoLocation = "geo_location" case state = "state" - case landmark = "landmark" - case area = "area" + case gAddressId = "g_address_id" + case areaCodeSlug = "area_code_slug" + case countryPhoneCode = "country_phone_code" + + case name = "name" + case addressType = "address_type" - case countryPhoneCode = "country_phone_code" + case address = "address" - case geoLocation = "geo_location" + case email = "email" + + case city = "city" + + case tags = "tags" } public init(address: String, addressType: String, area: String, areaCode: String, areaCodeSlug: String, city: String, country: String, countryIsoCode: String, countryPhoneCode: String, email: String? = nil, expireAt: String? = nil, geoLocation: [String: Any]? = nil, googleMapPoint: [String: Any]? = nil, gAddressId: String, landmark: String? = nil, name: String, phone: String, state: String, tags: [[String: Any]]? = nil) { - self.countryIsoCode = countryIsoCode - self.googleMapPoint = googleMapPoint - self.country = country - - self.email = email - - self.areaCode = areaCode - - self.city = city + self.landmark = landmark self.phone = phone - self.expireAt = expireAt + self.countryIsoCode = countryIsoCode - self.address = address + self.areaCode = areaCode - self.gAddressId = gAddressId + self.country = country - self.tags = tags + self.expireAt = expireAt - self.name = name + self.geoLocation = geoLocation self.state = state - self.landmark = landmark - self.area = area + self.gAddressId = gAddressId + self.areaCodeSlug = areaCodeSlug + self.countryPhoneCode = countryPhoneCode + + self.name = name + self.addressType = addressType - self.countryPhoneCode = countryPhoneCode + self.address = address - self.geoLocation = geoLocation + self.email = email + + self.city = city + + self.tags = tags } @@ -518,11 +518,6 @@ public extension PlatformClient.ApplicationClient.Payment { let container = try decoder.container(keyedBy: CodingKeys.self) - countryIsoCode = try container.decode(String.self, forKey: .countryIsoCode) - - - - do { googleMapPoint = try container.decode([String: Any].self, forKey: .googleMapPoint) @@ -535,13 +530,8 @@ public extension PlatformClient.ApplicationClient.Payment { - country = try container.decode(String.self, forKey: .country) - - - - do { - email = try container.decode(String.self, forKey: .email) + landmark = try container.decode(String.self, forKey: .landmark) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -552,17 +542,22 @@ public extension PlatformClient.ApplicationClient.Payment { - areaCode = try container.decode(String.self, forKey: .areaCode) + phone = try container.decode(String.self, forKey: .phone) - city = try container.decode(String.self, forKey: .city) + countryIsoCode = try container.decode(String.self, forKey: .countryIsoCode) - phone = try container.decode(String.self, forKey: .phone) + areaCode = try container.decode(String.self, forKey: .areaCode) + + + + + country = try container.decode(String.self, forKey: .country) @@ -579,18 +574,8 @@ public extension PlatformClient.ApplicationClient.Payment { - address = try container.decode(String.self, forKey: .address) - - - - - gAddressId = try container.decode(String.self, forKey: .gAddressId) - - - - do { - tags = try container.decode([[String: Any]].self, forKey: .tags) + geoLocation = try container.decode([String: Any].self, forKey: .geoLocation) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -601,34 +586,32 @@ public extension PlatformClient.ApplicationClient.Payment { - name = try container.decode(String.self, forKey: .name) + state = try container.decode(String.self, forKey: .state) - state = try container.decode(String.self, forKey: .state) + area = try container.decode(String.self, forKey: .area) - do { - landmark = try container.decode(String.self, forKey: .landmark) + gAddressId = try container.decode(String.self, forKey: .gAddressId) - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } + + + + areaCodeSlug = try container.decode(String.self, forKey: .areaCodeSlug) - area = try container.decode(String.self, forKey: .area) + + countryPhoneCode = try container.decode(String.self, forKey: .countryPhoneCode) - areaCodeSlug = try container.decode(String.self, forKey: .areaCodeSlug) + name = try container.decode(String.self, forKey: .name) @@ -638,13 +621,30 @@ public extension PlatformClient.ApplicationClient.Payment { - countryPhoneCode = try container.decode(String.self, forKey: .countryPhoneCode) + address = try container.decode(String.self, forKey: .address) do { - geoLocation = try container.decode([String: Any].self, forKey: .geoLocation) + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + city = try container.decode(String.self, forKey: .city) + + + + + do { + tags = try container.decode([[String: Any]].self, forKey: .tags) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -661,22 +661,22 @@ public extension PlatformClient.ApplicationClient.Payment { - try? container.encodeIfPresent(countryIsoCode, forKey: .countryIsoCode) + try? container.encodeIfPresent(googleMapPoint, forKey: .googleMapPoint) - try? container.encodeIfPresent(googleMapPoint, forKey: .googleMapPoint) + try? container.encodeIfPresent(landmark, forKey: .landmark) - try? container.encodeIfPresent(country, forKey: .country) + try? container.encodeIfPresent(phone, forKey: .phone) - try? container.encodeIfPresent(email, forKey: .email) + try? container.encodeIfPresent(countryIsoCode, forKey: .countryIsoCode) @@ -686,72 +686,72 @@ public extension PlatformClient.ApplicationClient.Payment { - try? container.encodeIfPresent(city, forKey: .city) + try? container.encodeIfPresent(country, forKey: .country) - try? container.encodeIfPresent(phone, forKey: .phone) + try? container.encodeIfPresent(expireAt, forKey: .expireAt) - try? container.encodeIfPresent(expireAt, forKey: .expireAt) + try? container.encodeIfPresent(geoLocation, forKey: .geoLocation) - try? container.encodeIfPresent(address, forKey: .address) + try? container.encodeIfPresent(state, forKey: .state) - try? container.encodeIfPresent(gAddressId, forKey: .gAddressId) + try? container.encodeIfPresent(area, forKey: .area) - try? container.encodeIfPresent(tags, forKey: .tags) + try? container.encodeIfPresent(gAddressId, forKey: .gAddressId) - try? container.encodeIfPresent(name, forKey: .name) + try? container.encodeIfPresent(areaCodeSlug, forKey: .areaCodeSlug) - try? container.encodeIfPresent(state, forKey: .state) + try? container.encodeIfPresent(countryPhoneCode, forKey: .countryPhoneCode) - try? container.encodeIfPresent(landmark, forKey: .landmark) + try? container.encodeIfPresent(name, forKey: .name) - try? container.encodeIfPresent(area, forKey: .area) + try? container.encodeIfPresent(addressType, forKey: .addressType) - try? container.encodeIfPresent(areaCodeSlug, forKey: .areaCodeSlug) + try? container.encodeIfPresent(address, forKey: .address) - try? container.encodeIfPresent(addressType, forKey: .addressType) + try? container.encodeIfPresent(email, forKey: .email) - try? container.encodeIfPresent(countryPhoneCode, forKey: .countryPhoneCode) + try? container.encodeIfPresent(city, forKey: .city) - try? container.encodeIfPresent(geoLocation, forKey: .geoLocation) + try? container.encodeIfPresent(tags, forKey: .tags) } diff --git a/Sources/code/platform/Models/Payment/OrderDetailPaymentPlatformModel.swift b/Sources/code/platform/Models/Payment/OrderDetailPaymentPlatformModel.swift index e1ac081e62..ed4195de47 100644 --- a/Sources/code/platform/Models/Payment/OrderDetailPaymentPlatformModel.swift +++ b/Sources/code/platform/Models/Payment/OrderDetailPaymentPlatformModel.swift @@ -14,47 +14,47 @@ public extension PlatformClient.Payment { public var gid: String - public var aggregator: String - public var amount: Int - public var aggregatorOrderDetails: [String: Any] - public var status: String public var currency: String + public var aggregatorOrderDetails: [String: Any] + + public var aggregator: String + public enum CodingKeys: String, CodingKey { case gid = "gid" - case aggregator = "aggregator" - case amount = "amount" - case aggregatorOrderDetails = "aggregator_order_details" - case status = "status" case currency = "currency" + case aggregatorOrderDetails = "aggregator_order_details" + + case aggregator = "aggregator" + } public init(aggregator: String, aggregatorOrderDetails: [String: Any], amount: Int, currency: String, gid: String, status: String) { self.gid = gid - self.aggregator = aggregator - self.amount = amount - self.aggregatorOrderDetails = aggregatorOrderDetails - self.status = status self.currency = currency + self.aggregatorOrderDetails = aggregatorOrderDetails + + self.aggregator = aggregator + } required public init(from decoder: Decoder) throws { @@ -66,27 +66,27 @@ public extension PlatformClient.Payment { - aggregator = try container.decode(String.self, forKey: .aggregator) + amount = try container.decode(Int.self, forKey: .amount) - amount = try container.decode(Int.self, forKey: .amount) + status = try container.decode(String.self, forKey: .status) - aggregatorOrderDetails = try container.decode([String: Any].self, forKey: .aggregatorOrderDetails) + currency = try container.decode(String.self, forKey: .currency) - status = try container.decode(String.self, forKey: .status) + aggregatorOrderDetails = try container.decode([String: Any].self, forKey: .aggregatorOrderDetails) - currency = try container.decode(String.self, forKey: .currency) + aggregator = try container.decode(String.self, forKey: .aggregator) @@ -102,27 +102,27 @@ public extension PlatformClient.Payment { - try? container.encodeIfPresent(aggregator, forKey: .aggregator) + try? container.encodeIfPresent(amount, forKey: .amount) - try? container.encodeIfPresent(amount, forKey: .amount) + try? container.encodeIfPresent(status, forKey: .status) - try? container.encodeIfPresent(aggregatorOrderDetails, forKey: .aggregatorOrderDetails) + try? container.encodeIfPresent(currency, forKey: .currency) - try? container.encodeIfPresent(status, forKey: .status) + try? container.encodeIfPresent(aggregatorOrderDetails, forKey: .aggregatorOrderDetails) - try? container.encodeIfPresent(currency, forKey: .currency) + try? container.encodeIfPresent(aggregator, forKey: .aggregator) } @@ -143,47 +143,47 @@ public extension PlatformClient.ApplicationClient.Payment { public var gid: String - public var aggregator: String - public var amount: Int - public var aggregatorOrderDetails: [String: Any] - public var status: String public var currency: String + public var aggregatorOrderDetails: [String: Any] + + public var aggregator: String + public enum CodingKeys: String, CodingKey { case gid = "gid" - case aggregator = "aggregator" - case amount = "amount" - case aggregatorOrderDetails = "aggregator_order_details" - case status = "status" case currency = "currency" + case aggregatorOrderDetails = "aggregator_order_details" + + case aggregator = "aggregator" + } public init(aggregator: String, aggregatorOrderDetails: [String: Any], amount: Int, currency: String, gid: String, status: String) { self.gid = gid - self.aggregator = aggregator - self.amount = amount - self.aggregatorOrderDetails = aggregatorOrderDetails - self.status = status self.currency = currency + self.aggregatorOrderDetails = aggregatorOrderDetails + + self.aggregator = aggregator + } required public init(from decoder: Decoder) throws { @@ -195,27 +195,27 @@ public extension PlatformClient.ApplicationClient.Payment { - aggregator = try container.decode(String.self, forKey: .aggregator) + amount = try container.decode(Int.self, forKey: .amount) - amount = try container.decode(Int.self, forKey: .amount) + status = try container.decode(String.self, forKey: .status) - aggregatorOrderDetails = try container.decode([String: Any].self, forKey: .aggregatorOrderDetails) + currency = try container.decode(String.self, forKey: .currency) - status = try container.decode(String.self, forKey: .status) + aggregatorOrderDetails = try container.decode([String: Any].self, forKey: .aggregatorOrderDetails) - currency = try container.decode(String.self, forKey: .currency) + aggregator = try container.decode(String.self, forKey: .aggregator) @@ -231,27 +231,27 @@ public extension PlatformClient.ApplicationClient.Payment { - try? container.encodeIfPresent(aggregator, forKey: .aggregator) + try? container.encodeIfPresent(amount, forKey: .amount) - try? container.encodeIfPresent(amount, forKey: .amount) + try? container.encodeIfPresent(status, forKey: .status) - try? container.encodeIfPresent(aggregatorOrderDetails, forKey: .aggregatorOrderDetails) + try? container.encodeIfPresent(currency, forKey: .currency) - try? container.encodeIfPresent(status, forKey: .status) + try? container.encodeIfPresent(aggregatorOrderDetails, forKey: .aggregatorOrderDetails) - try? container.encodeIfPresent(currency, forKey: .currency) + try? container.encodeIfPresent(aggregator, forKey: .aggregator) } diff --git a/Sources/code/platform/Models/Payment/PaymentSessionDetailPaymentPlatformModel.swift b/Sources/code/platform/Models/Payment/PaymentSessionDetailPaymentPlatformModel.swift index e6ae8c21cd..0e0fb4e0a6 100644 --- a/Sources/code/platform/Models/Payment/PaymentSessionDetailPaymentPlatformModel.swift +++ b/Sources/code/platform/Models/Payment/PaymentSessionDetailPaymentPlatformModel.swift @@ -12,138 +12,138 @@ public extension PlatformClient.Payment { class PaymentSessionDetail: Codable { - public var aggregatorOrderId: String - - public var shippingAddress: AddressDetail - - public var amountCaptured: Int - - public var amountRefunded: Int? - - public var aggregatorCustomerId: String? + public var paymentId: String - public var cancelUrl: String + public var mode: String - public var paymentId: String + public var amount: Int - public var paymentMethods: [[String: Any]] + public var successUrl: String - public var created: String? + public var shippingAddress: AddressDetail? public var gUserId: String public var currency: String + public var merchantLocale: String? + public var locale: String? + public var aggregatorOrderId: String + public var gid: String - public var amount: Int + public var cancelUrl: String - public var billingAddress: AddressDetail + public var amountRefunded: Int? - public var successUrl: String + public var captured: Bool? + + public var created: String? + + public var status: String public var kind: String? - public var mode: String + public var aggregatorCustomerId: String? - public var status: String + public var paymentMethods: [[String: Any]] - public var merchantLocale: String? + public var billingAddress: AddressDetail? - public var captured: Bool? + public var amountCaptured: Int public enum CodingKeys: String, CodingKey { - case aggregatorOrderId = "aggregator_order_id" - - case shippingAddress = "shipping_address" - - case amountCaptured = "amount_captured" - - case amountRefunded = "amount_refunded" - - case aggregatorCustomerId = "aggregator_customer_id" + case paymentId = "payment_id" - case cancelUrl = "cancel_url" + case mode = "mode" - case paymentId = "payment_id" + case amount = "amount" - case paymentMethods = "payment_methods" + case successUrl = "success_url" - case created = "created" + case shippingAddress = "shipping_address" case gUserId = "g_user_id" case currency = "currency" + case merchantLocale = "merchant_locale" + case locale = "locale" - case gid = "gid" + case aggregatorOrderId = "aggregator_order_id" - case amount = "amount" + case gid = "gid" - case billingAddress = "billing_address" + case cancelUrl = "cancel_url" - case successUrl = "success_url" + case amountRefunded = "amount_refunded" - case kind = "kind" + case captured = "captured" - case mode = "mode" + case created = "created" case status = "status" - case merchantLocale = "merchant_locale" - - case captured = "captured" + case kind = "kind" - } - - public init(aggregatorCustomerId: String? = nil, aggregatorOrderId: String, amount: Int, amountCaptured: Int, amountRefunded: Int? = nil, billingAddress: AddressDetail, cancelUrl: String, captured: Bool? = nil, created: String? = nil, currency: String, gid: String, gUserId: String, kind: String? = nil, locale: String? = nil, merchantLocale: String? = nil, mode: String, paymentId: String, paymentMethods: [[String: Any]], shippingAddress: AddressDetail, status: String, successUrl: String) { + case aggregatorCustomerId = "aggregator_customer_id" - self.aggregatorOrderId = aggregatorOrderId + case paymentMethods = "payment_methods" - self.shippingAddress = shippingAddress + case billingAddress = "billing_address" - self.amountCaptured = amountCaptured + case amountCaptured = "amount_captured" - self.amountRefunded = amountRefunded + } + + public init(aggregatorCustomerId: String? = nil, aggregatorOrderId: String, amount: Int, amountCaptured: Int, amountRefunded: Int? = nil, billingAddress: AddressDetail? = nil, cancelUrl: String, captured: Bool? = nil, created: String? = nil, currency: String, gid: String, gUserId: String, kind: String? = nil, locale: String? = nil, merchantLocale: String? = nil, mode: String, paymentId: String, paymentMethods: [[String: Any]], shippingAddress: AddressDetail? = nil, status: String, successUrl: String) { - self.aggregatorCustomerId = aggregatorCustomerId + self.paymentId = paymentId - self.cancelUrl = cancelUrl + self.mode = mode - self.paymentId = paymentId + self.amount = amount - self.paymentMethods = paymentMethods + self.successUrl = successUrl - self.created = created + self.shippingAddress = shippingAddress self.gUserId = gUserId self.currency = currency + self.merchantLocale = merchantLocale + self.locale = locale + self.aggregatorOrderId = aggregatorOrderId + self.gid = gid - self.amount = amount + self.cancelUrl = cancelUrl - self.billingAddress = billingAddress + self.amountRefunded = amountRefunded - self.successUrl = successUrl + self.captured = captured + + self.created = created + + self.status = status self.kind = kind - self.mode = mode + self.aggregatorCustomerId = aggregatorCustomerId - self.status = status + self.paymentMethods = paymentMethods - self.merchantLocale = merchantLocale + self.billingAddress = billingAddress - self.captured = captured + self.amountCaptured = amountCaptured } @@ -151,35 +151,28 @@ public extension PlatformClient.Payment { let container = try decoder.container(keyedBy: CodingKeys.self) - aggregatorOrderId = try container.decode(String.self, forKey: .aggregatorOrderId) + paymentId = try container.decode(String.self, forKey: .paymentId) - shippingAddress = try container.decode(AddressDetail.self, forKey: .shippingAddress) + mode = try container.decode(String.self, forKey: .mode) - amountCaptured = try container.decode(Int.self, forKey: .amountCaptured) + amount = try container.decode(Int.self, forKey: .amount) - do { - amountRefunded = try container.decode(Int.self, forKey: .amountRefunded) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } + successUrl = try container.decode(String.self, forKey: .successUrl) + do { - aggregatorCustomerId = try container.decode(String.self, forKey: .aggregatorCustomerId) + shippingAddress = try container.decode(AddressDetail.self, forKey: .shippingAddress) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -190,23 +183,18 @@ public extension PlatformClient.Payment { - cancelUrl = try container.decode(String.self, forKey: .cancelUrl) - - - - - paymentId = try container.decode(String.self, forKey: .paymentId) + gUserId = try container.decode(String.self, forKey: .gUserId) - paymentMethods = try container.decode([[String: Any]].self, forKey: .paymentMethods) + currency = try container.decode(String.self, forKey: .currency) do { - created = try container.decode(String.self, forKey: .created) + merchantLocale = try container.decode(String.self, forKey: .merchantLocale) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -217,16 +205,6 @@ public extension PlatformClient.Payment { - gUserId = try container.decode(String.self, forKey: .gUserId) - - - - - currency = try container.decode(String.self, forKey: .currency) - - - - do { locale = try container.decode(String.self, forKey: .locale) @@ -239,28 +217,35 @@ public extension PlatformClient.Payment { - gid = try container.decode(String.self, forKey: .gid) + aggregatorOrderId = try container.decode(String.self, forKey: .aggregatorOrderId) - amount = try container.decode(Int.self, forKey: .amount) + gid = try container.decode(String.self, forKey: .gid) - billingAddress = try container.decode(AddressDetail.self, forKey: .billingAddress) + cancelUrl = try container.decode(String.self, forKey: .cancelUrl) - successUrl = try container.decode(String.self, forKey: .successUrl) + do { + amountRefunded = try container.decode(Int.self, forKey: .amountRefunded) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } - do { - kind = try container.decode(String.self, forKey: .kind) + captured = try container.decode(Bool.self, forKey: .captured) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -271,9 +256,16 @@ public extension PlatformClient.Payment { - mode = try container.decode(String.self, forKey: .mode) + do { + created = try container.decode(String.self, forKey: .created) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } - status = try container.decode(String.self, forKey: .status) @@ -282,7 +274,7 @@ public extension PlatformClient.Payment { do { - merchantLocale = try container.decode(String.self, forKey: .merchantLocale) + kind = try container.decode(String.self, forKey: .kind) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -294,7 +286,7 @@ public extension PlatformClient.Payment { do { - captured = try container.decode(Bool.self, forKey: .captured) + aggregatorCustomerId = try container.decode(String.self, forKey: .aggregatorCustomerId) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -304,6 +296,28 @@ public extension PlatformClient.Payment { } + + paymentMethods = try container.decode([[String: Any]].self, forKey: .paymentMethods) + + + + + do { + billingAddress = try container.decode(AddressDetail.self, forKey: .billingAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + amountCaptured = try container.decode(Int.self, forKey: .amountCaptured) + + + } public func encode(to encoder: Encoder) throws { @@ -311,82 +325,82 @@ public extension PlatformClient.Payment { - try? container.encodeIfPresent(aggregatorOrderId, forKey: .aggregatorOrderId) + try? container.encodeIfPresent(paymentId, forKey: .paymentId) - try? container.encodeIfPresent(shippingAddress, forKey: .shippingAddress) + try? container.encodeIfPresent(mode, forKey: .mode) - try? container.encodeIfPresent(amountCaptured, forKey: .amountCaptured) + try? container.encodeIfPresent(amount, forKey: .amount) - try? container.encodeIfPresent(amountRefunded, forKey: .amountRefunded) + try? container.encodeIfPresent(successUrl, forKey: .successUrl) - try? container.encodeIfPresent(aggregatorCustomerId, forKey: .aggregatorCustomerId) + try? container.encodeIfPresent(shippingAddress, forKey: .shippingAddress) - try? container.encodeIfPresent(cancelUrl, forKey: .cancelUrl) + try? container.encodeIfPresent(gUserId, forKey: .gUserId) - try? container.encodeIfPresent(paymentId, forKey: .paymentId) + try? container.encodeIfPresent(currency, forKey: .currency) - try? container.encodeIfPresent(paymentMethods, forKey: .paymentMethods) + try? container.encodeIfPresent(merchantLocale, forKey: .merchantLocale) - try? container.encodeIfPresent(created, forKey: .created) + try? container.encodeIfPresent(locale, forKey: .locale) - try? container.encodeIfPresent(gUserId, forKey: .gUserId) + try? container.encodeIfPresent(aggregatorOrderId, forKey: .aggregatorOrderId) - try? container.encodeIfPresent(currency, forKey: .currency) + try? container.encodeIfPresent(gid, forKey: .gid) - try? container.encodeIfPresent(locale, forKey: .locale) + try? container.encodeIfPresent(cancelUrl, forKey: .cancelUrl) - try? container.encodeIfPresent(gid, forKey: .gid) + try? container.encodeIfPresent(amountRefunded, forKey: .amountRefunded) - try? container.encodeIfPresent(amount, forKey: .amount) + try? container.encodeIfPresent(captured, forKey: .captured) - try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) + try? container.encodeIfPresent(created, forKey: .created) - try? container.encodeIfPresent(successUrl, forKey: .successUrl) + try? container.encodeIfPresent(status, forKey: .status) @@ -396,22 +410,22 @@ public extension PlatformClient.Payment { - try? container.encodeIfPresent(mode, forKey: .mode) + try? container.encodeIfPresent(aggregatorCustomerId, forKey: .aggregatorCustomerId) - try? container.encodeIfPresent(status, forKey: .status) + try? container.encodeIfPresent(paymentMethods, forKey: .paymentMethods) - try? container.encodeIfPresent(merchantLocale, forKey: .merchantLocale) + try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) - try? container.encodeIfPresent(captured, forKey: .captured) + try? container.encodeIfPresent(amountCaptured, forKey: .amountCaptured) } @@ -430,138 +444,138 @@ public extension PlatformClient.ApplicationClient.Payment { class PaymentSessionDetail: Codable { - public var aggregatorOrderId: String - - public var shippingAddress: AddressDetail - - public var amountCaptured: Int - - public var amountRefunded: Int? - - public var aggregatorCustomerId: String? + public var paymentId: String - public var cancelUrl: String + public var mode: String - public var paymentId: String + public var amount: Int - public var paymentMethods: [[String: Any]] + public var successUrl: String - public var created: String? + public var shippingAddress: AddressDetail? public var gUserId: String public var currency: String + public var merchantLocale: String? + public var locale: String? + public var aggregatorOrderId: String + public var gid: String - public var amount: Int + public var cancelUrl: String - public var billingAddress: AddressDetail + public var amountRefunded: Int? - public var successUrl: String + public var captured: Bool? + + public var created: String? + + public var status: String public var kind: String? - public var mode: String + public var aggregatorCustomerId: String? - public var status: String + public var paymentMethods: [[String: Any]] - public var merchantLocale: String? + public var billingAddress: AddressDetail? - public var captured: Bool? + public var amountCaptured: Int public enum CodingKeys: String, CodingKey { - case aggregatorOrderId = "aggregator_order_id" - - case shippingAddress = "shipping_address" - - case amountCaptured = "amount_captured" - - case amountRefunded = "amount_refunded" - - case aggregatorCustomerId = "aggregator_customer_id" + case paymentId = "payment_id" - case cancelUrl = "cancel_url" + case mode = "mode" - case paymentId = "payment_id" + case amount = "amount" - case paymentMethods = "payment_methods" + case successUrl = "success_url" - case created = "created" + case shippingAddress = "shipping_address" case gUserId = "g_user_id" case currency = "currency" + case merchantLocale = "merchant_locale" + case locale = "locale" - case gid = "gid" + case aggregatorOrderId = "aggregator_order_id" - case amount = "amount" + case gid = "gid" - case billingAddress = "billing_address" + case cancelUrl = "cancel_url" - case successUrl = "success_url" + case amountRefunded = "amount_refunded" - case kind = "kind" + case captured = "captured" - case mode = "mode" + case created = "created" case status = "status" - case merchantLocale = "merchant_locale" - - case captured = "captured" + case kind = "kind" - } - - public init(aggregatorCustomerId: String? = nil, aggregatorOrderId: String, amount: Int, amountCaptured: Int, amountRefunded: Int? = nil, billingAddress: AddressDetail, cancelUrl: String, captured: Bool? = nil, created: String? = nil, currency: String, gid: String, gUserId: String, kind: String? = nil, locale: String? = nil, merchantLocale: String? = nil, mode: String, paymentId: String, paymentMethods: [[String: Any]], shippingAddress: AddressDetail, status: String, successUrl: String) { + case aggregatorCustomerId = "aggregator_customer_id" - self.aggregatorOrderId = aggregatorOrderId + case paymentMethods = "payment_methods" - self.shippingAddress = shippingAddress + case billingAddress = "billing_address" - self.amountCaptured = amountCaptured + case amountCaptured = "amount_captured" - self.amountRefunded = amountRefunded + } + + public init(aggregatorCustomerId: String? = nil, aggregatorOrderId: String, amount: Int, amountCaptured: Int, amountRefunded: Int? = nil, billingAddress: AddressDetail? = nil, cancelUrl: String, captured: Bool? = nil, created: String? = nil, currency: String, gid: String, gUserId: String, kind: String? = nil, locale: String? = nil, merchantLocale: String? = nil, mode: String, paymentId: String, paymentMethods: [[String: Any]], shippingAddress: AddressDetail? = nil, status: String, successUrl: String) { - self.aggregatorCustomerId = aggregatorCustomerId + self.paymentId = paymentId - self.cancelUrl = cancelUrl + self.mode = mode - self.paymentId = paymentId + self.amount = amount - self.paymentMethods = paymentMethods + self.successUrl = successUrl - self.created = created + self.shippingAddress = shippingAddress self.gUserId = gUserId self.currency = currency + self.merchantLocale = merchantLocale + self.locale = locale + self.aggregatorOrderId = aggregatorOrderId + self.gid = gid - self.amount = amount + self.cancelUrl = cancelUrl - self.billingAddress = billingAddress + self.amountRefunded = amountRefunded - self.successUrl = successUrl + self.captured = captured + + self.created = created + + self.status = status self.kind = kind - self.mode = mode + self.aggregatorCustomerId = aggregatorCustomerId - self.status = status + self.paymentMethods = paymentMethods - self.merchantLocale = merchantLocale + self.billingAddress = billingAddress - self.captured = captured + self.amountCaptured = amountCaptured } @@ -569,35 +583,28 @@ public extension PlatformClient.ApplicationClient.Payment { let container = try decoder.container(keyedBy: CodingKeys.self) - aggregatorOrderId = try container.decode(String.self, forKey: .aggregatorOrderId) + paymentId = try container.decode(String.self, forKey: .paymentId) - shippingAddress = try container.decode(AddressDetail.self, forKey: .shippingAddress) + mode = try container.decode(String.self, forKey: .mode) - amountCaptured = try container.decode(Int.self, forKey: .amountCaptured) + amount = try container.decode(Int.self, forKey: .amount) - do { - amountRefunded = try container.decode(Int.self, forKey: .amountRefunded) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } + successUrl = try container.decode(String.self, forKey: .successUrl) + do { - aggregatorCustomerId = try container.decode(String.self, forKey: .aggregatorCustomerId) + shippingAddress = try container.decode(AddressDetail.self, forKey: .shippingAddress) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -608,23 +615,18 @@ public extension PlatformClient.ApplicationClient.Payment { - cancelUrl = try container.decode(String.self, forKey: .cancelUrl) - - - - - paymentId = try container.decode(String.self, forKey: .paymentId) + gUserId = try container.decode(String.self, forKey: .gUserId) - paymentMethods = try container.decode([[String: Any]].self, forKey: .paymentMethods) + currency = try container.decode(String.self, forKey: .currency) do { - created = try container.decode(String.self, forKey: .created) + merchantLocale = try container.decode(String.self, forKey: .merchantLocale) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -635,16 +637,6 @@ public extension PlatformClient.ApplicationClient.Payment { - gUserId = try container.decode(String.self, forKey: .gUserId) - - - - - currency = try container.decode(String.self, forKey: .currency) - - - - do { locale = try container.decode(String.self, forKey: .locale) @@ -657,28 +649,35 @@ public extension PlatformClient.ApplicationClient.Payment { - gid = try container.decode(String.self, forKey: .gid) + aggregatorOrderId = try container.decode(String.self, forKey: .aggregatorOrderId) - amount = try container.decode(Int.self, forKey: .amount) + gid = try container.decode(String.self, forKey: .gid) - billingAddress = try container.decode(AddressDetail.self, forKey: .billingAddress) + cancelUrl = try container.decode(String.self, forKey: .cancelUrl) - successUrl = try container.decode(String.self, forKey: .successUrl) + do { + amountRefunded = try container.decode(Int.self, forKey: .amountRefunded) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } - do { - kind = try container.decode(String.self, forKey: .kind) + captured = try container.decode(Bool.self, forKey: .captured) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -689,9 +688,16 @@ public extension PlatformClient.ApplicationClient.Payment { - mode = try container.decode(String.self, forKey: .mode) + do { + created = try container.decode(String.self, forKey: .created) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } - status = try container.decode(String.self, forKey: .status) @@ -700,7 +706,7 @@ public extension PlatformClient.ApplicationClient.Payment { do { - merchantLocale = try container.decode(String.self, forKey: .merchantLocale) + kind = try container.decode(String.self, forKey: .kind) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -712,7 +718,7 @@ public extension PlatformClient.ApplicationClient.Payment { do { - captured = try container.decode(Bool.self, forKey: .captured) + aggregatorCustomerId = try container.decode(String.self, forKey: .aggregatorCustomerId) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -722,6 +728,28 @@ public extension PlatformClient.ApplicationClient.Payment { } + + paymentMethods = try container.decode([[String: Any]].self, forKey: .paymentMethods) + + + + + do { + billingAddress = try container.decode(AddressDetail.self, forKey: .billingAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + + amountCaptured = try container.decode(Int.self, forKey: .amountCaptured) + + + } public func encode(to encoder: Encoder) throws { @@ -729,82 +757,82 @@ public extension PlatformClient.ApplicationClient.Payment { - try? container.encodeIfPresent(aggregatorOrderId, forKey: .aggregatorOrderId) + try? container.encodeIfPresent(paymentId, forKey: .paymentId) - try? container.encodeIfPresent(shippingAddress, forKey: .shippingAddress) + try? container.encodeIfPresent(mode, forKey: .mode) - try? container.encodeIfPresent(amountCaptured, forKey: .amountCaptured) + try? container.encodeIfPresent(amount, forKey: .amount) - try? container.encodeIfPresent(amountRefunded, forKey: .amountRefunded) + try? container.encodeIfPresent(successUrl, forKey: .successUrl) - try? container.encodeIfPresent(aggregatorCustomerId, forKey: .aggregatorCustomerId) + try? container.encodeIfPresent(shippingAddress, forKey: .shippingAddress) - try? container.encodeIfPresent(cancelUrl, forKey: .cancelUrl) + try? container.encodeIfPresent(gUserId, forKey: .gUserId) - try? container.encodeIfPresent(paymentId, forKey: .paymentId) + try? container.encodeIfPresent(currency, forKey: .currency) - try? container.encodeIfPresent(paymentMethods, forKey: .paymentMethods) + try? container.encodeIfPresent(merchantLocale, forKey: .merchantLocale) - try? container.encodeIfPresent(created, forKey: .created) + try? container.encodeIfPresent(locale, forKey: .locale) - try? container.encodeIfPresent(gUserId, forKey: .gUserId) + try? container.encodeIfPresent(aggregatorOrderId, forKey: .aggregatorOrderId) - try? container.encodeIfPresent(currency, forKey: .currency) + try? container.encodeIfPresent(gid, forKey: .gid) - try? container.encodeIfPresent(locale, forKey: .locale) + try? container.encodeIfPresent(cancelUrl, forKey: .cancelUrl) - try? container.encodeIfPresent(gid, forKey: .gid) + try? container.encodeIfPresent(amountRefunded, forKey: .amountRefunded) - try? container.encodeIfPresent(amount, forKey: .amount) + try? container.encodeIfPresent(captured, forKey: .captured) - try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) + try? container.encodeIfPresent(created, forKey: .created) - try? container.encodeIfPresent(successUrl, forKey: .successUrl) + try? container.encodeIfPresent(status, forKey: .status) @@ -814,22 +842,22 @@ public extension PlatformClient.ApplicationClient.Payment { - try? container.encodeIfPresent(mode, forKey: .mode) + try? container.encodeIfPresent(aggregatorCustomerId, forKey: .aggregatorCustomerId) - try? container.encodeIfPresent(status, forKey: .status) + try? container.encodeIfPresent(paymentMethods, forKey: .paymentMethods) - try? container.encodeIfPresent(merchantLocale, forKey: .merchantLocale) + try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) - try? container.encodeIfPresent(captured, forKey: .captured) + try? container.encodeIfPresent(amountCaptured, forKey: .amountCaptured) } diff --git a/Sources/code/platform/Models/Payment/PaymentSessionRequestSerializerPaymentPlatformModel.swift b/Sources/code/platform/Models/Payment/PaymentSessionRequestSerializerPaymentPlatformModel.swift index cb98aea8c2..ce63843ea3 100644 --- a/Sources/code/platform/Models/Payment/PaymentSessionRequestSerializerPaymentPlatformModel.swift +++ b/Sources/code/platform/Models/Payment/PaymentSessionRequestSerializerPaymentPlatformModel.swift @@ -12,81 +12,99 @@ public extension PlatformClient.Payment { class PaymentSessionRequestSerializer: Codable { - public var gid: String + public var meta: [String: Any]? - public var paymentDetails: [PaymentSessionDetail] + public var gid: String - public var totalAmount: Int + public var orderDetails: OrderDetail public var status: String - public var orderDetails: OrderDetail - public var currency: String + public var paymentDetails: [PaymentSessionDetail] + + public var totalAmount: Int + public enum CodingKeys: String, CodingKey { - case gid = "gid" + case meta = "meta" - case paymentDetails = "payment_details" + case gid = "gid" - case totalAmount = "total_amount" + case orderDetails = "order_details" case status = "status" - case orderDetails = "order_details" - case currency = "currency" + case paymentDetails = "payment_details" + + case totalAmount = "total_amount" + } - public init(currency: String, gid: String, orderDetails: OrderDetail, paymentDetails: [PaymentSessionDetail], status: String, totalAmount: Int) { + public init(currency: String, gid: String, meta: [String: Any]? = nil, orderDetails: OrderDetail, paymentDetails: [PaymentSessionDetail], status: String, totalAmount: Int) { - self.gid = gid + self.meta = meta - self.paymentDetails = paymentDetails + self.gid = gid - self.totalAmount = totalAmount + self.orderDetails = orderDetails self.status = status - self.orderDetails = orderDetails - self.currency = currency + self.paymentDetails = paymentDetails + + self.totalAmount = totalAmount + } required public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + gid = try container.decode(String.self, forKey: .gid) - paymentDetails = try container.decode([PaymentSessionDetail].self, forKey: .paymentDetails) + orderDetails = try container.decode(OrderDetail.self, forKey: .orderDetails) - totalAmount = try container.decode(Int.self, forKey: .totalAmount) + status = try container.decode(String.self, forKey: .status) - status = try container.decode(String.self, forKey: .status) + currency = try container.decode(String.self, forKey: .currency) - orderDetails = try container.decode(OrderDetail.self, forKey: .orderDetails) + paymentDetails = try container.decode([PaymentSessionDetail].self, forKey: .paymentDetails) - currency = try container.decode(String.self, forKey: .currency) + totalAmount = try container.decode(Int.self, forKey: .totalAmount) @@ -97,17 +115,17 @@ public extension PlatformClient.Payment { - try? container.encodeIfPresent(gid, forKey: .gid) + try? container.encodeIfPresent(meta, forKey: .meta) - try? container.encodeIfPresent(paymentDetails, forKey: .paymentDetails) + try? container.encodeIfPresent(gid, forKey: .gid) - try? container.encodeIfPresent(totalAmount, forKey: .totalAmount) + try? container.encodeIfPresent(orderDetails, forKey: .orderDetails) @@ -117,12 +135,17 @@ public extension PlatformClient.Payment { - try? container.encodeIfPresent(orderDetails, forKey: .orderDetails) + try? container.encodeIfPresent(currency, forKey: .currency) - try? container.encodeIfPresent(currency, forKey: .currency) + try? container.encodeIfPresent(paymentDetails, forKey: .paymentDetails) + + + + + try? container.encodeIfPresent(totalAmount, forKey: .totalAmount) } @@ -141,81 +164,99 @@ public extension PlatformClient.ApplicationClient.Payment { class PaymentSessionRequestSerializer: Codable { - public var gid: String + public var meta: [String: Any]? - public var paymentDetails: [PaymentSessionDetail] + public var gid: String - public var totalAmount: Int + public var orderDetails: OrderDetail public var status: String - public var orderDetails: OrderDetail - public var currency: String + public var paymentDetails: [PaymentSessionDetail] + + public var totalAmount: Int + public enum CodingKeys: String, CodingKey { - case gid = "gid" + case meta = "meta" - case paymentDetails = "payment_details" + case gid = "gid" - case totalAmount = "total_amount" + case orderDetails = "order_details" case status = "status" - case orderDetails = "order_details" - case currency = "currency" + case paymentDetails = "payment_details" + + case totalAmount = "total_amount" + } - public init(currency: String, gid: String, orderDetails: OrderDetail, paymentDetails: [PaymentSessionDetail], status: String, totalAmount: Int) { + public init(currency: String, gid: String, meta: [String: Any]? = nil, orderDetails: OrderDetail, paymentDetails: [PaymentSessionDetail], status: String, totalAmount: Int) { - self.gid = gid + self.meta = meta - self.paymentDetails = paymentDetails + self.gid = gid - self.totalAmount = totalAmount + self.orderDetails = orderDetails self.status = status - self.orderDetails = orderDetails - self.currency = currency + self.paymentDetails = paymentDetails + + self.totalAmount = totalAmount + } required public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + gid = try container.decode(String.self, forKey: .gid) - paymentDetails = try container.decode([PaymentSessionDetail].self, forKey: .paymentDetails) + orderDetails = try container.decode(OrderDetail.self, forKey: .orderDetails) - totalAmount = try container.decode(Int.self, forKey: .totalAmount) + status = try container.decode(String.self, forKey: .status) - status = try container.decode(String.self, forKey: .status) + currency = try container.decode(String.self, forKey: .currency) - orderDetails = try container.decode(OrderDetail.self, forKey: .orderDetails) + paymentDetails = try container.decode([PaymentSessionDetail].self, forKey: .paymentDetails) - currency = try container.decode(String.self, forKey: .currency) + totalAmount = try container.decode(Int.self, forKey: .totalAmount) @@ -226,17 +267,17 @@ public extension PlatformClient.ApplicationClient.Payment { - try? container.encodeIfPresent(gid, forKey: .gid) + try? container.encodeIfPresent(meta, forKey: .meta) - try? container.encodeIfPresent(paymentDetails, forKey: .paymentDetails) + try? container.encodeIfPresent(gid, forKey: .gid) - try? container.encodeIfPresent(totalAmount, forKey: .totalAmount) + try? container.encodeIfPresent(orderDetails, forKey: .orderDetails) @@ -246,12 +287,17 @@ public extension PlatformClient.ApplicationClient.Payment { - try? container.encodeIfPresent(orderDetails, forKey: .orderDetails) + try? container.encodeIfPresent(currency, forKey: .currency) - try? container.encodeIfPresent(currency, forKey: .currency) + try? container.encodeIfPresent(paymentDetails, forKey: .paymentDetails) + + + + + try? container.encodeIfPresent(totalAmount, forKey: .totalAmount) } diff --git a/Sources/code/platform/Models/Payment/PaymentSessionResponseSerializerPaymentPlatformModel.swift b/Sources/code/platform/Models/Payment/PaymentSessionResponseSerializerPaymentPlatformModel.swift index a123522a37..47a662e1af 100644 --- a/Sources/code/platform/Models/Payment/PaymentSessionResponseSerializerPaymentPlatformModel.swift +++ b/Sources/code/platform/Models/Payment/PaymentSessionResponseSerializerPaymentPlatformModel.swift @@ -16,12 +16,12 @@ public extension PlatformClient.Payment { public var platformTransactionDetails: [[String: Any]] - public var totalAmount: Int - public var status: String public var currency: String + public var totalAmount: Int + public enum CodingKeys: String, CodingKey { @@ -29,12 +29,12 @@ public extension PlatformClient.Payment { case platformTransactionDetails = "platform_transaction_details" - case totalAmount = "total_amount" - case status = "status" case currency = "currency" + case totalAmount = "total_amount" + } public init(currency: String, gid: String, platformTransactionDetails: [[String: Any]], status: String, totalAmount: Int) { @@ -43,12 +43,12 @@ public extension PlatformClient.Payment { self.platformTransactionDetails = platformTransactionDetails - self.totalAmount = totalAmount - self.status = status self.currency = currency + self.totalAmount = totalAmount + } required public init(from decoder: Decoder) throws { @@ -65,17 +65,17 @@ public extension PlatformClient.Payment { - totalAmount = try container.decode(Int.self, forKey: .totalAmount) + status = try container.decode(String.self, forKey: .status) - status = try container.decode(String.self, forKey: .status) + currency = try container.decode(String.self, forKey: .currency) - currency = try container.decode(String.self, forKey: .currency) + totalAmount = try container.decode(Int.self, forKey: .totalAmount) @@ -96,17 +96,17 @@ public extension PlatformClient.Payment { - try? container.encodeIfPresent(totalAmount, forKey: .totalAmount) + try? container.encodeIfPresent(status, forKey: .status) - try? container.encodeIfPresent(status, forKey: .status) + try? container.encodeIfPresent(currency, forKey: .currency) - try? container.encodeIfPresent(currency, forKey: .currency) + try? container.encodeIfPresent(totalAmount, forKey: .totalAmount) } @@ -129,12 +129,12 @@ public extension PlatformClient.ApplicationClient.Payment { public var platformTransactionDetails: [[String: Any]] - public var totalAmount: Int - public var status: String public var currency: String + public var totalAmount: Int + public enum CodingKeys: String, CodingKey { @@ -142,12 +142,12 @@ public extension PlatformClient.ApplicationClient.Payment { case platformTransactionDetails = "platform_transaction_details" - case totalAmount = "total_amount" - case status = "status" case currency = "currency" + case totalAmount = "total_amount" + } public init(currency: String, gid: String, platformTransactionDetails: [[String: Any]], status: String, totalAmount: Int) { @@ -156,12 +156,12 @@ public extension PlatformClient.ApplicationClient.Payment { self.platformTransactionDetails = platformTransactionDetails - self.totalAmount = totalAmount - self.status = status self.currency = currency + self.totalAmount = totalAmount + } required public init(from decoder: Decoder) throws { @@ -178,17 +178,17 @@ public extension PlatformClient.ApplicationClient.Payment { - totalAmount = try container.decode(Int.self, forKey: .totalAmount) + status = try container.decode(String.self, forKey: .status) - status = try container.decode(String.self, forKey: .status) + currency = try container.decode(String.self, forKey: .currency) - currency = try container.decode(String.self, forKey: .currency) + totalAmount = try container.decode(Int.self, forKey: .totalAmount) @@ -209,17 +209,17 @@ public extension PlatformClient.ApplicationClient.Payment { - try? container.encodeIfPresent(totalAmount, forKey: .totalAmount) + try? container.encodeIfPresent(status, forKey: .status) - try? container.encodeIfPresent(status, forKey: .status) + try? container.encodeIfPresent(currency, forKey: .currency) - try? container.encodeIfPresent(currency, forKey: .currency) + try? container.encodeIfPresent(totalAmount, forKey: .totalAmount) } diff --git a/Sources/code/platform/Models/Payment/RefundSessionDetailPaymentPlatformModel.swift b/Sources/code/platform/Models/Payment/RefundSessionDetailPaymentPlatformModel.swift index 1273fd7e3e..57cd00c487 100644 --- a/Sources/code/platform/Models/Payment/RefundSessionDetailPaymentPlatformModel.swift +++ b/Sources/code/platform/Models/Payment/RefundSessionDetailPaymentPlatformModel.swift @@ -14,54 +14,54 @@ public extension PlatformClient.Payment { public var refundUtr: String? - public var receiptNumber: String? - - public var balanceTransaction: String? - - public var paymentId: String - - public var created: String - public var requestId: String - public var transferReversal: String? + public var paymentId: String public var amount: Int + public var reason: String? + public var status: String + public var created: String + public var sourceTransferReversal: String? + public var receiptNumber: String? + public var currency: String - public var reason: String? + public var transferReversal: String? + + public var balanceTransaction: String? public enum CodingKeys: String, CodingKey { case refundUtr = "refund_utr" - case receiptNumber = "receipt_number" - - case balanceTransaction = "balance_transaction" - - case paymentId = "payment_id" - - case created = "created" - case requestId = "request_id" - case transferReversal = "transfer_reversal" + case paymentId = "payment_id" case amount = "amount" + case reason = "reason" + case status = "status" + case created = "created" + case sourceTransferReversal = "source_transfer_reversal" + case receiptNumber = "receipt_number" + case currency = "currency" - case reason = "reason" + case transferReversal = "transfer_reversal" + + case balanceTransaction = "balance_transaction" } @@ -69,27 +69,27 @@ public extension PlatformClient.Payment { self.refundUtr = refundUtr - self.receiptNumber = receiptNumber - - self.balanceTransaction = balanceTransaction - - self.paymentId = paymentId - - self.created = created - self.requestId = requestId - self.transferReversal = transferReversal + self.paymentId = paymentId self.amount = amount + self.reason = reason + self.status = status + self.created = created + self.sourceTransferReversal = sourceTransferReversal + self.receiptNumber = receiptNumber + self.currency = currency - self.reason = reason + self.transferReversal = transferReversal + + self.balanceTransaction = balanceTransaction } @@ -109,20 +109,23 @@ public extension PlatformClient.Payment { - do { - receiptNumber = try container.decode(String.self, forKey: .receiptNumber) + requestId = try container.decode(String.self, forKey: .requestId) - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } + + + + paymentId = try container.decode(String.self, forKey: .paymentId) + + amount = try container.decode(Int.self, forKey: .amount) + + + + do { - balanceTransaction = try container.decode(String.self, forKey: .balanceTransaction) + reason = try container.decode(String.self, forKey: .reason) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -133,7 +136,7 @@ public extension PlatformClient.Payment { - paymentId = try container.decode(String.self, forKey: .paymentId) + status = try container.decode(String.self, forKey: .status) @@ -143,13 +146,8 @@ public extension PlatformClient.Payment { - requestId = try container.decode(String.self, forKey: .requestId) - - - - do { - transferReversal = try container.decode(String.self, forKey: .transferReversal) + sourceTransferReversal = try container.decode(String.self, forKey: .sourceTransferReversal) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -160,18 +158,25 @@ public extension PlatformClient.Payment { - amount = try container.decode(Int.self, forKey: .amount) + do { + receiptNumber = try container.decode(String.self, forKey: .receiptNumber) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } - - status = try container.decode(String.self, forKey: .status) + currency = try container.decode(String.self, forKey: .currency) do { - sourceTransferReversal = try container.decode(String.self, forKey: .sourceTransferReversal) + transferReversal = try container.decode(String.self, forKey: .transferReversal) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -182,13 +187,8 @@ public extension PlatformClient.Payment { - currency = try container.decode(String.self, forKey: .currency) - - - - do { - reason = try container.decode(String.self, forKey: .reason) + balanceTransaction = try container.decode(String.self, forKey: .balanceTransaction) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -210,57 +210,57 @@ public extension PlatformClient.Payment { - try? container.encodeIfPresent(receiptNumber, forKey: .receiptNumber) + try? container.encodeIfPresent(requestId, forKey: .requestId) - try? container.encodeIfPresent(balanceTransaction, forKey: .balanceTransaction) + try? container.encodeIfPresent(paymentId, forKey: .paymentId) - try? container.encodeIfPresent(paymentId, forKey: .paymentId) + try? container.encodeIfPresent(amount, forKey: .amount) - try? container.encodeIfPresent(created, forKey: .created) + try? container.encodeIfPresent(reason, forKey: .reason) - try? container.encodeIfPresent(requestId, forKey: .requestId) + try? container.encodeIfPresent(status, forKey: .status) - try? container.encodeIfPresent(transferReversal, forKey: .transferReversal) + try? container.encodeIfPresent(created, forKey: .created) - try? container.encodeIfPresent(amount, forKey: .amount) + try? container.encodeIfPresent(sourceTransferReversal, forKey: .sourceTransferReversal) - try? container.encodeIfPresent(status, forKey: .status) + try? container.encodeIfPresent(receiptNumber, forKey: .receiptNumber) - try? container.encodeIfPresent(sourceTransferReversal, forKey: .sourceTransferReversal) + try? container.encodeIfPresent(currency, forKey: .currency) - try? container.encodeIfPresent(currency, forKey: .currency) + try? container.encodeIfPresent(transferReversal, forKey: .transferReversal) - try? container.encodeIfPresent(reason, forKey: .reason) + try? container.encodeIfPresent(balanceTransaction, forKey: .balanceTransaction) } @@ -281,54 +281,54 @@ public extension PlatformClient.ApplicationClient.Payment { public var refundUtr: String? - public var receiptNumber: String? - - public var balanceTransaction: String? - - public var paymentId: String - - public var created: String - public var requestId: String - public var transferReversal: String? + public var paymentId: String public var amount: Int + public var reason: String? + public var status: String + public var created: String + public var sourceTransferReversal: String? + public var receiptNumber: String? + public var currency: String - public var reason: String? + public var transferReversal: String? + + public var balanceTransaction: String? public enum CodingKeys: String, CodingKey { case refundUtr = "refund_utr" - case receiptNumber = "receipt_number" - - case balanceTransaction = "balance_transaction" - - case paymentId = "payment_id" - - case created = "created" - case requestId = "request_id" - case transferReversal = "transfer_reversal" + case paymentId = "payment_id" case amount = "amount" + case reason = "reason" + case status = "status" + case created = "created" + case sourceTransferReversal = "source_transfer_reversal" + case receiptNumber = "receipt_number" + case currency = "currency" - case reason = "reason" + case transferReversal = "transfer_reversal" + + case balanceTransaction = "balance_transaction" } @@ -336,27 +336,27 @@ public extension PlatformClient.ApplicationClient.Payment { self.refundUtr = refundUtr - self.receiptNumber = receiptNumber - - self.balanceTransaction = balanceTransaction - - self.paymentId = paymentId - - self.created = created - self.requestId = requestId - self.transferReversal = transferReversal + self.paymentId = paymentId self.amount = amount + self.reason = reason + self.status = status + self.created = created + self.sourceTransferReversal = sourceTransferReversal + self.receiptNumber = receiptNumber + self.currency = currency - self.reason = reason + self.transferReversal = transferReversal + + self.balanceTransaction = balanceTransaction } @@ -376,20 +376,23 @@ public extension PlatformClient.ApplicationClient.Payment { - do { - receiptNumber = try container.decode(String.self, forKey: .receiptNumber) + requestId = try container.decode(String.self, forKey: .requestId) - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } + + + + paymentId = try container.decode(String.self, forKey: .paymentId) + + amount = try container.decode(Int.self, forKey: .amount) + + + + do { - balanceTransaction = try container.decode(String.self, forKey: .balanceTransaction) + reason = try container.decode(String.self, forKey: .reason) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -400,7 +403,7 @@ public extension PlatformClient.ApplicationClient.Payment { - paymentId = try container.decode(String.self, forKey: .paymentId) + status = try container.decode(String.self, forKey: .status) @@ -410,13 +413,8 @@ public extension PlatformClient.ApplicationClient.Payment { - requestId = try container.decode(String.self, forKey: .requestId) - - - - do { - transferReversal = try container.decode(String.self, forKey: .transferReversal) + sourceTransferReversal = try container.decode(String.self, forKey: .sourceTransferReversal) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -427,18 +425,25 @@ public extension PlatformClient.ApplicationClient.Payment { - amount = try container.decode(Int.self, forKey: .amount) + do { + receiptNumber = try container.decode(String.self, forKey: .receiptNumber) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } - - status = try container.decode(String.self, forKey: .status) + currency = try container.decode(String.self, forKey: .currency) do { - sourceTransferReversal = try container.decode(String.self, forKey: .sourceTransferReversal) + transferReversal = try container.decode(String.self, forKey: .transferReversal) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -449,13 +454,8 @@ public extension PlatformClient.ApplicationClient.Payment { - currency = try container.decode(String.self, forKey: .currency) - - - - do { - reason = try container.decode(String.self, forKey: .reason) + balanceTransaction = try container.decode(String.self, forKey: .balanceTransaction) } catch DecodingError.typeMismatch(let type, let context) { print("Type '\(type)' mismatch:", context.debugDescription) @@ -477,57 +477,57 @@ public extension PlatformClient.ApplicationClient.Payment { - try? container.encodeIfPresent(receiptNumber, forKey: .receiptNumber) + try? container.encodeIfPresent(requestId, forKey: .requestId) - try? container.encodeIfPresent(balanceTransaction, forKey: .balanceTransaction) + try? container.encodeIfPresent(paymentId, forKey: .paymentId) - try? container.encodeIfPresent(paymentId, forKey: .paymentId) + try? container.encodeIfPresent(amount, forKey: .amount) - try? container.encodeIfPresent(created, forKey: .created) + try? container.encodeIfPresent(reason, forKey: .reason) - try? container.encodeIfPresent(requestId, forKey: .requestId) + try? container.encodeIfPresent(status, forKey: .status) - try? container.encodeIfPresent(transferReversal, forKey: .transferReversal) + try? container.encodeIfPresent(created, forKey: .created) - try? container.encodeIfPresent(amount, forKey: .amount) + try? container.encodeIfPresent(sourceTransferReversal, forKey: .sourceTransferReversal) - try? container.encodeIfPresent(status, forKey: .status) + try? container.encodeIfPresent(receiptNumber, forKey: .receiptNumber) - try? container.encodeIfPresent(sourceTransferReversal, forKey: .sourceTransferReversal) + try? container.encodeIfPresent(currency, forKey: .currency) - try? container.encodeIfPresent(currency, forKey: .currency) + try? container.encodeIfPresent(transferReversal, forKey: .transferReversal) - try? container.encodeIfPresent(reason, forKey: .reason) + try? container.encodeIfPresent(balanceTransaction, forKey: .balanceTransaction) } diff --git a/Sources/code/platform/Models/Payment/RefundSessionRequestSerializerPaymentPlatformModel.swift b/Sources/code/platform/Models/Payment/RefundSessionRequestSerializerPaymentPlatformModel.swift index bf995fa666..67b6694130 100644 --- a/Sources/code/platform/Models/Payment/RefundSessionRequestSerializerPaymentPlatformModel.swift +++ b/Sources/code/platform/Models/Payment/RefundSessionRequestSerializerPaymentPlatformModel.swift @@ -12,48 +12,54 @@ public extension PlatformClient.Payment { class RefundSessionRequestSerializer: Codable { + public var meta: [String: Any]? + public var gid: String - public var paymentDetails: PaymentSessionDetail + public var status: String - public var totalAmount: Int + public var currency: String - public var refundDetails: [RefundSessionDetail]? + public var paymentDetails: PaymentSessionDetail - public var status: String + public var refundDetails: [RefundSessionDetail]? - public var currency: String + public var totalAmount: Int public enum CodingKeys: String, CodingKey { + case meta = "meta" + case gid = "gid" - case paymentDetails = "payment_details" + case status = "status" - case totalAmount = "total_amount" + case currency = "currency" - case refundDetails = "refund_details" + case paymentDetails = "payment_details" - case status = "status" + case refundDetails = "refund_details" - case currency = "currency" + case totalAmount = "total_amount" } - public init(currency: String, gid: String, paymentDetails: PaymentSessionDetail, refundDetails: [RefundSessionDetail]? = nil, status: String, totalAmount: Int) { + public init(currency: String, gid: String, meta: [String: Any]? = nil, paymentDetails: PaymentSessionDetail, refundDetails: [RefundSessionDetail]? = nil, status: String, totalAmount: Int) { + + self.meta = meta self.gid = gid - self.paymentDetails = paymentDetails + self.status = status - self.totalAmount = totalAmount + self.currency = currency - self.refundDetails = refundDetails + self.paymentDetails = paymentDetails - self.status = status + self.refundDetails = refundDetails - self.currency = currency + self.totalAmount = totalAmount } @@ -61,17 +67,34 @@ public extension PlatformClient.Payment { let container = try decoder.container(keyedBy: CodingKeys.self) + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + gid = try container.decode(String.self, forKey: .gid) - paymentDetails = try container.decode(PaymentSessionDetail.self, forKey: .paymentDetails) + status = try container.decode(String.self, forKey: .status) - totalAmount = try container.decode(Int.self, forKey: .totalAmount) + currency = try container.decode(String.self, forKey: .currency) + + + + + paymentDetails = try container.decode(PaymentSessionDetail.self, forKey: .paymentDetails) @@ -88,12 +111,7 @@ public extension PlatformClient.Payment { - status = try container.decode(String.self, forKey: .status) - - - - - currency = try container.decode(String.self, forKey: .currency) + totalAmount = try container.decode(Int.self, forKey: .totalAmount) @@ -104,32 +122,37 @@ public extension PlatformClient.Payment { + try? container.encodeIfPresent(meta, forKey: .meta) + + + + try? container.encodeIfPresent(gid, forKey: .gid) - try? container.encodeIfPresent(paymentDetails, forKey: .paymentDetails) + try? container.encodeIfPresent(status, forKey: .status) - try? container.encodeIfPresent(totalAmount, forKey: .totalAmount) + try? container.encodeIfPresent(currency, forKey: .currency) - try? container.encodeIfPresent(refundDetails, forKey: .refundDetails) + try? container.encodeIfPresent(paymentDetails, forKey: .paymentDetails) - try? container.encodeIfPresent(status, forKey: .status) + try? container.encodeIfPresent(refundDetails, forKey: .refundDetails) - try? container.encodeIfPresent(currency, forKey: .currency) + try? container.encodeIfPresent(totalAmount, forKey: .totalAmount) } @@ -148,48 +171,54 @@ public extension PlatformClient.ApplicationClient.Payment { class RefundSessionRequestSerializer: Codable { + public var meta: [String: Any]? + public var gid: String - public var paymentDetails: PaymentSessionDetail + public var status: String - public var totalAmount: Int + public var currency: String - public var refundDetails: [RefundSessionDetail]? + public var paymentDetails: PaymentSessionDetail - public var status: String + public var refundDetails: [RefundSessionDetail]? - public var currency: String + public var totalAmount: Int public enum CodingKeys: String, CodingKey { + case meta = "meta" + case gid = "gid" - case paymentDetails = "payment_details" + case status = "status" - case totalAmount = "total_amount" + case currency = "currency" - case refundDetails = "refund_details" + case paymentDetails = "payment_details" - case status = "status" + case refundDetails = "refund_details" - case currency = "currency" + case totalAmount = "total_amount" } - public init(currency: String, gid: String, paymentDetails: PaymentSessionDetail, refundDetails: [RefundSessionDetail]? = nil, status: String, totalAmount: Int) { + public init(currency: String, gid: String, meta: [String: Any]? = nil, paymentDetails: PaymentSessionDetail, refundDetails: [RefundSessionDetail]? = nil, status: String, totalAmount: Int) { + + self.meta = meta self.gid = gid - self.paymentDetails = paymentDetails + self.status = status - self.totalAmount = totalAmount + self.currency = currency - self.refundDetails = refundDetails + self.paymentDetails = paymentDetails - self.status = status + self.refundDetails = refundDetails - self.currency = currency + self.totalAmount = totalAmount } @@ -197,17 +226,34 @@ public extension PlatformClient.ApplicationClient.Payment { let container = try decoder.container(keyedBy: CodingKeys.self) + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch { + + } + + + gid = try container.decode(String.self, forKey: .gid) - paymentDetails = try container.decode(PaymentSessionDetail.self, forKey: .paymentDetails) + status = try container.decode(String.self, forKey: .status) - totalAmount = try container.decode(Int.self, forKey: .totalAmount) + currency = try container.decode(String.self, forKey: .currency) + + + + + paymentDetails = try container.decode(PaymentSessionDetail.self, forKey: .paymentDetails) @@ -224,12 +270,7 @@ public extension PlatformClient.ApplicationClient.Payment { - status = try container.decode(String.self, forKey: .status) - - - - - currency = try container.decode(String.self, forKey: .currency) + totalAmount = try container.decode(Int.self, forKey: .totalAmount) @@ -240,32 +281,37 @@ public extension PlatformClient.ApplicationClient.Payment { + try? container.encodeIfPresent(meta, forKey: .meta) + + + + try? container.encodeIfPresent(gid, forKey: .gid) - try? container.encodeIfPresent(paymentDetails, forKey: .paymentDetails) + try? container.encodeIfPresent(status, forKey: .status) - try? container.encodeIfPresent(totalAmount, forKey: .totalAmount) + try? container.encodeIfPresent(currency, forKey: .currency) - try? container.encodeIfPresent(refundDetails, forKey: .refundDetails) + try? container.encodeIfPresent(paymentDetails, forKey: .paymentDetails) - try? container.encodeIfPresent(status, forKey: .status) + try? container.encodeIfPresent(refundDetails, forKey: .refundDetails) - try? container.encodeIfPresent(currency, forKey: .currency) + try? container.encodeIfPresent(totalAmount, forKey: .totalAmount) } diff --git a/Sources/code/platform/Models/Payment/RefundSessionResponseSerializerPaymentPlatformModel.swift b/Sources/code/platform/Models/Payment/RefundSessionResponseSerializerPaymentPlatformModel.swift index 3b88ed7048..81f9ac0d58 100644 --- a/Sources/code/platform/Models/Payment/RefundSessionResponseSerializerPaymentPlatformModel.swift +++ b/Sources/code/platform/Models/Payment/RefundSessionResponseSerializerPaymentPlatformModel.swift @@ -12,70 +12,70 @@ public extension PlatformClient.Payment { class RefundSessionResponseSerializer: Codable { - public var totalRefundAmount: Int - public var gid: String - public var platformRefundDetails: [[String: Any]] - public var status: String public var currency: String + public var platformRefundDetails: [[String: Any]] + + public var totalRefundAmount: Int + public enum CodingKeys: String, CodingKey { - case totalRefundAmount = "total_refund_amount" - case gid = "gid" - case platformRefundDetails = "platform_refund_details" - case status = "status" case currency = "currency" + case platformRefundDetails = "platform_refund_details" + + case totalRefundAmount = "total_refund_amount" + } public init(currency: String, gid: String, platformRefundDetails: [[String: Any]], status: String, totalRefundAmount: Int) { - self.totalRefundAmount = totalRefundAmount - self.gid = gid - self.platformRefundDetails = platformRefundDetails - self.status = status self.currency = currency + self.platformRefundDetails = platformRefundDetails + + self.totalRefundAmount = totalRefundAmount + } required public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - totalRefundAmount = try container.decode(Int.self, forKey: .totalRefundAmount) + gid = try container.decode(String.self, forKey: .gid) - gid = try container.decode(String.self, forKey: .gid) + status = try container.decode(String.self, forKey: .status) - platformRefundDetails = try container.decode([[String: Any]].self, forKey: .platformRefundDetails) + currency = try container.decode(String.self, forKey: .currency) - status = try container.decode(String.self, forKey: .status) + platformRefundDetails = try container.decode([[String: Any]].self, forKey: .platformRefundDetails) - currency = try container.decode(String.self, forKey: .currency) + totalRefundAmount = try container.decode(Int.self, forKey: .totalRefundAmount) @@ -86,27 +86,27 @@ public extension PlatformClient.Payment { - try? container.encodeIfPresent(totalRefundAmount, forKey: .totalRefundAmount) + try? container.encodeIfPresent(gid, forKey: .gid) - try? container.encodeIfPresent(gid, forKey: .gid) + try? container.encodeIfPresent(status, forKey: .status) - try? container.encodeIfPresent(platformRefundDetails, forKey: .platformRefundDetails) + try? container.encodeIfPresent(currency, forKey: .currency) - try? container.encodeIfPresent(status, forKey: .status) + try? container.encodeIfPresent(platformRefundDetails, forKey: .platformRefundDetails) - try? container.encodeIfPresent(currency, forKey: .currency) + try? container.encodeIfPresent(totalRefundAmount, forKey: .totalRefundAmount) } @@ -125,70 +125,70 @@ public extension PlatformClient.ApplicationClient.Payment { class RefundSessionResponseSerializer: Codable { - public var totalRefundAmount: Int - public var gid: String - public var platformRefundDetails: [[String: Any]] - public var status: String public var currency: String + public var platformRefundDetails: [[String: Any]] + + public var totalRefundAmount: Int + public enum CodingKeys: String, CodingKey { - case totalRefundAmount = "total_refund_amount" - case gid = "gid" - case platformRefundDetails = "platform_refund_details" - case status = "status" case currency = "currency" + case platformRefundDetails = "platform_refund_details" + + case totalRefundAmount = "total_refund_amount" + } public init(currency: String, gid: String, platformRefundDetails: [[String: Any]], status: String, totalRefundAmount: Int) { - self.totalRefundAmount = totalRefundAmount - self.gid = gid - self.platformRefundDetails = platformRefundDetails - self.status = status self.currency = currency + self.platformRefundDetails = platformRefundDetails + + self.totalRefundAmount = totalRefundAmount + } required public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - totalRefundAmount = try container.decode(Int.self, forKey: .totalRefundAmount) + gid = try container.decode(String.self, forKey: .gid) - gid = try container.decode(String.self, forKey: .gid) + status = try container.decode(String.self, forKey: .status) - platformRefundDetails = try container.decode([[String: Any]].self, forKey: .platformRefundDetails) + currency = try container.decode(String.self, forKey: .currency) - status = try container.decode(String.self, forKey: .status) + platformRefundDetails = try container.decode([[String: Any]].self, forKey: .platformRefundDetails) - currency = try container.decode(String.self, forKey: .currency) + totalRefundAmount = try container.decode(Int.self, forKey: .totalRefundAmount) @@ -199,27 +199,27 @@ public extension PlatformClient.ApplicationClient.Payment { - try? container.encodeIfPresent(totalRefundAmount, forKey: .totalRefundAmount) + try? container.encodeIfPresent(gid, forKey: .gid) - try? container.encodeIfPresent(gid, forKey: .gid) + try? container.encodeIfPresent(status, forKey: .status) - try? container.encodeIfPresent(platformRefundDetails, forKey: .platformRefundDetails) + try? container.encodeIfPresent(currency, forKey: .currency) - try? container.encodeIfPresent(status, forKey: .status) + try? container.encodeIfPresent(platformRefundDetails, forKey: .platformRefundDetails) - try? container.encodeIfPresent(currency, forKey: .currency) + try? container.encodeIfPresent(totalRefundAmount, forKey: .totalRefundAmount) } diff --git a/Sources/code/platform/PlatformAPIClient.swift b/Sources/code/platform/PlatformAPIClient.swift index 6a416bd093..becafd4830 100644 --- a/Sources/code/platform/PlatformAPIClient.swift +++ b/Sources/code/platform/PlatformAPIClient.swift @@ -13,7 +13,7 @@ public class PlatformAPIClient { if let token = token { var finalHeaders = headers finalHeaders.append((key: "Authorization", value: "Bearer " + token.accessToken)) - finalHeaders.append((key: "x-fp-sdk-version", value: "1.3.5-beta.3")) + finalHeaders.append((key: "x-fp-sdk-version", value: "1.3.5-beta.4")) finalHeaders.append(contentsOf: config.extraHeaders) if let userAgent = config.userAgent { finalHeaders.append((key: "User-Agent", value: userAgent)) diff --git a/Sources/code/public/PublicAPIClient.swift b/Sources/code/public/PublicAPIClient.swift index 0a421af037..5cc815ebb6 100644 --- a/Sources/code/public/PublicAPIClient.swift +++ b/Sources/code/public/PublicAPIClient.swift @@ -9,7 +9,7 @@ class PublicAPIClient { responseType: String = "application/json", onResponse: @escaping OnResponse) { var headers = [ - (key: "x-fp-sdk-version", value: "1.3.5-beta.3") + (key: "x-fp-sdk-version", value: "1.3.5-beta.4") ] headers.append(contentsOf: extraHeaders) headers.append(contentsOf: config.extraHeaders) diff --git a/documentation/application/ORDER.md b/documentation/application/ORDER.md index 1e03697486..9687e73ab8 100644 --- a/documentation/application/ORDER.md +++ b/documentation/application/ORDER.md @@ -1627,7 +1627,8 @@ Success. Check the example shown below or refer `ShipmentById` for more details. "size": "OS", "code": "TIS-102", "id": 7500474, - "seller_identifier": "987432134" + "seller_identifier": "987432134", + "attributes": {} }, "financial_breakup": [ { @@ -2694,6 +2695,7 @@ Successfully updateShipmentStatus! | slugKey | String? | yes | | | l2Categories | [String]? | yes | | | size | String? | yes | | + | attributes | [String: Any]? | yes | | --- diff --git a/documentation/platform/CART.md b/documentation/platform/CART.md index 2033a7c15a..2a52b7ce48 100644 --- a/documentation/platform/CART.md +++ b/documentation/platform/CART.md @@ -11492,6 +11492,7 @@ Success. Returns available store information with its address as shown below. "state": "MAHA", "store_code": "6462b3cd-9d64-4da9-a764-b0e6a52cf5e8", "uid": 20, + "store_manager_name": "Salma", "geo_location": { "longitude": 1, "latitude": 1 @@ -15377,6 +15378,7 @@ Success. Returns a Cart object as shown below. Refer `CartDetailResponse` for mo | addressType | String? | yes | | | area | String? | yes | | | id | Int? | yes | | + | storeManagerName | String? | yes | | | name | String? | yes | | | storeCode | String? | yes | | | landmark | String? | yes | | diff --git a/documentation/platform/CATALOG.md b/documentation/platform/CATALOG.md index d56149ddc4..7cc5601fc9 100644 --- a/documentation/platform/CATALOG.md +++ b/documentation/platform/CATALOG.md @@ -5,7 +5,7 @@ ##### [Back to Platform docs](./README.md) ## Catalog Methods -Catalog - Platform Front API's' API's allows you to access list of products, prices, seller details, similar features, variants and many more useful features. +Catalog - Platform Front API's' API's allows you to access list of products, prices, seller details, similar features, variants and many more useful features. * [getCatalogInsights](#getcataloginsights) * [getApplicationBrandListing](#getapplicationbrandlisting) * [updateAppBrand](#updateappbrand) @@ -3502,7 +3502,14 @@ The Company Applicaton Product Data(MOQ/SEO). }, "seo": { "description": "test-description", - "title": "test-title" + "title": "test-title", + "breadcrumbs": [], + "sitemap": {}, + "meta_tags": [] + }, + "size_promotion_threshold": { + "threshold_type": "flat", + "threshold_value": 100 } } ``` @@ -16476,6 +16483,7 @@ Returns a success response | isGift | Bool? | yes | Whether the item is a gift or not | | moq | [ApplicationItemMOQ](#ApplicationItemMOQ)? | yes | Minimum Order Quantity information for the item | | seo | [ApplicationItemSEO](#ApplicationItemSEO)? | yes | Search Engine Optimization information for the item | + | sizePromotionThreshold | [SizePromotionThreshold](#SizePromotionThreshold)? | yes | Size level promotion limitation information for item | --- @@ -20789,12 +20797,99 @@ Returns a success response + #### [Sitemap](#Sitemap) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | priority | Double? | yes | | + | frequency | String? | yes | | + +--- + + + + + #### [ApplicationItemSeoAction](#ApplicationItemSeoAction) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [String: Any]? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ApplicationItemSeoBreadcrumbs](#ApplicationItemSeoBreadcrumbs) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String? | yes | | + | action | [[ApplicationItemSeoAction](#ApplicationItemSeoAction)]? | yes | | + +--- + + + + + #### [ApplicationItemSeoMetaTagItem](#ApplicationItemSeoMetaTagItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [ApplicationItemSeoMetaTags](#ApplicationItemSeoMetaTags) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | items | [[ApplicationItemSeoMetaTagItem](#ApplicationItemSeoMetaTagItem)]? | yes | | + +--- + + + + + #### [Metatags](#Metatags) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | items | [[ApplicationItemSeoMetaTags](#ApplicationItemSeoMetaTags)]? | yes | | + +--- + + + + + #### [SizePromotionThreshold](#SizePromotionThreshold) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | thresholdType | String? | yes | | + | thresholdValue | Int? | yes | | + +--- + + + + #### [SEOData](#SEOData) | Properties | Type | Nullable | Description | | ---------- | ---- | -------- | ----------- | | description | String? | yes | | | title | String? | yes | | + | sitemap | [Sitemap](#Sitemap)? | yes | | + | breadcrumbs | [[ApplicationItemSeoBreadcrumbs](#ApplicationItemSeoBreadcrumbs)]? | yes | | + | metaTags | [[Metatags](#Metatags)]? | yes | | --- @@ -20861,6 +20956,9 @@ Returns a success response | ---------- | ---- | -------- | ----------- | | description | String? | yes | | | title | String? | yes | | + | sitemap | [String: Any]? | yes | | + | breadcrumbs | [[ApplicationItemSeoBreadcrumbs](#ApplicationItemSeoBreadcrumbs)]? | yes | | + | metaTags | [[Metatags](#Metatags)]? | yes | | --- diff --git a/documentation/platform/DISCOUNT.md b/documentation/platform/DISCOUNT.md index 158e435418..4b6fc4554a 100644 --- a/documentation/platform/DISCOUNT.md +++ b/documentation/platform/DISCOUNT.md @@ -770,6 +770,7 @@ Success | type | String | no | | | fileType | String | no | | | id | String | no | A unique identifier to distinguish and identify a job. | + | filePath | String | no | | --- diff --git a/documentation/platform/ORDER.md b/documentation/platform/ORDER.md index 3f8be9a8cb..5d862791f3 100644 --- a/documentation/platform/ORDER.md +++ b/documentation/platform/ORDER.md @@ -2723,7 +2723,7 @@ We are processing the report! ```swift -platformClient.order.getOrderById(orderId: orderId) { (response, error) in +platformClient.order.getOrderById(orderId: orderId, myOrders: myOrders) { (response, error) in // Use response } ``` @@ -2734,7 +2734,8 @@ platformClient.order.getOrderById(orderId: orderId) { (response, error) in | Argument | Type | Required | Description | | -------- | ---- | -------- | ----------- | -| orderId | String | yes | | +| orderId | String | yes | | +| myOrders | Bool? | no | | @@ -5965,6 +5966,7 @@ We are processing the request! | meta | [String: Any]? | yes | | | priority | Int? | yes | | | locationId | Int | no | | + | orderType | String? | yes | | --- @@ -6038,6 +6040,23 @@ We are processing the request! + #### [UserInfo](#UserInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | userId | String? | yes | | + | userType | String? | yes | | + | email | String | no | | + | gender | String? | yes | | + | firstName | String | no | | + | lastName | String? | yes | | + | mobile | String | no | | + +--- + + + + #### [TaxInfo](#TaxInfo) | Properties | Type | Nullable | Description | @@ -6095,6 +6114,7 @@ We are processing the request! | taxInfo | [TaxInfo](#TaxInfo)? | yes | | | config | [String: Any]? | yes | | | paymentInfo | [PaymentInfo](#PaymentInfo) | no | | + | userInfo | [UserInfo](#UserInfo) | no | | --- @@ -7939,6 +7959,7 @@ We are processing the request! | shipmentId | String? | yes | | | status | String? | yes | | | displayName | String? | yes | | + | currentShipmentStatus | String? | yes | | --- diff --git a/documentation/platform/PAYMENT.md b/documentation/platform/PAYMENT.md index fff0e4fe38..e8dc05b1f7 100644 --- a/documentation/platform/PAYMENT.md +++ b/documentation/platform/PAYMENT.md @@ -7706,29 +7706,45 @@ Success. Returns the status of Update or not. Check the example shown below or r + #### [OrderDetail](#OrderDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | gid | String | no | Global identifier of the entity (e.g. order, cart etc.) against which payment_session was initiated. This is generated by Fynd payments platform and is unique. | + | amount | Int | no | amount paid. | + | status | String | no | order status created by payment gateway aggregator. | + | currency | String | no | currency of the payment. | + | aggregatorOrderDetails | [String: Any] | no | aggregator order details generated by the payment gateway. | + | aggregator | String | no | name of the payment gateway aggregator. | + +--- + + + + #### [AddressDetail](#AddressDetail) | Properties | Type | Nullable | Description | | ---------- | ---- | -------- | ----------- | - | countryIsoCode | String | no | country's code name e.g. `IN`, `GB` | | googleMapPoint | [String: Any]? | yes | google map point of location | - | country | String | no | country name | - | email | String? | yes | customer email | - | areaCode | String | no | customer pin/zip code | - | city | String | no | city name | + | landmark | String? | yes | landmark | | phone | String | no | phone number | + | countryIsoCode | String | no | country's code name e.g. `IN`, `GB` | + | areaCode | String | no | customer pin/zip code | + | country | String | no | country name | | expireAt | String? | yes | address expiry timestamp | - | address | String | no | address details | - | gAddressId | String | no | unique address id generated by Fynd platform | - | tags | [[String: Any]]? | yes | optional address tag | - | name | String | no | customer name | + | geoLocation | [String: Any]? | yes | location latitude and logitude | | state | String | no | state of the customer | - | landmark | String? | yes | landmark | | area | String | no | area details | + | gAddressId | String | no | unique address id generated by Fynd platform | | areaCodeSlug | String | no | area slug code, use pin/zip code if not available | - | addressType | String | no | address type e.g. home, office | | countryPhoneCode | String | no | country's phone code | - | geoLocation | [String: Any]? | yes | location latitude and logitude | + | name | String | no | customer name | + | addressType | String | no | address type e.g. home, office | + | address | String | no | address details | + | email | String? | yes | customer email | + | city | String | no | city name | + | tags | [[String: Any]]? | yes | optional address tag | --- @@ -7739,43 +7755,27 @@ Success. Returns the status of Update or not. Check the example shown below or r | Properties | Type | Nullable | Description | | ---------- | ---- | -------- | ----------- | - | aggregatorOrderId | String | no | unique order id or payment request id generated by payment gateway | - | shippingAddress | [AddressDetail](#AddressDetail) | no | shipping address | - | amountCaptured | Int | no | amount which is captured or credited to merchant account | - | amountRefunded | Int? | yes | | - | aggregatorCustomerId | String? | yes | unique customer id generated by payment gateway, not required for standard checkout. | - | cancelUrl | String | no | cancel url sent by Fynd platform at the time of payment creation | | paymentId | String | no | unique transaction id generated by payment gateway | - | paymentMethods | [[String: Any]] | no | method of payment | - | created | String? | yes | timestamp in epoch | + | mode | String | no | test or live, test mode uses test credentials so that actual payment is not created. | + | amount | Int | no | amount paid. | + | successUrl | String | no | success url sent by Fynd platform at the time of payment creation | + | shippingAddress | [AddressDetail](#AddressDetail)? | yes | shipping address | | gUserId | String | no | global user identifier - unique user id generated by Fynd platform | | currency | String | no | currency of the payment. | + | merchantLocale | String? | yes | merchant's locale | | locale | String? | yes | user's locale | + | aggregatorOrderId | String | no | unique order id or payment request id generated by payment gateway | | gid | String | no | Global identifier of the entity (e.g. order, cart etc.) against which payment_session was initiated. This is generated by Fynd payments platform and is unique. | - | amount | Int | no | amount paid. | - | billingAddress | [AddressDetail](#AddressDetail) | no | billing address | - | successUrl | String | no | success url sent by Fynd platform at the time of payment creation | - | kind | String? | yes | optional kind of purchase/payment - one time payment (sale) or subcription. defaults to sale. | - | mode | String | no | test or live, test mode uses test credentials so that actual payment is not created. | - | status | String | no | stautus of the payment | - | merchantLocale | String? | yes | merchant's locale | + | cancelUrl | String | no | cancel url sent by Fynd platform at the time of payment creation | + | amountRefunded | Int? | yes | | | captured | Bool? | yes | whether the payment is captured (credited to merchant account) by payment gateway. | - ---- - - - - - #### [OrderDetail](#OrderDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | gid | String | no | Global identifier of the entity (e.g. order, cart etc.) against which payment_session was initiated. This is generated by Fynd payments platform and is unique. | - | aggregator | String | no | name of the payment gateway aggregator. | - | amount | Int | no | amount paid. | - | aggregatorOrderDetails | [String: Any] | no | aggregator order details generated by the payment gateway. | - | status | String | no | order status created by payment gateway aggregator. | - | currency | String | no | currency of the payment. | + | created | String? | yes | timestamp in epoch | + | status | String | no | stautus of the payment | + | kind | String? | yes | optional kind of purchase/payment - one time payment (sale) or subcription. defaults to sale. | + | aggregatorCustomerId | String? | yes | unique customer id generated by payment gateway, not required for standard checkout. | + | paymentMethods | [[String: Any]] | no | method of payment | + | billingAddress | [AddressDetail](#AddressDetail)? | yes | billing address | + | amountCaptured | Int | no | amount which is captured or credited to merchant account | --- @@ -7786,12 +7786,13 @@ Success. Returns the status of Update or not. Check the example shown below or r | Properties | Type | Nullable | Description | | ---------- | ---- | -------- | ----------- | + | meta | [String: Any]? | yes | meta | | gid | String | no | Global identifier of the entity (e.g. order, cart etc.) against which payment_session was initiated. This is generated by Fynd payments platform and is unique. | - | paymentDetails | [[PaymentSessionDetail](#PaymentSessionDetail)] | no | The payment details with the schema `PaymentSessionDetail`. | - | totalAmount | Int | no | amount paid. | - | status | String | no | status of the payment. | | orderDetails | [OrderDetail](#OrderDetail) | no | The details of the order. | + | status | String | no | status of the payment. | | currency | String | no | currency of the payment. | + | paymentDetails | [[PaymentSessionDetail](#PaymentSessionDetail)] | no | The payment details with the schema `PaymentSessionDetail`. | + | totalAmount | Int | no | amount paid. | --- @@ -7804,9 +7805,9 @@ Success. Returns the status of Update or not. Check the example shown below or r | ---------- | ---- | -------- | ----------- | | gid | String | no | Global identifier of the entity (e.g. order, cart etc.) against which payment_session was initiated. This is generated by Fynd payments platform and is unique. | | platformTransactionDetails | [[String: Any]] | no | platform transaction details. | - | totalAmount | Int | no | amount paid. | | status | String | no | status of the payment. | | currency | String | no | currency of the payment. | + | totalAmount | Int | no | amount paid. | --- @@ -7818,17 +7819,17 @@ Success. Returns the status of Update or not. Check the example shown below or r | Properties | Type | Nullable | Description | | ---------- | ---- | -------- | ----------- | | refundUtr | String? | yes | Unique refund utr generated by payment gateway. | - | receiptNumber | String? | yes | unique receipt for refund, generated by payment gateway, if not available can be utr. | - | balanceTransaction | String? | yes | balance transaction. | - | paymentId | String | no | Unique payment id generated by payment gateway. | - | created | String | no | timestamp in epoch. | | requestId | String | no | refund request id, unique id generated by Fynd platform | - | transferReversal | String? | yes | description in case of reversal of payment. | + | paymentId | String | no | Unique payment id generated by payment gateway. | | amount | Int | no | amount refunded. | + | reason | String? | yes | reason for refund, optional | | status | String | no | status of the refund. | + | created | String | no | timestamp in epoch. | | sourceTransferReversal | String? | yes | description in case of reversal of payment. | + | receiptNumber | String? | yes | unique receipt for refund, generated by payment gateway, if not available can be utr. | | currency | String | no | currency of the payment. | - | reason | String? | yes | reason for refund, optional | + | transferReversal | String? | yes | description in case of reversal of payment. | + | balanceTransaction | String? | yes | balance transaction. | --- @@ -7839,12 +7840,13 @@ Success. Returns the status of Update or not. Check the example shown below or r | Properties | Type | Nullable | Description | | ---------- | ---- | -------- | ----------- | + | meta | [String: Any]? | yes | meta | | gid | String | no | Global identifier of the entity (e.g. order, cart etc.) against which payment_session was initiated. This is generated by Fynd payments platform and is unique. | - | paymentDetails | [PaymentSessionDetail](#PaymentSessionDetail) | no | details of the payment | - | totalAmount | Int | no | The total amount refunded. | - | refundDetails | [[RefundSessionDetail](#RefundSessionDetail)]? | yes | details of the refund | | status | String | no | The status of the refund. | | currency | String | no | The currency of the payment. | + | paymentDetails | [PaymentSessionDetail](#PaymentSessionDetail) | no | details of the payment | + | refundDetails | [[RefundSessionDetail](#RefundSessionDetail)]? | yes | details of the refund | + | totalAmount | Int | no | The total amount refunded. | --- @@ -7855,11 +7857,11 @@ Success. Returns the status of Update or not. Check the example shown below or r | Properties | Type | Nullable | Description | | ---------- | ---- | -------- | ----------- | - | totalRefundAmount | Int | no | The total amount refunded. | | gid | String | no | Global identifier of the entity (e.g. order, cart etc.) against which payment_session was initiated. This is generated by Fynd payments platform and is unique. | - | platformRefundDetails | [[String: Any]] | no | details of the refund | | status | String | no | The status of the refund. | | currency | String | no | The currency of the payment. | + | platformRefundDetails | [[String: Any]] | no | details of the refund | + | totalRefundAmount | Int | no | The total amount refunded. | --- diff --git a/documentation/platform/README.md b/documentation/platform/README.md index cdb5e3dff6..fe79938a35 100644 --- a/documentation/platform/README.md +++ b/documentation/platform/README.md @@ -6,7 +6,7 @@ * [AuditTrail](AUDITTRAIL.md) - Audit Logging Service that logs the crucial updates on the Platform * [Billing](BILLING.md) - Handle platform subscription * [Cart](CART.md) - Cart APIs -* [Catalog](CATALOG.md) - Catalog - Platform Front API's' API's allows you to access list of products, prices, seller details, similar features, variants and many more useful features. +* [Catalog](CATALOG.md) - Catalog - Platform Front API's' API's allows you to access list of products, prices, seller details, similar features, variants and many more useful features. * [Common](COMMON.md) - Application configuration apis * [Communication](COMMUNICATION.md) - Manages email, sms, push notifications sent to users * [CompanyProfile](COMPANYPROFILE.md) - Catalog CBS - platform Front API's