Moltin alternatives and similar libraries
Based on the "Payments" category.
Alternatively, view Moltin alternatives based on common mentions on social networks and blogs.
-
SwiftyStoreKit
Lightweight In App Purchases Swift framework for iOS 8.0+, tvOS 9.0+ and macOS 10.10+ ⛺ -
card.io-iOS-SDK
card.io provides fast, easy credit card scanning in mobile apps -
RevenueCat
In-app purchases and subscriptions made easy. Support for iOS, iPadOS, watchOS, and Mac. -
CreditCardForm-iOS
CreditCardForm is iOS framework that allows developers to create the UI which replicates an actual Credit Card. -
TPInAppReceipt
Reading and Validating In App Purchase Receipt Locally. -
MFCard
Easily integrate Credit Card payments module in iOS App. Swift 4.0 -
monza
Ruby Gem for Rails - Easy iTunes In-App Purchase Receipt validation, including auto-renewable subscriptions -
YRPayment
Better payment user experience library with cool animation in Swift -
SwiftLuhn
Debit/Credit card validation port of the Luhn Algorithm in Swift -
AnimatedCardInput
Easy to use iOS library with components for input of Credit Card data. -
SwiftInAppPurchase
Simply code In App Purchases with this Swift Framework -
Glassfy
Open source SDK to quickly integrate subscriptions, stop worring about code maintenance, and getting advanced real-time data. Full support for iOS, iPadOS, WatchOS, MacOS
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Moltin or a related project?
README
Moltin iOS SDK
iOS/tvOS/watchOS SDK for the Moltin platform, written in Swift.
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
:
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
let moltin = Moltin(withClientID: "<your client ID>")
moltin.product.all { result in
switch result {
case .success(let response):
print(response)
case .failure(let error):
print(error)
}
}
moltin.product.get("<product ID>") { 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
}
}
moltin.product.get(forID: "<your ID>") { (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.
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.
*Note that all licence references and agreements mentioned in the Moltin README section above
are relevant to that project's source code only.