Install the SDK
To embed the iOS SDK into your Xcode project, you will need to use one of the following dependency managers:
CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate Trust Payments into your Xcode project using CocoaPods, specify it in your Podfile as follows:
# Includes all modules pod 'TrustPayments' # Includes specific modules of interest pod 'TrustPayments/Core' # Performing transactions using your own views pod 'TrustPayments/UI' # Performing transactions with a ready-to-use “drop-in” controller pod 'TrustPayments/Card' # Module with useful methods to validate card data
Carthage is a decentralised dependency manager that builds the necessary dependencies and provides you with binary frameworks. To integrate Trust Payments into your Xcode project using Carthage, specify it in your Cartfile as follows:
Once you have Carthage installed, you can begin adding frameworks to your project. Click here to learn how.
Now you have installed the SDK, we recommend learning how to generate a JSON Web Token (JWT). These are used to securely transmit data during each payment session.