Skip to content

Commit

Permalink
[Auto Generated] 1.4.12-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jigardafda committed Sep 27, 2024
1 parent e22219c commit 987c241
Show file tree
Hide file tree
Showing 30 changed files with 8,453 additions and 4,015 deletions.
7,865 changes: 7,855 additions & 10 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion FDKClient.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Pod::Spec.new do |s|
s.name = 'FDKClient'
s.version = '1.4.10-beta.2'
s.version = '1.4.12-beta.1'
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.'
Expand Down
2 changes: 1 addition & 1 deletion Sources/code/application/ApplicationAPIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.10-beta.2"))
headers.append((key: "x-fp-sdk-version", value: "1.4.12-beta.1"))
headers.append(contentsOf: config.extraHeaders)
if let userAgent = config.userAgent {
headers.append((key: "User-Agent", value: userAgent))
Expand Down
18 changes: 18 additions & 0 deletions Sources/code/application/ApplicationPageType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public extension ApplicationClient.Content {
case shippingPolicy = "shipping-policy"
case returnPolicy = "return-policy"
case orderStatus = "order-status"
case locateUs = "locate-us"

init?(path: String) {
let slash = CharacterSet(charactersIn: "/")
Expand Down Expand Up @@ -203,6 +204,8 @@ public extension ApplicationClient.Content {
return "/return-policy"
case .orderStatus:
return "/cart/order-status"
case .locateUs:
return "/locate-us"
}
}

Expand Down Expand Up @@ -303,6 +306,8 @@ public extension ApplicationClient.Content {
return "Return policy"
case .orderStatus:
return "Order status"
case .locateUs:
return "Locate us"
}
}

Expand Down Expand Up @@ -403,6 +408,8 @@ public extension ApplicationClient.Content {
return []
case .orderStatus:
return []
case .locateUs:
return []
}
}

Expand Down Expand Up @@ -503,6 +510,8 @@ public extension ApplicationClient.Content {
return []
case .orderStatus:
return []
case .locateUs:
return []
}
}
}
Expand Down Expand Up @@ -575,6 +584,7 @@ public extension ApplicationClient.Theme {
case shippingPolicy = "shipping-policy"
case returnPolicy = "return-policy"
case orderStatus = "order-status"
case locateUs = "locate-us"

init?(path: String) {
let slash = CharacterSet(charactersIn: "/")
Expand Down Expand Up @@ -716,6 +726,8 @@ public extension ApplicationClient.Theme {
return "/return-policy"
case .orderStatus:
return "/cart/order-status"
case .locateUs:
return "/locate-us"
}
}

Expand Down Expand Up @@ -816,6 +828,8 @@ public extension ApplicationClient.Theme {
return "Return policy"
case .orderStatus:
return "Order status"
case .locateUs:
return "Locate us"
}
}

Expand Down Expand Up @@ -916,6 +930,8 @@ public extension ApplicationClient.Theme {
return []
case .orderStatus:
return []
case .locateUs:
return []
}
}

Expand Down Expand Up @@ -1016,6 +1032,8 @@ public extension ApplicationClient.Theme {
return []
case .orderStatus:
return []
case .locateUs:
return []
}
}
}
Expand Down
80 changes: 8 additions & 72 deletions Sources/code/application/Client/CartApplicationClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ extension ApplicationClient {

ulrs["getShipments"] = config.domain.appendAsPath("/service/application/cart/v1.0/shipment")

ulrs["checkoutCart"] = config.domain.appendAsPath("/service/application/cart/v1.0/checkout")

ulrs["updateCartMeta"] = config.domain.appendAsPath("/service/application/cart/v1.0/meta")

ulrs["getCartShareLink"] = config.domain.appendAsPath("/service/application/cart/v1.0/share-cart")
Expand Down Expand Up @@ -878,7 +876,7 @@ extension ApplicationClient {

/**
*
* Summary: List customer addresses
* Summary: Get a list of addresses for a customer
* Description: List all addresses saved by the customer, simplifying the checkout process by offering pre-saved address options for delivery.
**/
public func getAddresses(
Expand Down Expand Up @@ -960,7 +958,7 @@ extension ApplicationClient {

/**
*
* Summary: Create a new address
* Summary: Creates a new address for a customer
* Description: Add a new address to their cart to save details such as name, email, contact information, and address.
**/
public func addAddress(
Expand Down Expand Up @@ -1012,7 +1010,7 @@ extension ApplicationClient {

/**
*
* Summary: Get a address
* Summary: Get details for a single customer address
* Description: Get a specific customer address stored in the system by providing its unique identifier. This API provides detailed information about the address, including the recipient's name, address, city, postal code, and other relevant details.
**/
public func getAddressById(
Expand Down Expand Up @@ -1097,7 +1095,7 @@ extension ApplicationClient {

/**
*
* Summary: Update a address
* Summary: Updates an existing customer address
* Description: Customer can modify the details of a previously saved addresses.
**/
public func updateAddress(
Expand Down Expand Up @@ -1152,7 +1150,7 @@ extension ApplicationClient {

/**
*
* Summary: Delete a address
* Summary: Removes an address from a customer's address list
* Description: Delete an existing customer address from the system.
**/
public func removeAddress(
Expand Down Expand Up @@ -1207,7 +1205,7 @@ extension ApplicationClient {

/**
*
* Summary: Select a delivery address
* Summary: Select customer address for order processing
* Description: Select an address from the saved customer addresses and validates the availability of items in the cart. Additionally, it verifies and updates the delivery promise based on the selected address.
**/
public func selectAddress(
Expand Down Expand Up @@ -1533,68 +1531,6 @@ extension ApplicationClient {
}


/**
*
* Summary: Checkout cart
* Description: The checkout cart initiates the order creation process based on the selected address and payment method. It revalidates the cart details to ensure safe and seamless order placement.
**/
public func checkoutCart(
buyNow: Bool?,
cartType: String?,
body: CartCheckoutDetailRequest,
headers: [(key: String, value: String)]? = nil,
onResponse: @escaping (_ response: CartCheckoutResponse?, _ error: FDKError?) -> Void
) {

var xQuery: [String: Any] = [:]

if let value = buyNow {
xQuery["buy_now"] = value
}

if let value = cartType {
xQuery["cart_type"] = value
}

var xHeaders: [(key: String, value: String)] = []


if let headers = headers {
xHeaders.append(contentsOf: headers)
}

let fullUrl = relativeUrls["checkoutCart"] ?? ""

ApplicationAPIClient.execute(
config: config,
method: "POST",
url: fullUrl,
query: xQuery,
extraHeaders: xHeaders,
body: body.dictionary,
responseType: "application/json",
onResponse: { (responseData, error, responseCode) in
if let _ = error, let data = responseData {
var err = Utility.decode(FDKError.self, from: data)
if err?.status == nil {
err?.status = responseCode
}
onResponse(nil, err)
} else if let data = responseData {

let response = Utility.decode(CartCheckoutResponse.self, from: data)

onResponse(response, nil)
} else {
let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") ,
NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")]
let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo)
onResponse(nil, err)
}
});
}


/**
*
* Summary: Update cart metadata
Expand Down Expand Up @@ -2032,8 +1968,8 @@ extension ApplicationClient {

/**
*
* Summary: Start cart checkout (latest)
* Description: Enhanced version of checkout process that supports multiple mode of payment(MOP).
* Summary: Checkout cart
* Description: The checkout cart initiates the order creation process based on the items in the user’s cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement.
**/
public func checkoutCartV2(
buyNow: Bool?,
Expand Down
7 changes: 0 additions & 7 deletions Sources/code/application/FileStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,4 @@ public extension ApplicationClient.FileStorage {
}
}
}

// func upload(image: UIImage, withFileName fileName: String, as contentType: String, toNameSpace namespace: String, onResponse: @escaping (_ response: ApplicationClient.CompleteResponse?, _ error: FDKError?) -> Void) {
// guard let data = image.pngData() else {
// return onResponse(nil, FDKError(message: "Image could not be converted to data"))
// }
// upload(data: data, withFileName: fileName, as: contentType, toNameSpace: namespace, onResponse: onResponse)
// }
}

This file was deleted.

Loading

0 comments on commit 987c241

Please sign in to comment.