The Apto PCI SDK provides a transparent
View that can display the PCI data using a
This document provides an overview of how to:
- PCI SDK
You can access the iOS PCI SDK on GitHub.
To contribute to the SDK development, see Contributions & Development
- iOS 10.0 (minimum version)
- Swift 5 (minimum version)
- CocoaPods. No minimum version is required, but version 1.8.3 or higher is recommended.
Get the Mobile API key
A Mobile API Key is required to run the SDK. To retrieve your Mobile API Key see Get the Mobile API Key for the SDKs.
Install the SDK
We suggest using CocoaPods to install the SDK:
- At the top of your project's
Podfile, ensure the platform is set to iOS 10 or higher, and frameworks are enabled:
platform :ios, '10.0'
- In the dependency section of your
Podfile, add the Apto iOS SDK pod dependency:
- Open your Terminal app and navigate to your project's folder where the
- Install the SDK with the following command:
Initialize the SDK
To initialize the PCI SDK:
- Create a
let pciView = PCIView()
pciViewto your main view:
pciView.translatesAutoresizingMaskIntoConstraints = false
pciView.topAnchor.constraint(equalTo: topConstraint, constant: 40),
pciView.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 20),
pciView.rightAnchor.constraint(equalTo: view.rightAnchor, constant: -20),
- User Session Token
- Card account ID
Note: The Core API option is only available to Blue or Orange Programs.
- Create a
PCIConfigAuthobject. This manages the authentication configuration settings.
let configAuth = PCIConfigAuth(
|This value is the Mobile API Key (|
|This value is the user session token (|
|This value is the account ID (|
|This value is the environment that you are using for your app. The available values are:|
- (Optional) Create a
PCIConfigCardobject, passing in the cardholder's name and the last four digits of the card. See Display Card Data Elements for more info.
let configCard = PCIConfigCard(lastFour: "XXXX",
- (Optional) Create a
PCIConfigStyleobject, passing any desired style settings. See Style Card Elements for more info.
val style = PCIConfigStyle(textColor: UIColor.red)
- Create a
PCIConfigobject, passing in the
styleparameters. See Display Card Data Elements for more information about the
let config = PCIConfig(configAuth: configAuth,
- Initialize the PCI view using
pciView.initialise, passing in the
Note: Initialization should only be applied once.
Show / Hide the PCI Data
The PCI SDK enables you to:
Show the card's complete data. To show the card's complete data, use the
The user will receive an SMS or email with a one-time passcode. This passcode must be entered into the displayed dialog box. If the passcode is correct, the PCI data will be shown. When testing in the Sandbox environment, you must use
000000as the OTP code.
Note: This method must be called after the
pciViewis fully initialized to avoid sending multiple SMS / email codes. We suggest requiring the user to click a button or other UI element to initiate the
Show only the card's last four digits (if set). This hides all of the PCI data. To hide all the PCI data except for the card's last four digits, use the
Change Card PIN
In addition to this, the PCI SDK allows a user to change their card PIN. To initiate this process use the
The user will receive an SMS or email with a one-time passcode. This passcode must be entered into the displayed dialog box. If the passcode is correct, the user will be prompted to enter the new card PIN. When testing in the Sandbox environment, you must use
000000 as the OTP code.
Customize the PCI View
The PCI SDK uses configuration objects to change the default PCI configuration. The following elements can be customized:
Display Card Data Elements
PCIConfigCard object is used to set card configurations. The following configurations are available:
|String value used as placeholders for the last 4 digits of the card when hidden. The default value is |
|String value specifying the name displayed on the card. The default value is an empty string.|
|String value specifying the text for the name description label. The default value is an empty string.|
|String value specifying the text for the PAN (Primary Account Number) description label. The default value is an empty string.|
|String value specifying the text for the CVV description label. The default value is |
|String value specifying the text for the expiration date description label. The default value is |
|String value used for the submit button on the OTP form. The default value is |
Style Card Elements
To style the PCIView with a theme, use the
setTheme method anytime after initialization. The method can receive one the following values:
|Use this value if you have a dark background. The card text will change to white.|
|Use this value if you have a light background. The card text will change to black.|
To style the PCIView with specific configurations, use the
- When the
- In the
setThememethod anytime after initialization.
The following configuration options are available for the PCIConfigStyle:
To style the card
labelCvv element you can use the following setup:
let configStyle = PCIConfigStyle(textColor: "#FFFFFF",
Contributions & Development
We look forward to receiving your feedback, including new feature requests, bug fixes and documentation improvements.
If you would like to help:
- Refer to the issues section of the repository first, to ensure your feature or bug doesn't already exist (The request may be ongoing, or newly finished task).
- If your request is not in the issues section, please feel free to create one. We'll get back to you as soon as possible.
If you want to help improve the SDK by adding a new feature or bug fix, we'd be happy to receive pull requests!
AptoPCI is available under the MIT license. See the LICENSE file for more info.