Android
Embed the Imprint application experience in your Android app
Installation
Step 1: Add to app-level build.gradle and sync project to gradle
Implementation
Step 2: Import the SDK
Step 3: Configuration
Create an instance of ImprintConfiguration
with your clientSecret
and environment
, then assign additional optional fields as needed.
Step 4: Define the completion handler
Define the completion handler onCompletion
to manage the terminal states when the application flow ends.
Step 5: Starting the Application flow
Once you have configured the ImprintConfiguration
, initiate the application flow by calling ImprintApp.startApplication
. This will start within a new Activity.
context
: The context from which the application process will be presented
configuration
: The previously created ImprintConfiguration object containing your API key and completion handler
onCompletion
: The completion handler of the flow
Complete code example
Request Parameters
PROPERTY NAME | REQUIRED | TYPE | DESCRIPTION | |
---|---|---|---|---|
clientSecret | TRUE | String | Generated through Create Customer Session |
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 |
---|---|
OFFER_ACCEPTED | Application has been approved and credit offer accepted. New cardholder! |
REJECTED | Application has been rejected by Imprint |
IN_PROGRESS | Application has been exited, not completed |
ERROR | Invalid request parameters (e.g., invalid client secret) |