As an integrator, you only need to provide a valid MSP transaction identifier or create a transaction. The FastCheckout SDK leverages the checkout process for you, providing notifications for all possible outcomes (success, pending, cancelled, etc.) once it completes a transaction. The checkout process flow includes:
The FastCheckout SDK provides the following additional features:
For more information, see the documentation in the SDK, which contains all classes, methods, and troubleshooting.
To learn more about creating, updating and retrieving orders, see the API reference.
You can now start using the FastCheckoutKit SDK in your app.
To integrate the FastCheckout iOS SDK into your app, follow these steps:
import FastcheckoutKit
let manager = FastcheckoutManager(client: FastcheckoutClient(apiKey: "API_KEY"))
manager.startCheckout(transactionId: "ID", host: self, onCompletion: { status, error in
if let status = status {
print(status)
} else {
print(error?.localizedDescription)
}
})
And that’s it! Now you can start a checkout and retrieve the transaction status once it completes.
import UIKit
import FastcheckoutKit
class ViewController: UIViewController {
private let manager = FastcheckoutManager(client: FastcheckoutClient(apiKey: "API_KEY"))
override func viewDidLoad() {
super.viewDidLoad()
// Add a button to the navigationBar
let startButton = UIBarButtonItem(title: "Start",
style: .done,
target: self,
action: #selector(self.startCheckout))
navigationItem.rightBarButtonItem = startButton
}
// MARK: Actions
@objc func startCheckout() {
manager.startCheckout(transactionId: "id", host: self, onCompletion: { status, error in
if let status = status {
print(status)
switch status.state {
case .cancelled:
break
case .completed:
break
case .declined:
break
case .pending:
break
case .uncleared:
break
@unknown default:
break
}
} else {
print(error?.localizedDescription)
}
})
}
}
The SDK operates in two environments: LIVE (default) and TEST (no real transactions processed). We recommend testing your integration before release. Check out the example below to see how you can select which environment to use.
To customize the SDK, you need to inject properties into it.
// Build `Settings` object to customize FCO SDK
let settings = Settings.build()
settings.environmentKey = FastcheckoutTestEnvironment
settings.debug = true
settings.biometricAuthenticationEnabled = true
settings.skipShowCartAtBeginning = true
settings.pinning = false
let client = FastcheckoutClient(apiKey: apiKey, settings: settings)
self.manager = FastcheckoutManager(client: client)
Logging in with a registered email:
Logging in with an unregistered email automatically takes the customer to the Register screen:
If the customer is registered and resets their email account, the SDK automatically sends a new security code to new email provided:
Once the customer enters the security code received by email (if the security code is received via SMS it is automatically added to the appropriate field, and the SDK moves to the following state), the SDK asks for a new security PIN. Having entered the PIN, the SDK provides biometric options, including face recognition:
The checkout process follows. From the webshop checkout, the SDK enters into the checkout process. The first screen is the Delivery screen, with shipping options (if available). When the customer clicks Continue, the SDK moves to the Payment screen and the payment logic follows.
Once payment is completed, the SDK proceeds to the Transaction complete screen. The SDK callback notifies the client app of the transaction status, e.g. Uncleared, Cancelled. When the customer clicks Back to shop, they are redirected back to the webshop.
Feedback
Propose a change on GitHub
or
send an email to [email protected]
Other languages
For an explanation in another language, contact your account manager.