A simple to use iOS/tvOS/watchOS SDK to help get you off the ground quickly and efficiently with your Elastic Path Commerce Cloud written in Swift.

Overview

Elastic Path Commerce Cloud iOS Swift SDK

CocoaPods Compatible Carthage Compatible follow on Twitter

A simple to use iOS/tvOS/watchOS SDK to help get you off the ground quickly and efficiently with your Elastic Path Commerce Cloud written in Swift.

📚 API reference 📚 Elastic Path Commerce Cloud

Requirements

  • iOS 10.0+ / tvOS 10.0+ / watchOS 3.0+
  • Swift 4.0+

Installation

Cocoapods

Add the following to your Podfile:

pod 'Moltin', '~> 3.1.2'

Or, quickly try out our examples:

pod try Moltin

Carthage

Add the following to your Cartfile:

3.1.2">
github "Moltin/ios-sdk" ~> 3.1.2

Swift Package Manager

Add the following to your dependencies value in Package.swift:

dependencies: [
    .package(url: "https://github.com/moltin/ios-sdk.git", from: "3.1.2")
]

Usage

Making a request

") moltin.product.all { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } } moltin.product.get("") { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } } moltin.product.tree { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")

moltin.product.all { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

moltin.product.get("") { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

moltin.product.tree { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Checking out & Payment

Paying for a cart is a two step process in Moltin.

First, check out your cart, which will return you an order:

self.moltin.cart.checkout(
    cart: ...,
    withCustomer: ...,
    withBillingAddress: ...,
    withShippingAddress: ...) { (result) in
    switch result {
        case .success(let order):
            ...
        default: break
    }
}

Now that you have an order, you can pay for your order. Moltin providers several gateways for you to use:

  • Stripe
  • BrainTree
  • Adyen
  • Manual

Once you've chosen your payment gateway, you can fulfil one of Moltin's PaymentMethod's:

let paymentMethod = StripeToken(withStripeToken: ...)

You can then use this payment method to pay for an order:

self.moltin.cart.pay(
    forOrderID: order.id,
    withPaymentMethod: paymentMethod) { (result) in
    ...
}

Config

The basic way to set up the Moltin SDK is to create an instance of the Moltin class with your client ID and optionally the locale of the application. However, if you'd like to change additional details of the SDK, such as the URL of your Moltin instance, you can do so by passing in MoltinConfig.

let moltin = Moltin(withClientID: ...) // Takes Locale.current
let moltin = Moltin(withClientID: ..., withLocale: ...)
let config = MoltinConfig(
    clientID: ...,
    scheme: ...,
    host: ...,
    version: ...,
    locale: ...)

let moltin = Moltin(withConfiguration: config)

Or:

let config = MoltinConfig.default(
    withClientID: ...,
    withLocale: ...)

let moltin = Moltin(withConfiguration: config)

Available Resources

  • Brands
  • Carts
  • Categories
  • Collections
  • Currencies
  • Files
  • Flows
  • Fields
  • Entries
  • Products

Authentication

Authentication is handled silently for you as part of the SDK. The SDK will cache credentials to ensure that it is not making unnecessary requests.

The iOS SDK only supports Implicit authentication currently.

Filtering

Operations

  • Filter
  • Sort
  • Offset / Limit
  • Include

Filter

moltin.product.filter(operator: .eq, key: "name", value: "ProductName").all {
   ...
}

Sort

moltin.product.sort("order").all {
   ...
}
moltin.product.sort("-order").all {
   ...
}

Offset / Limit

moltin.product.limit(10).offset(20).all {
    ...
}

Include

moltin.product.include([.mainImage, .files]).all {
    ...
}

Combining Operations

moltin.product.sort("-name").include([.mainImage]).limit(20).all {
   ...
}

Flows

If you've implemented a custom field on a resource by using flows, you can cast this to a type of your choice by type-hinting your result, so long as this type conforms to Codable:

moltin.product.all { (result: Result<PaginatedResponse<[MyCustomProduct]>>) in
    switch result {
        case .success(let response):
            print(response.data) // [MyCustomProduct]
        case .failure(_):
            break
    }
}
") { (result: Result) in switch result { case .success(let response): print(response) // MyCustomProduct case .failure(_): break }">
moltin.product.get(forID: "") { (result: Result<MyCustomProduct>) in
    switch result {
    case .success(let response):
        print(response) // MyCustomProduct
    case .failure(_):
        break
    }

We recommend ensuring that your types extend from our base types for safety, then you implement the required init(from decoder: Decoder):

class MyCustomProduct: moltin.Product {
    let author: Author

    enum ProductCodingKeys : String, CodingKey {
        case author
    }

    required init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy: ProductCodingKeys.self)
        self.author = try container.decode(Author.self, forKey: .author)
        try super.init(from: decoder)
    }
}

This will allow you to add additional types as you need, but ensures the base type, such as product, is still parsed correctly.

Examples

The Swift SDK is a community-supported software development kit for Elastic Path Commerce Cloud (formerly Moltin). The following examples show you how to use the SDK to make requests to the Commerce Cloud APIs.

For details about the endpoints, objects, and responses, see the Elastic Path Commerce API Reference.

Basics

Includes

Examples of using include with resources. For more information, see Includes.

Include category products

") let id = "XXXX" moltin.category.include([.products]).get(forID: id) { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
let id = "XXXX"
moltin.category.include([.products]).get(forID: id) { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Include product main_image

") let id = "XXXX" moltin.product.include([.main_image]).all { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
let id = "XXXX"
moltin.product.include([.main_image]).all { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Multiple includes

") let id = "XXXX" moltin.product.include([.main_image, .category]).all { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
let id = "XXXX"
moltin.product.include([.main_image, .category]).all { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Pagination

Examples of using pagination with resources. For more information, see Pagination.

Get all categories, two per page

") moltin.product.limit(2).all { // Do something }">
let moltin = Moltin(withClientID: "")
moltin.product.limit(2).all {
  // Do something
}

Get products 21-30

") moltin.product.limit(10).offset(20).all { // Do something }">
let moltin = Moltin(withClientID: "")
moltin.product.limit(10).offset(20).all {
  // Do something
}

Filtering

Examples of using different filter operators. For more information, see Filtering.

The eq operator

") moltin.product.filter(operator: .eq, key: "commodity_type", value: "digital").all { // Do something }">
let moltin = Moltin(withClientID: "")
moltin.product.filter(operator: .eq, key: "commodity_type", value: "digital").all {
  // Do something
}

The like operator - A string begins with a specified value

") moltin.product.filter(operator: .like, key: "sku", value: "SHOE_DECK_*").all { // Do something }">
let moltin = Moltin(withClientID: "")
moltin.product.filter(operator: .like, key: "sku", value: "SHOE_DECK_*").all {
  // Do something
}

The like operator - A string contains a specified value

") moltin.product.filter(operator: .like, key: "sku", value: "*_DECK_*").all { // Do something }">
let moltin = Moltin(withClientID: "")
moltin.product.filter(operator: .like, key: "sku", value: "*_DECK_*").all {
  // Do something
}

The like operator - A string ends with a specified value

") moltin.product.filter(operator: .like, key: "sku", value: "*_RED").all { // Do something }">
let moltin = Moltin(withClientID: "")
moltin.product.filter(operator: .like, key: "sku", value: "*_RED").all {
  // Do something
}

Chaining multiple operators

Caution: This feature is currently in Beta and you should expect it to change.

") moltin.product .filter(operator: .eq, key: "commodity_type", value: "physical") .sort("created_at") .all { // Do something }">
let moltin = Moltin(withClientID: "")
moltin.product
  .filter(operator: .eq, key: "commodity_type", value: "physical")
  .sort("created_at")
  .all {
  // Do something
}

Sorting

Examples of using sort with resources. For more information, see Sorting.

Sort products by created_at in ascending order

") moltin.product.sort("created_at").all { // Do something }">
let moltin = Moltin(withClientID: "")
moltin.product.sort("created_at").all {
  // Do something
}

Sort products by created_at in descending order

") moltin.product.sort("-created_at").all { // Do something }">
let moltin = Moltin(withClientID: "")
moltin.product.sort("-created_at").all {
  // Do something
}

Tokens

Get an implicit access token

An implicit token can be thought of as a Read only token.

")">
let moltin = Moltin(withClientID: "")

Currency

Get a currency

") let id = "XXXX" moltin.currency.get(forID: id) { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
let id = "XXXX"
moltin.currency.get(forID: id) { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Get all currencies

") moltin.currency.all { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
moltin.currency.all { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Products

Get all products

") self.moltin.product.include([.mainImage]).all { (result: Result>) in switch result { case .success(let response): DispatchQueue.main.async { self.products = response.data ?? [] } case .failure(let error): print("Products error", error) } } }">
let moltin = Moltin(withClientID: "")
self.moltin.product.include([.mainImage]).all { (result: Result<PaginatedResponse<[moltin.Product]>>) in
   switch result {
       case .success(let response):
            DispatchQueue.main.async {
                self.products = response.data ?? []
            }
        case .failure(let error):
            print("Products error", error)
        }
    }
}

Get all products that belong to a category

") moltin.product.filter(operator: .eq, key: "category.id", value: "xxxx").all { response in // Do something }">
let moltin = Moltin(withClientID: "")
moltin.product.filter(operator: .eq, key: "category.id", value: "xxxx").all {
response in
// Do something
}

Get a product

") let id = "XXXX" moltin.product.get(forID: id) { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
let id = "XXXX"
moltin.product.get(forID: id) { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Brands

Get all brands

") moltin.brand.all { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
moltin.brand.all { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Get a brand

") let id = "XXXX" moltin.brand.get(forID: id) { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
let id = "XXXX"
moltin.brand.get(forID: id) { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Categories

Get all categories

") moltin.category.all { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
moltin.category.all { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Get a category

") let id = "XXXX" moltin.category.get(forID: id) { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
let id = "XXXX"
moltin.category.get(forID: id) { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Get the categories tree

") moltin.category.tree { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
moltin.category.tree { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Collections

Get all collections

") moltin.collection.all { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
moltin.collection.all { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Get a collection

") let id = "XXXX" moltin.collection.get(forID: id) { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
let id = "XXXX"
moltin.collection.get(forID: id) { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Carts

Get a cart

") self.moltin.cart.get(forID: AppDelegate.cartID, completionHandler: { (result) in switch result { case .success(let result): DispatchQueue.main.async { print("Cart:", result) } case .failure(let error): print("Cart error:", error) } })">
let moltin = Moltin(withClientID: "")
self.moltin.cart.get(forID: AppDelegate.cartID, completionHandler: { (result) in
    switch result {
        case .success(let result):
            DispatchQueue.main.async {
                print("Cart:", result)
                }
            case .failure(let error):
                print("Cart error:", error)
            }
    })

Get cart items

") let referenceId = 'XXXX' self.moltin.cart.items(forCartID: referenceId) { (result) in switch result { case .success(let result): DispatchQueue.main.async { print("Cart items:", result.data) } case .failure(let error): print("Cart error:", error) } } }">
let moltin = Moltin(withClientID: "")
let referenceId = 'XXXX'
self.moltin.cart.items(forCartID: referenceId) { (result) in
    switch result {
        case .success(let result):
            DispatchQueue.main.async {
                 print("Cart items:", result.data)
            }
            case .failure(let error):
                print("Cart error:", error)
            }
        }
    }

Add a product to a cart

") let referenceId = 'XXXX' let productId = 'XXXX' let productQty = 'XXXX' self.moltin.cart.addProduct(withID: productId , ofQuantity: productQty, toCart: referenceId, completionHandler: { (_) in })">
let moltin = Moltin(withClientID: "")
let referenceId = 'XXXX'
let productId = 'XXXX'
let productQty = 'XXXX'
self.moltin.cart.addProduct(withID: productId , ofQuantity: productQty, toCart: referenceId, completionHandler: { (_) in
})

Add a promotion to a cart

") let referenceId = 'XXXX' self.moltin.cart.addPromotion(code, toCart: referenceId) { (result) in switch result { case .success(let status): DispatchQueue.main.async { print("Promotion: (status)") } default: break } } }">
let moltin = Moltin(withClientID: "")
let referenceId = 'XXXX'
self.moltin.cart.addPromotion(code, toCart: referenceId) { (result) in
    switch result {
        case .success(let status):
            DispatchQueue.main.async {
                print("Promotion: (status)")
            }
            default: break
            }
        }
}

Check out a cart

") moltin.cart.checkout( cart: ..., withCustomer: ..., withBillingAddress: ..., withShippingAddress: ...) { (result) in switch result { case .success(let order): ... default: break } }">
let moltin = Moltin(withClientID: "")
moltin.cart.checkout(
    cart: ...,
    withCustomer: ...,
    withBillingAddress: ...,
    withShippingAddress: ...) { (result) in
    switch result {
        case .success(let order):
            ...
        default: break
    }
}

Delete a cart

") let referenceId = 'XXXX' self.moltin.cart.deleteCart(referenceId, completionHandler: { (result) in switch result { case .success(let result): print("Cart error:", result) case .failure(let error): print("Cart error:", error) } })">
let moltin = Moltin(withClientID: "")
let referenceId = 'XXXX'
self.moltin.cart.deleteCart(referenceId, completionHandler: { (result)    in
    switch result {
        case .success(let result):
            print("Cart error:", result)
        case .failure(let error):
            print("Cart error:", error)
        }
})

Customers

Get a customer

") let id = "XXXX" moltin.customer.get(forID: id) { result in switch result { case .success(let response): print(response) case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
let id = "XXXX"
moltin.customer.get(forID: id) { result in
    switch result {
        case .success(let response):
            print(response)
        case .failure(let error):
            print(error)
    }
}

Payments

Create a Stripe payment

") let paymentMethod = StripeToken(withStripeToken: ...) moltin.cart.pay( forOrderID: order.id, withPaymentMethod: paymentMethod) { (result) in ... }">
let moltin = Moltin(withClientID: "")
let paymentMethod = StripeToken(withStripeToken: ...)
moltin.cart.pay(
    forOrderID: order.id,
    withPaymentMethod: paymentMethod) { (result) in
    ...
}

Create a manually authorize payment

") let id = "XXXX" let paymentMethod = ManuallyAuthorizePayment() moltin.cart.pay(forOrderID: order.id, withPaymentMethod: paymentMethod) { (result) in switch result { case .success: print("Success") case .failure(let error): print(error) } }">
let moltin = Moltin(withClientID: "")
let id = "XXXX"
let paymentMethod = ManuallyAuthorizePayment()
moltin.cart.pay(forOrderID: order.id, withPaymentMethod: paymentMethod) { (result) in
    switch result {
        case .success:
            print("Success")
        case .failure(let error):
            print(error)
    }
}

Further Documentation

Find more general documentation on the API docs.

Communication

  • If you need help with the SDK or the platform, get in touch on the forum
  • If you found a bug with the SDK, open an issue on GitHub
  • If you have a feature request for the SDK, open an issue.
  • If you want to contribute to the SDK, submit a pull request.

License

Moltin is available under the MIT license. See the LICENSE file for more info.

Comments
  • App Installation Failed

    App Installation Failed

    I'm sorry to say that the Moltin module is still not working. While version 3.0.6 fixed the problem with the import statement, the pod is still broken. Attached is a video of a clean Xcode project (seen to run successfully) and also a video of the Moltin pod added to it. After the Moltin pod is added, the import statement is read correctly but upon run the app fails to install. A quick response to this would be greatly appreciated as I'm trying my best to enjoy Moltin but there seems to be no end of problems with it. Video 1 (Without Moltin): https://drive.google.com/file/d/1bIDsQqryrm-EGcHtumxY25-eHeTRLmdX/view?usp=sharing Video 2 (With Moltin): https://drive.google.com/file/d/1czsb0rnhbrnE5WUe4BBM0_ngvfwI50jU/view?usp=sharing

    opened by x697 7
  • No Such Module 'Moltin'

    No Such Module 'Moltin'

    I followed instruction and installed the pod file to my project. I open the workspace and clean and build it. I then try to import Moltin, but "no such module" is found. I created a bridging header containing the statement: "#import <Moltin/Moltin.h>". I have the compiling settings for objective c in build settings set to the bridging header I created. I've tried several solutions, but nothing works. Help with this issue would be greatly appreciated.

    opened by x697 7
  • Correct the spelling of CocoaPods in README

    Correct the spelling of CocoaPods in README

    This pull requests corrects the spelling of CocoaPods 🤓 https://github.com/CocoaPods/shared_resources/tree/master/media

    Created with cocoapods-readme.

    opened by ReadmeCritic 2
  • Custom cart items

    Custom cart items

    Allows the user to follow the docs and pass a custom object that represents a product. It is up to the user to follow the docs to make sure the payload has all of the required data.

    This is unlike other moltin objects as it is meant to give the user freedom to pass through their needed data, ie shipping and other add ons.

    Do not think should remove CustomCartItem yet

    Status

    • 🚧 WIP

    Notes

    Do not think should remove CustomCartItem yet

    opened by gje4 1
  • made file dimensions and weight/height optionals.

    made file dimensions and weight/height optionals.

    @craigtweedy when you have a second. This is per our conversation yesterday about files.

    Status

    • ✅ Ready

    Type

    Fixes a bug

    Description

    FileDimensions can be blank for some reason.

    Notes

    https://moltin.atlassian.net/browse/CA-535 , open question about how dimensions can be blank.

    opened by gje4 1
  • Cart return types

    Cart return types

    Status

    • ✅ Ready

    Type

    Fixes a bug
    https://github.com/moltin/ios-sdk/issues/36 Style bug nor adds a feature

    Description

    Small change the cart request. Change the return type of remove item to be cart item instead of cart.

    opened by gje4 1
  • V2

    V2

    Status

    • ✅ Ready * 🚧 WIP * ⛔ Hold

    Type

    • Feature

      Implements a new feature * ### Fix Fixes a bug * ### Docs Documentation only changes * ### Style Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) *

    Refactor

    A code change that neither fixes a bug nor adds a feature * ### Performance A code change that improves performance * ### Test Adding missing or correcting existing tests * ### Chore Changes to the build process or auxiliary tools and libraries such as documentation generation

    Description

    A brief description of the goals of the pull request.

    Dependencies

    Other PRs or builds that this PR depends on.

    Issues

    A list of issues closed by this PR. * Fixes #

    Notes

    Any additional notes.

    opened by minghoe 1
  • Feature/2.1

    Feature/2.1

    Status

    • ✅ Ready

    Type

    • Feature

      Implements a few more features for configuration and flow support, as well as implementing additional resources. Implements new example applications.
    • Docs

      Adds full documentation for the SDK, as well as exporting the documentation with jazzy
    • Refactor

      Refactored entire internals in order to support flows, as well as remove dependencies on 3rd party libraries, and generally make the SDK more flexible for any future plans, such as implement additional parsers or various other operations (cancel / resume requests, XML, extending filters and query parameters). The new structure also allows the SDK to be deployed to multiple platforms, such as tvOS, macOS, as well as multiple installation methods, such as CocoaPods, Carthage, and Swift Package Manager
    • Test

      Adds suite of tests for iOS, with plans to be able to test via tvOS and macOS
    • Chore

      Adds fastlane config, and CircleCI config. Adds Sourcery files for automatically generating standard resources and tests.

    Description

    The goal of this PR is an overhaul of the SDK to ensure it is more maintainable, flexible, and reliable. The PR essentially starts over from a clean slate, however it maintains some standard conventions from the previous versions in order to not drift the API too far away from what is expected.

    This PR acheives this by:

    • Refactored internals of the SDK in order to remove dependencies on 3rd party libraries such as Gloss and AlamoFire
    • Use Codable in order to support easy extension of any internal models for use with Flows
    • Keeps the conventions of moltin.<resource>.<operation> (moltin.product.all), however allows this to be extensible by removing the singleton / static modifiers, instead the Moltin object should be instanstiated whenever it is needed.
    • Moves the query and filtering more in line with other Moltin SDK's, such as the JS SDK, with allows us to do dynamic querying on each resource, such as moltin.product.filter(...).limit(1).offset(10).all

    Dependencies

    None

    Notes

    Being as this is a large overhaul, we should scrutinise it as much as possible.

    opened by craigtweedy 1
  • Consider Changing Class Prefix

    Consider Changing Class Prefix

    Perhaps for version 2, you should re-consider the two-letter MT prefix. Generally Cocoa apps are encouraged to use a three-letter prefix to avoid clashes with system frameworks.

    "Two-letter prefixes like these are reserved by Apple for use in framework classes." from https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Conventions/Conventions.html

    opened by cdstamper 1
  • Some trivial updates to the readme file :tada:

    Some trivial updates to the readme file :tada:

    • Forced formatting on code examples
    • Some structure changes
    • Some word changes

    Basically just wanted to actually contribute something to this, because I have no idea how the code actually works... its like some kind of

    opened by outrunthewolf 1
  • Adds support for cart item taxes

    Adds support for cart item taxes

    Status

    • ✅ Ready

    Type

    • Feature

      Implements a new feature

    Description

    Adds support for tax objects in the cart item responses, as well as including the ability to request additional information about cart item taxes.

    opened by craigtweedy 0
  • Add Transaction information for OrderSuccess

    Add Transaction information for OrderSuccess

    Status

    • ✅ Ready

    Type

    • Feature

      Implements a new feature

    Description

    Adds a Transaction object, which defines the transactions from the payment gateway. The OrderSuccess object, which was previously empty, now extends Transaction.

    opened by craigtweedy 0
  • Pagination utilities

    Pagination utilities

    Status

    • 🚧 WIP

    Feature

    Implements a new feature

    Description

    Adds some utility functions to the PaginatedResponse class which allows for simpler iteration through pages.

    moltin.product.all { (result) in
        guard case .success(let firstPage) = result else { return }
        
        print(firstPage)
        var currentPage = firstPage
        
        while currentPage.links?["next"] != nil {
            currentPage.next(withConfig: moltin.config) { (paginatedResult) in
                guard case .success(let nextPage) = paginatedResult else { return }
                currentPage = nextPage
                print(currentPage)
            }
        }
    }
    

    Notes

    Ideally, I'd not want the configuration to be specified again for each function, however, the response class does not have any understanding of the request that made it, so that would have to change and I'm not sure if I want that right now.

    opened by craigtweedy 4
  • Codable encoder key strategy update

    Codable encoder key strategy update

    Status

    • ✅ Ready

    Type

    Refactor

    A code change that neither fixes a bug nor adds a feature

    Description

    Swift 4.1 brought key encoding strategies, negating the need to manually specify which keys in the JSON match to properties in the object. We can now use an automatic snake_case to camelCase decoder rather than specify it manually.

    opened by craigtweedy 0
  • updating user

    updating user

    I'm trying to update the customer object but I get this error error = "You do not have access to the (write) customers scope"; and there's no way to change the permission scope for the customer.

    How can I achieve this with the iOS sdk? Should I implement the API call by myself skipping the SDK?

    opened by smoi 1
  • Finding products by brand (SWIFT)

    Finding products by brand (SWIFT)

    I am trying to find a subset of Product by brand. However, I cannot find any examples of how to query by Product.brand. I have tried the brand.title & brand.ID as the values but have been unsuccessful.

    Moltin.sharedInstance().product.searchWithParameters(["brand": **?????**])

    opened by Natelegreat1 3
Releases(3.0.5)
Owner
Moltin
Microservices for commerce
Moltin
Evernote Cloud SDK for iOS

Evernote Cloud SDK 3.0 for iOS This is the official Evernote SDK for iOS. To get started, follow the instructions bellow. Additional information can b

Evernote 256 Oct 6, 2022
A platform where NYUAD students can both Help and Seek Help.

A platform where NYUAD students can both Help and Seek Help.

Omar Rayyan 0 Nov 7, 2021
A PocketBase client for iOS, macOS, watchOS, and tvOS

PocketBase A pure Swift client for interfacing with a PocketBase instance. Getting Started Development Environment Easiest way to get started with Poc

Brianna Zamora 10 Dec 24, 2022
Alter SDK is a cross-platform SDK consisting of a real-time 3D avatar system, facial motion capture, and an Avatar Designer component built from scratch for web3 interoperability and the open metaverse.

Alter SDK is a cross-platform SDK consisting of a real-time 3D avatar system, facial motion capture, and an Avatar Designer component built from scratch for web3 interoperability and the open metaverse.

Alter 45 Nov 29, 2022
gradle plugin for building Xcode Projects for iOS, watchOS, macOS or tvOS

gradle-xcodePlugin The gradle xcode plugin (gxp) makes it easier to build Xcode projects by specifying the build settings in a single configuration fi

null 444 Dec 5, 2022
Px-mobile-sdk-demo-app - PerimeterX Mobile SDK - Demo App

About PerimeterX PerimeterX is the leading provider of application security solu

PerimeterX 1 Nov 20, 2022
Cloud Drive(GoogleDrive/Dropbox/BaiduPan/OneDrive/pCloud) File Management

CloudServiceKit Easy to integrate cloud service using Oauth2. Supported platforms: AliyunDrive BaiduPan Box Dropbox Google Drive OneDrive pCloud Requi

null 18 Aug 10, 2022
Doll - A mac app to help monitor your app badges

Doll is a Mac app that help you catch up important messages! In macOS, It feels

null 328 Jan 4, 2023
RadioTimeKit - The Swift SDK for TuneIn RadioTimeKit is a Swift package to use the TuneIn API.

RadioTimeKit - The Swift SDK for TuneIn RadioTimeKit is a Swift package to use the TuneIn API. The goal for development was to have a Swift SDK to get

Frank Gregor 2 Jun 20, 2022
Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app.

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using Apple Pay or their credit card.

Shopify 411 Jan 2, 2023
Swiftui-webrtc-agora - SwiftUI webrtc app. use agora sdk for webrtc

Specs swiftui comnine firebase auth agora graphql apollo-ios( https://github.com

akiho 0 Jan 5, 2022
Home-assistant-swift-sdk - Used to integrate the Home Assistant APIs with your Swift-based apps.

home-assistant-swift-sdk This open-source library allows you to interact with a Home Assistant instance in your Swift-based (e.g., iOS, macOS, etc.) a

Alexander Golden 0 Dec 31, 2021
CareKit is an open source software framework for creating apps that help people better understand and manage their health.

CareKit CareKit™ is an open source software framework for creating apps that help people better understand and manage their health. The framework prov

CareKit 2.3k Dec 27, 2022
Used to integrate the Facebook Platform with your iOS & tvOS apps.

Facebook SDK for iOS This open-source library allows you to integrate Facebook into your iOS app. Learn more about the provided samples, documentation

Meta 7.3k Jan 3, 2023
MbientLab 2 Feb 5, 2022
Symptoms - WatchOS app to save symptoms to HealthKit

Symptoms Symptoms is a watchOS app for entering symptoms into HealthKit Screensh

Leptos 1 Sep 4, 2022
The Gini Bank SDK provides components for capturing, reviewing and analyzing photos of invoices and remittance slips.

Gini Bank SDK for iOS The Gini Bank SDK provides components for capturing, reviewing and analyzing photos of invoices and remittance slips. By integra

Gini GmbH 0 Dec 16, 2021
Sample app to demonstrate the integration code and working of Dyte SDK for iOS, using Objective-C.

iOS sample app (using Objective-C) by dyte Sample app to demonstrate the usage of Dyte iOS SDK Explore the docs » View Demo · Report Bug · Request Fea

Dyte 8 Nov 26, 2021
A Flutter plugin to wrap HyperPay SDK for iOS and Android.

HyperPay Flutter Plugin This plugin is a wrapper around HyperPay iOS and Android SDK, it's still in alpha release, and supports limited set of functio

NyarTech 11 Nov 27, 2022