SDK Reference
iOS
Embed the Imprint application experience in your iOS app
Installation
Option 1 Swift Package Manager
- Add the following repository URL
- Select your desired version or branch
- Click Add Package
Or you can also add Imprint as a dependency to your `Package.swift`:
Option 2 Cocoapods
(minimum support cocoapods version: 1.16.1)
- Add Imprint to your
Podfile
- Install the dependencies
- open the project file
Update Dependencies
Option 1 Swift Package Manager
- Tap
Update Package
from the menu
Option 2 Cocoapods
Implementation
- Import the SDK
Import the SDK in your view controllers or wherever needed:
- Configuration
Create an instance of ImprintConfiguration
with your client_secret
and environment
, then assign additional optional fields as needed.
- Define the Completion Handler
Define the completion handler to manage the terminal states when the application flow ends.
- Start the Application flow
Once you’ve configured the , initiate the application flow by calling from your view controller.
viewController
: The view controller from which the application flow will be presentedconfiguration
: The previously created object containing your API key and completion handler
Complete Code Example
Check out our complete demo project at Imprint-Tech/imprint-sdk-ios
Request Parameters
PROPERTY NAMES | REQUIRED | TYPE | DESCRIPTION |
---|---|---|---|
client_secret | TRUE | String | Generated through Create Customer Session |
partnerReference | TRUE | String | The unique reference identifier for the partner |
Response Data
PROPERTY NAMES | TYPE | DESCRIPTION |
---|---|---|
customer_id | String | null | Imprint identifier for customer |
partner_customer_id | String | null | Partner identifier for customer |
payment_method_id | String | null | ID to the payment method of customer |
error_code | ErrorCode | null | Identifier for the specific error encountered |
ErrorCode (Enum)
ENUM | DESCRIPTION |
---|---|
INVALID_CLIENT_SECRET | Indicate Client Secret is invalid |
UNKNOWN_ERROR | Indicate other unexpected error happened |
Application States
ENUM | DESCRIPTION |
---|---|
offerAccepted | Application has been approved and credit offer accepted. New cardholder! |
rejected | Application has been rejected by Imprint |
inProgress | Application has been exited, not completed |
error | Invalid request parameters (e.g., invalid token) |