Dingenis / android-tikkie-sdk

Android library for the ABN AMRO Tikkie API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android Tikkie SDK

SDK for using the Tikkie API on Android

Getting Started

  1. Add the library to your project
implementation 'nl.dss.abnamro:tikkie:0.0.1'
  1. Initialize the library with your API key and your private key
        // Setup the library
        val config = TikkieConfig(getString(R.string.abn_ambro_api_key), getString(R.string.abn_ambro_private_key))
        Tikkie.setup(config)
  1. All done! You can now use the library to use the Tikkie API

Platforms

Add platform

        val platformConfig = PlatformSetupConfig("SmartScan", "0600000000", "abc@gmail.com", PlatformUsage.PAYMENT_REQUEST_FOR_MYSELF)
        Platform.create(platformConfig, object : Callback<Platform> {
            override fun onSuccess(value: Platform) {
                Log.i("MainActivity", value.name)
            }

            override fun onApiError(errors: List<ApiError>) {
                for(error : ApiError in errors) {
                    Log.e("MainActivity", error.message)
                }
            }

            override fun onException(throwable: Throwable) {
                throw throwable
            }
        })

Get platforms

        Platform.get(object : Callback<List<Platform>> {
            override fun onSuccess(value: List<Platform>) {
                for(platform in value) {
                    Log.i("MainActivity", platform.name)
                }
            }
            override fun onApiError(errors: List<ApiError>) {
                for(error : ApiError in errors) {
                    Log.e("MainActivity", error.message)
                }
            }

            override fun onException(throwable: Throwable) {
                throw throwable
            }
        })

Users

Add user

platform.user(userConfig, object : Callback<User> {
                        override fun onSuccess(value: User) {
                            Log.i("MainActivity", "User created with token id: " + value.token)
                        }

                        override fun onApiError(errors: List<ApiError>) {
                            for(error : ApiError in errors) {
                                Log.e("MainActivity", error.message)
                            }
                        }

                        override fun onException(throwable: Throwable) {
                            throw throwable
                        }
                    })

Get users

platform.users(object : Callback<List<User>> {
                    override fun onSuccess(value: List<User>) {
                        for(user in value) {
                            Log.i("MainActivity", user.name)
                        }
                    }

                    override fun onApiError(errors: List<ApiError>) {
                        for(error : ApiError in errors) {
                            Log.e("MainActivity", error.message)
                        }
                    }

                    override fun onException(throwable: Throwable) {
                        throw throwable
                    }
                })

About

Android library for the ABN AMRO Tikkie API

License:Apache License 2.0


Languages

Language:Kotlin 88.5%Language:Java 11.5%