Installation
Prerequisites: minimum supported Android version is 23 (Marshmallow) and device with NFC capabilities
Firstly, you need to integrate our kevin. mobile SDK which allows you to integrate Account Linking within your app. Instructions on how to do that can be found here:
Getting StartedInstallation
Maven repository and credentials should be received together with other secrets.
Add kevin. maven repository
<repository>
- Maven repository name<
username>
- provided Maven repository username<
password>
- provided Maven repository password
Add kevin. dependency
Initialisation
KevinPay
serves as the primary interface class for interacting with the mobile SDK, offering a comprehensive set of methods for linking and managing accounts. Within this class, you will find essential functions, helper classes, and additional methods to tailor the SDK instance to the specific requirements.
kevin. mobile SDK must be initialised before it can be used in the mobile application, attempting to use the SDK without initialisation will trigger a KevinNfcSdkNotInitialisedException
. Ensure that the initialisation process is carried out within the application's class onCreate() method to guarantee proper functionality.
Only KevinPay.init()
has to be called from Application
class. This requirement doesn't extend to other methods. For instance, in a scenario where the user selects the app language on a screen, it is safe to call KevinPay.setLocale()
within that specific screen.
For POS payments to work properly you will need to request permission for posting notifications on devices running api 33 or higher
Notifications are needed due to limitations of some device manufacturers. Having notification permission allows us to inform user about relevant information about the payment. If user doesn't allow posting notifications or disables our notification channel, payments might not work on certain devices. You can read here about Android notification permissions.
Handle user logout
After user logs out from the mobile application, KevinPay.clearProvisionedData()
should be called. This action ensures that the previous user's data is effectively purged, preventing its availability to the new user. Importantly, upon clearing provisioned data, KevinPay
will retain its initialised status, and configurations that are not user-specific will remain unaffected.
Set application as a default payment application
The default payment application on an Android device settings is the preferred app that device uses to make payments. When you set an app as the default payment app, the device will automatically use it when you make payments without any application being opened.
kevin. mobile SDK offers convenience methods for verifying whether the mobile application currently serves as the default payment application and for prompting the user to designate it as such. These methods are callable from any part of the application.
Upon the user's entry into an activity responsible for managing linked payment accounts, it's recommended to check if the application is set as the default payment app. If not, prompt the user to confirm if they would like to set it as the default payment application.
Set preferred foreground payment application
Another alternative to setting application to use for payments is KevinPay.setAsPreferredForegroundPaymentService()
. This will allow user to still use their default payment application when making payments from background, but will use your application when it's open.
Last updated