# Models
### PaysimpleSDKResponse
Property | Type | Description |
didSucceed() | boolean | If the command was successful. |
getDescription() | String | Description of response. |
### PaysimpleSaleResponse
Property | Type | Description |
approved_amount | BigDecimal | Transaction amount. |
card_brand | String | Brand of card. |
transaction_id | String | Unique Id of transaction. |
acquirer_message | String | Host error message returned on failure or decline. Do not base application logic on this message as it may change without notice. |
authorization_code | String | Transaction authorization code. |
batch_id | String | Settlement batch id (card only). |
paysimpleCardData | PaysimpleCardData | PaySimple card data. |
paysimpleEmvResponse | PaysimpleEmvResponse | Emv response. |
paysimpleSaleOutcome | PaysimpleSaleOutcome | Outcome of sale. |
### PaysimpleCardData
Property | Type | Description |
card_masked_number | String | Masked card number. |
card_logo | String | Card logo. |
expiration_month | String | Card expiration month. |
expiration_year | String | Card expiration year. |
bin | String | Transaction bin. |
card_entry_mode | String | How card data was entered. |
card_brand | String | Brand of card. |
card_holder_name | String | Name on card. |
last4 | String | Last 4 digits of card number. |
### PaysimpleEmvResponse
Property | Type | Description |
application_identifier | String | Name of card service, such as AMEX. |
application_preferred_name | String | Preferred name of institution. |
application_label | String | Label of institution. |
cryptogram | String | Cryptogram of transaction. |
host_response_code | String | Response code from the host. |
EMV Receipt Requirements
**THE FOLLOWING ARE REQUIRED FOR EMV RECEIPTS** Application Identifier (AID) of the application used. Application Preferred Name (if available and supported) or Application Label Cryptogram type/value Host Response Code/Host Response Message (e.g. 00/AP, etc) Host Response Message
## PaysimpleSaleOutcome
Property | Type | Description |
result | String | Result summary of transaction. |
code | String | 4-digit PaySimple result code. The code will not change, so it's safe to create code logic reacting to a specific failure code. Code 1000 indicates success. |
outcome_description | String | Description of decline, failure or success. This is in human-readable format, so it is a good practice to display this text to the user in your interface. Don't base logic in your code on this text, as it may change from time to time. |
## AvailableDeviceResponse
Extends **PaysimpleSDKResponse **
Property | Type | Description |
getDeviceNames() | ArrayList<String> | Returns a list of found devices. |
## PaysimpleSaleRequest
Property | Type | Description |
amount (required) | BigDecimal | Total amount. Includes all additional charges. |
setAllowDuplicates(boolean allow) | void | Allow duplicate transactions. Default=false. |
setAllowPartialApprovals(boolean allow) | void | If true, allows partial approvals. Most useful for gift cards with limited funds. Default=false. |
external_id | String | Optional. <= 50 characters. Unique identifier for the payment in merchant or partner's system. |
transact_description | String | Optional. <= 5000 characters. Text field reserved for partner/merchant use. |
vault_on_success | boolean | Optional. Store card for future use. |
## Enum ErrorType
Name | Description |
Exception | Error of type exception. |
ExpressErrorEvent | Error from Express Event Call. |
TimeoutException | TriPos Timeout. |
## Enum DeviceState
Name | Description |
Connected | Device connected. |
Disconnected | Device disconnected. |
Updating | Device update in progress. |
UpdateFinished | Device update finished. |
BatteryLow | Device battery below 50%. |
# Methods
Some Methods Must Be Started on a Thread
Example calls will instruct if method needs to be started on a new thread.
## Get BBPOS Instance
Gets PaySimple TriPOS instance.
Property | Type | Description |
context | Context | Android context. |
paysimpleEnvironment | PsEnvironment | Required. Environment to use. Possible values: "SBX" for sandbox or "PROD" for production. |
paysimpleEnvironment | PsDeviceType | BBPOS device. Should not effect ability to tap, swipe or insert. |
## Initialize and Connect Device
`PaysimpleSDKResponse initializeAndConnect(String clientToken, String deviceIdentifier);
`
Initializes client and connects to BBPOS device. Needs a PaySimple client token and the name of the BBPOS device.
Property | Type | Description |
clientToken | String | PaySimple client token. |
deviceIdentifier | String | Name of device. |
## Get Available Devices
Gets a list of available BBPOS devices.
## Subscribe to Listeners
Required
User must call subscribeToDeviceInteractionListener before making payments with device.
Gives user ability to subscribe to listeners.
Property | Type | Description |
listener | PsListener | User implementation of PsListener. |
psDeviceInteractionListener | PsDeviceInteractionListener | User implementation of transaction related PsDeviceInteractionListener. |
Listeners implemented through calling class.
## Get Device Info
Gets available device information returning an array containing device serial number, description, and device configuration if initialized.
## Process Sale
Process sale with client token.
Total Sales Amount Requirements
The amount in **PaysimpleSaleRequest saleRequest** must be the total amount including tips, fees etc...
Property | Type | Description |
clientToken | String | PaySimple client token. |
saleRequest | PaysimpleSaleRequest | PaySimple sale request. |
## De-Initialize BBPOS
De-initialize Paysimple SDK and disconnect device.
## Hard Reset
Clears Express credentials, clears device configuration, and de-Initializes PaySimple SDK.
## Is Device Connected
Checks if BBPOS device is connected.
## Is SDK Initialized
Check if PaySimple SDK has been successfully initialized with Express credentials.
## Cancel Current Action
Currently this applies to process payment flow. Call this if payment gets interrupted. Returns true if successful.
# Delegates/Listeners
## PsListener
Listens for general SDK related events. Required.
Method | Description |
updateResponse(Double progress, String... response) | Updates client with progress of firmware update. |
onError(PaysimpleSDKError sdkError) | Notifies client of SDK error responses. |
onDeviceEvent(DeviceState deviceState, String message) | Notifies client of device specific events. |
onPaymentResponse(PaysimpleSaleResponse response) | Notifies client when a payment response has been completed. |
## PsDeviceInteractionListener
Listens for transaction related events.
Method | Description |
onAmountConfirmation(PsAmountConfirmationType var1, BigDecimal var2, PsConfirmAmountListener var3) | Notifies client of amount confirmation. Use PsConfirmAmountListener to pass in user response. |
onPromptUserForCard(String var1) | Notifies client to insert card. |
onDisplayText(String var1) | Displays general text events. Such as "processing...". |
onRemoveCard() | Delegate is called when user is prompted to remove card. |
onCardRemoved() | Delegate is called when user removes card. |
psConfirmAmount() | Listener to pass user confirmation of amount. |