Note: If you haven’t chosen your integration method yet, begin by selecting your method and following the ‘What to do next’ steps first.
Integrate simple and secure in-app card payments into your iOS Swift app with our Judopay SDK.
Judopay’s Out-of-the-box UI comes with built-in checks and security features, including real-time error detection, 3D Secure, data and address validation for frictionless card data capture.
This minimises PCI compliance and allows you focus on developing other areas of your app. See our UI customization guide to learn more.
- Versions greater or equal to 6.2.5 require Xcode 8 and Swift 3.
- Version 6.2.4 is the last version to support Xcode 7.3.1 and Swift 2.2.
Add the Swift SDK to the top of the file where you want to use it:
Install Cocoapods with the following command:
$ gem install cocoapods
Note: If you are not integrating using Cocoapods, please visit our guides for Carthage integration.
Add Judopay to your Podfile to integrate it into your Xcode project.
source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! pod 'JudoKit', '~> 6.2'
Install the new pod in your project
$ pod install
Note: Please ensure that you always use the newly generated .xcworkspace file instead of the .xcodeproj file.
In Xcode, go to the Project Navigator called ‘Pods’, select the JudoKit target and open the tab called Build Phases. Add a new Run Script Phase and drag it above the Compile Sources build phase.
Include the following line in the shell script:
To start setting up your app, please complete all the relevant integration steps in the setup section. By following these steps, you are ensuring that your app will be secure and frictionless for you and your customers.
If you have completed the setup section, start using Judopay’s iOS Swift SDK by adding your app’s token and secret when initializing the SDK:
var judoKitSession = JudoKit(token: token, secret: secret)
Command the SDK to communicate with sandbox environment by including the following line where the payment is initiated in the ViewController:
The SDK allows further configuration. These are the options:
Supported card networks – Allows you to determine the accepted card networks when using your app. The default value includes Visa, MasterCard, Maestro and AmEx.
Note: Processing transactions with AmEx cards requires that your account supports it as well. Please contact us first if you are planning to accept AmEx.
Note: AVS requires additional configuration in account level. If you are looking to use this feature, please contact us.
Setup the payment types you require for your app. Depending on your chosen integration method you have a variety of payment types.
- Register card to be stored for future transactions.
- Card payments to make a payment.
- Token payment with a stored card token.
- Pre-authorization to reserve funds on a card.
- Token pre-authorization with a stored card token.
If you require other payment types, such as reserving funds on a card to collect later, or server side refunds, please see the Docs homepage for all integration methods.
Test sandbox payments
Test your app quickly and securely with different payment types. The Sandbox testing guide will provide you all the details you need to ensure a solid integration. Here are some highlights:
- Ensure that the SDK is properly configured for sandbox environment.
- Use the test cards provided in the dashboard, under ‘Tools › Generating transactions’.
- If 3D Secure is enabled and you want to simulate the 3D Secure screen, contact us for card details.
Note: Test all the payment types you require in the sandbox environment before going live.
To protect your app from fraud in real-time, Device DNA™ is an essential component of JudoShield that enables Judopay to capture data and device signals at the time of the transaction.
If you are integrating the ‘Mobile and your server side method’, y ou need to use Device DNA on the mobile in conjunction with your backend when making a payment:
- To set up Device DNA for your app please follow the Getting started guide.
- Follow the Server-to-server-fraud-prevention guide to ensure the Device DNA is sent.
Learn more about Device DNA.
Use Judopay’s Out-of-the-box UI components for a frictionless checkout in your app. Minimize your PCI scope with a UI that can be themed to match your brand colors.
Built-in features include quick data entry, optional security checks and fraud prevention that allow you to focus on developing other areas of your app.
- Check out our guide to Customising Out-of-the-box UI.
The Judopay SDK also includes an API client for direct use of Judopay’s RESTful API. This offers the most options in terms of customization, but we recommend that you use the Judopay UI to minimise your PCI scope and development time.
Apple Pay provides an easy, secure, and private way to pay for physical goods and services in iOS apps. By simply using Touch ID, users can quickly and securely provide all their payment and shipping information to check out with a single touch. The Judopay iOS Swift SDK lets your app process Apple Pay payments, providing a frictionless checkout.
- A compatible Apple device: iPhone 6 & 6 Plus. iPad Air 2, iPad mini 3 or newer.
- OS 8.1 or newer.
- Xcode 6.1 or newer.
iOS Swift SDK works with card scanning libraries such as card.io. This allows users to quickly enter card data using the camera on their device.
Ready to go live?
- Completed integration and setup.
- Set up Device DNA.
- Tested the payment types you require in sandbox.
- Themed the UI.
Follow the next steps in the Going live guide.