diff --git a/android/license-header.txt b/android/license-header.txt index 019016d3..ad913993 100644 --- a/android/license-header.txt +++ b/android/license-header.txt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/build.gradle.kts b/android/momo-api-sdk/build.gradle.kts index ad9cbe5b..124aef53 100644 --- a/android/momo-api-sdk/build.gradle.kts +++ b/android/momo-api-sdk/build.gradle.kts @@ -1,4 +1,3 @@ -import com.vanniktech.maven.publish.SonatypeHost import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.DokkaBaseConfiguration diff --git a/android/momo-api-sdk/license-header.txt b/android/momo-api-sdk/license-header.txt index 019016d3..ad913993 100644 --- a/android/momo-api-sdk/license-header.txt +++ b/android/momo-api-sdk/license-header.txt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/androidTest/java/io/rekast/sdk/ExampleInstrumentedTest.kt b/android/momo-api-sdk/src/androidTest/java/io/rekast/sdk/ExampleInstrumentedTest.kt index a233de04..43109423 100644 --- a/android/momo-api-sdk/src/androidTest/java/io/rekast/sdk/ExampleInstrumentedTest.kt +++ b/android/momo-api-sdk/src/androidTest/java/io/rekast/sdk/ExampleInstrumentedTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/callback/MomoCallback.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/callback/MomoCallback.kt deleted file mode 100644 index 5e46b954..00000000 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/callback/MomoCallback.kt +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2023 - 2024, Benjamin Mwalimu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.rekast.sdk.callback - -import retrofit2.Call -import retrofit2.Callback -import retrofit2.Response - -/** - * MomoCallback for MomoAPI API MomoResponse - * returns [onResponse] for successful calls and - * [onFailure] for errors. - */ -class MomoCallback( - private val callback: (momoResponse: MomoResponse) -> Unit -) : Callback { - - override fun onResponse(call: Call, response: Response) { - if (response.isSuccessful) { - val data: T? = response.body() - if (data != null) callback.invoke(MomoResponse.Success(data)) - } else { - val code = "${response.code()}" - var error = "" - runCatching { error = "$code : ${response.errorBody()!!.string()}" } - callback.invoke(MomoResponse.Failure(false, MomoException(error))) - } - } - - override fun onFailure(call: Call, throwable: Throwable) = callback.invoke( - MomoResponse.Failure( - true, - MomoException(throwable.localizedMessage) - ) - ) -} diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/callback/MomoException.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/callback/MomoException.kt deleted file mode 100644 index 40196b80..00000000 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/callback/MomoException.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2023 - 2024, Benjamin Mwalimu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.rekast.sdk.callback - -import io.rekast.sdk.model.ErrorResponse - -/** - * Handles exceptions and messages for the exceptions. - * - * @property errorResponse The error response associated with the exception. - */ -class MomoException : Exception { - lateinit var errorResponse: ErrorResponse - - /** - * Constructor for MomoException with a message. - * - * @param message The message associated with the exception. - */ - constructor(message: String?) : super(message) - - /** - * Constructor for MomoException with an ErrorResponse. - * - * @param errorResponse The error response associated with the exception. - */ - constructor(errorResponse: ErrorResponse) : super("${errorResponse.code} : ${errorResponse.message}") { - this.errorResponse = errorResponse - } -} diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/callback/MomoResponse.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/callback/MomoResponse.kt deleted file mode 100644 index b0a99017..00000000 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/callback/MomoResponse.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023 - 2024, Benjamin Mwalimu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.rekast.sdk.callback - -/** - * Holds the state for Payment status. - */ -sealed class MomoResponse { - data class Success(val value: T) : MomoResponse() - data class Failure( - val isNetworkError: Boolean, - val momoException: MomoException? - ) : MomoResponse() -} diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/callback/TransactionCallback.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/callback/TransactionCallback.kt deleted file mode 100644 index 57f9285b..00000000 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/callback/TransactionCallback.kt +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2023 - 2024, Benjamin Mwalimu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.rekast.sdk.callback - -import com.google.gson.GsonBuilder -import io.rekast.sdk.model.ErrorResponse -import io.rekast.sdk.model.MomoTransaction -import io.rekast.sdk.utils.Settings -import io.rekast.sdk.utils.TransactionStatus -import java.io.IOException -import okhttp3.ResponseBody -import okhttp3.ResponseBody.Companion.toResponseBody -import retrofit2.Call -import retrofit2.Callback -import retrofit2.Response - -/** - * Transaction MomoCallback for the MTN MOMO API - * The MTN MOMO API returns the a 200 OK even for transfers that failed. - * We use [TransactionCallback] to identify the difference between 200 OK and 400 - * This returns the [MomoTransaction] on the [ResponseBody] - */ -class TransactionCallback( - private val callback: (momoResponse: MomoResponse) -> Unit -) : Callback { - - override fun onResponse(call: Call, response: Response) { - if (response.isSuccessful) { - val momoTransaction: MomoTransaction? = Settings().generateTransactionFromResponse(response) - if (momoTransaction?.status != null) { - if (momoTransaction.status == TransactionStatus.SUCCESSFUL.name) { - callback.invoke( - MomoResponse.Success( - GsonBuilder().setPrettyPrinting().create().toJson(momoTransaction).toResponseBody() - ) - ) - } else { - val error = "${momoTransaction.reason} : ${momoTransaction.externalId}" - callback.invoke(MomoResponse.Failure(false, MomoException(error))) - } - return - } - } else { - try { - val error = GsonBuilder().create().fromJson(response.errorBody()?.string(), ErrorResponse::class.java) - callback.invoke(MomoResponse.Failure(false, MomoException(error))) - } catch (e: IOException) { - e.printStackTrace() - callback.invoke(MomoResponse.Failure(false, MomoException("${response.code()}"))) - } - } - } - - override fun onFailure(call: Call, throwable: Throwable) { - callback.invoke(MomoResponse.Failure(true, MomoException(throwable.localizedMessage))) - } -} diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/AccountBalance.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/AccountBalance.kt index eb4b45bd..7905e02d 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/AccountBalance.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/AccountBalance.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/AccountHolder.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/AccountHolder.kt index 207a43c7..6b5fda45 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/AccountHolder.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/AccountHolder.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/AccountHolderStatus.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/AccountHolderStatus.kt index 650a64f7..c26e3f42 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/AccountHolderStatus.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/AccountHolderStatus.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/BasicUserInfo.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/BasicUserInfo.kt index 177d3ed2..10cf03a2 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/BasicUserInfo.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/BasicUserInfo.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/ErrorResponse.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/ErrorResponse.kt index ca3b9533..c7302f12 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/ErrorResponse.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/ErrorResponse.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/MomoNotification.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/MomoNotification.kt index f5818400..fc27cf99 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/MomoNotification.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/MomoNotification.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/MomoTransaction.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/MomoTransaction.kt index 45f7ea96..d1b575f5 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/MomoTransaction.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/MomoTransaction.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/PaymentResult.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/PaymentResult.kt index 4c867b17..a3e7348b 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/PaymentResult.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/PaymentResult.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/ProviderCallBackHost.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/ProviderCallBackHost.kt new file mode 100644 index 00000000..37296f95 --- /dev/null +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/ProviderCallBackHost.kt @@ -0,0 +1,32 @@ +/* + * Copyright 2023-2024, Benjamin Mwalimu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.rekast.sdk.model + +import com.google.gson.annotations.SerializedName +import kotlinx.serialization.Serializable + +/** + * Represents the callback host for the MTN MOMO API. + * + * This class is used to define the provider's callback host URL, + * which is necessary for handling responses from the MTN MOMO API. + * + * @property providerCallbackHost The callback host for the provider, represented as a nullable String. + */ +@Serializable +data class ProviderCallBackHost( + @SerializedName("providerCallbackHost") val providerCallbackHost: String? = null +) diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/UserInfoWithConsent.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/UserInfoWithConsent.kt index b98d675c..08bf163c 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/UserInfoWithConsent.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/UserInfoWithConsent.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/AccessToken.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/AccessToken.kt index c042b23c..a26d0756 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/AccessToken.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/AccessToken.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/ApiKey.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/ApiKey.kt index 46a9095d..598a81fb 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/ApiKey.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/ApiKey.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/ApiUser.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/ApiUser.kt index 40eddbb8..bca42f77 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/ApiUser.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/ApiUser.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/credentials/AccessTokenCredentials.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/credentials/AccessTokenCredentials.kt index 9159fa05..2703e90a 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/credentials/AccessTokenCredentials.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/credentials/AccessTokenCredentials.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/credentials/BasicAuthCredentials.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/credentials/BasicAuthCredentials.kt index 0ff0845b..8bc5abf2 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/credentials/BasicAuthCredentials.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/model/authentication/credentials/BasicAuthCredentials.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/NetworkModule.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/NetworkModule.kt index 5284aa1c..1f9b7b67 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/NetworkModule.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/NetworkModule.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interceptor/UnsafeOkHttpClient.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interceptor/UnsafeOkHttpClient.kt index 0dd2d871..328e4c43 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interceptor/UnsafeOkHttpClient.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interceptor/UnsafeOkHttpClient.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interceptor/auth/AccessTokenInterceptor.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interceptor/auth/AccessTokenInterceptor.kt index eb9287e4..9cde8415 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interceptor/auth/AccessTokenInterceptor.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interceptor/auth/AccessTokenInterceptor.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interceptor/auth/BasicAuthenticationInterceptor.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interceptor/auth/BasicAuthenticationInterceptor.kt index 271cc3ea..afb54570 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interceptor/auth/BasicAuthenticationInterceptor.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interceptor/auth/BasicAuthenticationInterceptor.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interfaces/auth/AuthInterface.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interfaces/auth/AuthInterface.kt index 164dc77e..03b7769a 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interfaces/auth/AuthInterface.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interfaces/auth/AuthInterface.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interfaces/implementation/auth/AuthImplementation.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interfaces/implementation/auth/AuthImplementation.kt index d87ff3ba..c438fad9 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interfaces/implementation/auth/AuthImplementation.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/interfaces/implementation/auth/AuthImplementation.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/AuthenticationService.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/AuthenticationService.kt index 90e90abc..87dd6543 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/AuthenticationService.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/AuthenticationService.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +15,13 @@ */ package io.rekast.sdk.network.service +import io.rekast.sdk.model.ProviderCallBackHost import io.rekast.sdk.model.authentication.AccessToken import io.rekast.sdk.model.authentication.ApiKey import io.rekast.sdk.model.authentication.ApiUser import io.rekast.sdk.utils.MomoConstants import retrofit2.Response +import retrofit2.http.Body import retrofit2.http.GET import retrofit2.http.Header import retrofit2.http.POST @@ -33,8 +35,18 @@ import retrofit2.http.Path */ sealed interface AuthenticationService { + /** + * Creates a new API user. + * + * @param providerCallBackHost The callback host for the provider. + * @param apiVersion The version of the API (e.g., v1_0 or v2_0). + * @param uuid A unique identifier for the request. + * @param productSubscriptionKey The subscription key for the product. + * @return A [Response] containing the created [ApiUser]. + */ @POST(MomoConstants.EndPoints.CREATE_API_USER) suspend fun createApiUser( + @Body providerCallBackHost: ProviderCallBackHost, @Path(MomoConstants.EndpointPaths.API_VERSION) apiVersion: String, @Header(MomoConstants.Headers.X_REFERENCE_ID) uuid: String, @Header(MomoConstants.Headers.OCP_APIM_SUBSCRIPTION_KEY) productSubscriptionKey: String diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/products/CollectionService.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/products/CollectionService.kt index d0839f25..0743ae11 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/products/CollectionService.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/products/CollectionService.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/products/CommonService.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/products/CommonService.kt index 9d3a0e6c..dd9fe5ea 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/products/CommonService.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/products/CommonService.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/products/DisbursementsService.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/products/DisbursementsService.kt index db7e3225..df730461 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/products/DisbursementsService.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/network/service/products/DisbursementsService.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/repository/DefaultRepository.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/repository/DefaultRepository.kt index 7a3535af..6c5ac43d 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/repository/DefaultRepository.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/repository/DefaultRepository.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,18 +21,24 @@ import io.rekast.sdk.model.AccountHolder import io.rekast.sdk.model.BasicUserInfo import io.rekast.sdk.model.MomoNotification import io.rekast.sdk.model.MomoTransaction +import io.rekast.sdk.model.ProviderCallBackHost import io.rekast.sdk.model.UserInfoWithConsent import io.rekast.sdk.model.authentication.AccessToken import io.rekast.sdk.model.authentication.ApiKey import io.rekast.sdk.model.authentication.ApiUser import io.rekast.sdk.model.authentication.credentials.AccessTokenCredentials import io.rekast.sdk.model.authentication.credentials.BasicAuthCredentials -import io.rekast.sdk.network.service.AuthenticationService import io.rekast.sdk.network.service.products.CollectionService import io.rekast.sdk.network.service.products.CommonService import io.rekast.sdk.network.service.products.DisbursementsService +import io.rekast.sdk.repository.data.DataResponse +import io.rekast.sdk.repository.data.NetworkResult import javax.inject.Inject import javax.inject.Singleton +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.flow +import kotlinx.coroutines.flow.flowOn import okhttp3.ResponseBody import org.apache.commons.lang3.StringUtils import retrofit2.Response @@ -52,13 +58,13 @@ import retrofit2.Response */ @Singleton class DefaultRepository @Inject constructor( - private val authenticationService: AuthenticationService, + private val defaultSource: DefaultSource, private val commonService: CommonService, private val disbursementsService: DisbursementsService, private val collection: CollectionService, private val basicAuthCredentialsT: BasicAuthCredentials, private val accessTokenCredentialsT: AccessTokenCredentials -) { +) : DataResponse() { /** * Sets up basic authentication credentials. @@ -85,14 +91,17 @@ class DefaultRepository @Inject constructor( * @param apiVersion The version of the API to use. * @param uuid A unique identifier for the request. * @param productSubscriptionKey The subscription key for the product. - * @return A [Response] containing the created [ApiUser]. + * @return A [Response] containing the created [Unit]. */ - suspend fun createApiUser( + fun createApiUser( + providerCallBackHost: ProviderCallBackHost, apiVersion: String, uuid: String, productSubscriptionKey: String - ): Response { - return authenticationService.createApiUser(apiVersion, uuid, productSubscriptionKey) + ): Flow> { + return flow> { + emit(safeApiCall { defaultSource.createApiUser(providerCallBackHost = providerCallBackHost, apiVersion = apiVersion, uuid = uuid, productSubscriptionKey = productSubscriptionKey) }) + }.flowOn(Dispatchers.IO) } /** @@ -102,12 +111,13 @@ class DefaultRepository @Inject constructor( * @param productSubscriptionKey The subscription key for the product. * @return A [Response] containing the [ApiUser] if found. */ - suspend fun checkApiUser( + fun checkApiUser( apiVersion: String, productSubscriptionKey: String - ): Response { - return authenticationService - .getApiUser(apiVersion, BuildConfig.MOMO_API_USER_ID, productSubscriptionKey) + ): Flow> { + return flow> { + emit(safeApiCall { defaultSource.getApiUser(apiVersion, userId = BuildConfig.MOMO_API_USER_ID, productSubscriptionKey = productSubscriptionKey) }) + }.flowOn(Dispatchers.IO) } /** @@ -117,12 +127,13 @@ class DefaultRepository @Inject constructor( * @param productSubscriptionKey The subscription key for the product. * @return A [Response] containing the created [ApiKey]. */ - suspend fun createApiKey( + fun createApiKey( apiVersion: String, productSubscriptionKey: String - ): Response { - return authenticationService - .createApiKey(apiVersion, BuildConfig.MOMO_API_USER_ID, productSubscriptionKey) + ): Flow> { + return flow> { + emit(safeApiCall { defaultSource.createApiKey(apiVersion = apiVersion, userId = BuildConfig.MOMO_API_USER_ID, productSubscriptionKey = productSubscriptionKey) }) + }.flowOn(Dispatchers.IO) } /** @@ -132,11 +143,13 @@ class DefaultRepository @Inject constructor( * @param productType The type of product for which to obtain the access token. * @return A [Response] containing the obtained [AccessToken]. */ - suspend fun getAccessToken( + fun getAccessToken( productSubscriptionKey: String, productType: String - ): Response { - return authenticationService.getAccessToken(productType, productSubscriptionKey) + ): Flow> { + return flow> { + emit(safeApiCall { defaultSource.getAccessToken(productType = productType, productSubscriptionKey = productSubscriptionKey) }) + }.flowOn(Dispatchers.IO) } /** diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/repository/DefaultSource.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/repository/DefaultSource.kt new file mode 100644 index 00000000..c9c3a647 --- /dev/null +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/repository/DefaultSource.kt @@ -0,0 +1,78 @@ +/* + * Copyright 2023-2024, Benjamin Mwalimu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.rekast.sdk.repository + +import io.rekast.sdk.model.ProviderCallBackHost +import io.rekast.sdk.network.service.AuthenticationService +import javax.inject.Inject + +/** + * DefaultSource is responsible for handling API calls related to user management + * and authentication in the MTN MOMO SDK. + * + * This class acts as a bridge between the repository and the authentication service, + * providing methods to create API users, retrieve user details, create API keys, + * and obtain access tokens. + * + * @property authenticationService The service for handling authentication-related API calls. + */ +class DefaultSource @Inject constructor(private val authenticationService: AuthenticationService) { + + /** + * Creates a new API user. + * + * @param providerCallBackHost The callback host for the provider. + * @param apiVersion The version of the API to use. + * @param uuid A unique identifier for the request. + * @param productSubscriptionKey The subscription key for the product. + * @return A [Response] containing the created [ApiUser]. + */ + suspend fun createApiUser( + providerCallBackHost: ProviderCallBackHost, + apiVersion: String, + uuid: String, + productSubscriptionKey: String + ) = authenticationService.createApiUser(providerCallBackHost = providerCallBackHost, apiVersion = apiVersion, uuid = uuid, productSubscriptionKey = productSubscriptionKey) + + /** + * Retrieves the details of an existing API user. + * + * @param apiVersion The version of the API to use. + * @param userId The ID of the API user to retrieve. + * @param productSubscriptionKey The subscription key for the product. + * @return A [Response] containing the requested [ApiUser]. + */ + suspend fun getApiUser(apiVersion: String, userId: String, productSubscriptionKey: String) = authenticationService.getApiUser(apiVersion = apiVersion, apiUser = userId, productSubscriptionKey = productSubscriptionKey) + + /** + * Creates a new API key for the specified API user. + * + * @param apiVersion The version of the API to use. + * @param userId The ID of the API user for whom to create the key. + * @param productSubscriptionKey The subscription key for the product. + * @return A [Response] containing the generated [ApiKey]. + */ + suspend fun createApiKey(apiVersion: String, userId: String, productSubscriptionKey: String) = authenticationService.createApiKey(apiVersion = apiVersion, apiUser = userId, productSubscriptionKey = productSubscriptionKey) + + /** + * Obtains an access token for the specified product type. + * + * @param productType The type of product for which to obtain the access token. + * @param productSubscriptionKey The subscription key for the product. + * @return A [Response] containing the obtained [AccessToken]. + */ + suspend fun getAccessToken(productType: String, productSubscriptionKey: String) = authenticationService.getAccessToken(productType = productType, productSubscriptionKey = productSubscriptionKey) +} diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/repository/data/DataResponse.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/repository/data/DataResponse.kt new file mode 100644 index 00000000..3cdf0a00 --- /dev/null +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/repository/data/DataResponse.kt @@ -0,0 +1,64 @@ +/* + * Copyright 2023-2024, Benjamin Mwalimu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.rekast.sdk.repository.data + +import retrofit2.Response + +/** + * Abstract class that provides a method for safely making API calls. + * + * This class contains a method to handle API requests and return results + * wrapped in a [NetworkResult]. It handles both successful responses and errors. + */ +abstract class DataResponse { + + /** + * Safely makes an API call and returns the result. + * + * This method executes the provided API request and checks if the response + * is successful. If successful, it returns the response body wrapped in a + * [NetworkResult.Success]. If the response is not successful or an exception + * occurs, it returns an error wrapped in a [NetworkResult.Error]. + * + * @param apiRequest A suspend function that represents the API request to be made. + * @return A [NetworkResult] containing the result of the API call. + */ + suspend fun safeApiCall(apiRequest: suspend () -> Response): NetworkResult { + try { + val response = apiRequest() + if (response.isSuccessful) { + val body = response.body() + body?.let { + return NetworkResult.Success(body) + } + } + return error("${response.code()} ${response.message()}") + } catch (e: Exception) { + return error(e.message ?: e.toString()) + } + } + + /** + * Creates an error result for the API call. + * + * This method wraps the provided error message in a [NetworkResult.Error]. + * + * @param errorMessage The error message to be returned. + * @return A [NetworkResult.Error] containing the error message. + */ + private fun error(errorMessage: String): NetworkResult = + NetworkResult.Error("Api call fail $errorMessage") +} diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/repository/data/NetworkResult.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/repository/data/NetworkResult.kt new file mode 100644 index 00000000..08aab87d --- /dev/null +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/repository/data/NetworkResult.kt @@ -0,0 +1,53 @@ +/* + * Copyright 2023-2024, Benjamin Mwalimu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.rekast.sdk.repository.data + +/** + * A sealed class representing the result of a network operation. + * + * This class encapsulates the possible outcomes of a network request, + * including success, error, and loading states. + * + * @param T The type of the response data. + * @property response The response data if the operation was successful. + * @property message An optional message providing additional information about the result. + */ +sealed class NetworkResult( + val response: T? = null, + val message: String? = null +) { + /** + * Represents a successful network operation. + * + * @param response The successful response data. + */ + class Success(response: T) : NetworkResult(response) + + /** + * Represents an error that occurred during a network operation. + * + * @param message A message describing the error. + * @param response The response data, if any, associated with the error. + */ + class Error(message: String, response: T? = null) : NetworkResult(response, message) + + /** + * Represents a loading state for a network operation. + * + * This can be used to indicate that a network request is in progress. + */ + class Loading : NetworkResult() +} diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/AccountHolderType.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/AccountHolderType.kt index bc4087f8..0a1bbfac 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/AccountHolderType.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/AccountHolderType.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/MomoAPIErrorResponses.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/MomoAPIErrorResponses.kt index bcd3f375..535b9262 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/MomoAPIErrorResponses.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/MomoAPIErrorResponses.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/MomoConstants.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/MomoConstants.kt index 40866214..44f3564f 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/MomoConstants.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/MomoConstants.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/ProductType.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/ProductType.kt index 46b3aa78..205ccb1f 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/ProductType.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/ProductType.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/Settings.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/Settings.kt index 66311d2f..da7d0a64 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/Settings.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/Settings.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,6 +88,7 @@ class Settings @Inject constructor() { BuildConfig.MOMO_COLLECTION_SECONDARY_KEY } } + ProductType.REMITTANCE -> { if (StringUtils.isNotBlank(BuildConfig.MOMO_REMITTANCE_PRIMARY_KEY)) { BuildConfig.MOMO_REMITTANCE_PRIMARY_KEY @@ -95,6 +96,7 @@ class Settings @Inject constructor() { BuildConfig.MOMO_REMITTANCE_SECONDARY_KEY } } + ProductType.DISBURSEMENTS -> { if (StringUtils.isNotBlank(BuildConfig.MOMO_DISBURSEMENTS_PRIMARY_KEY)) { BuildConfig.MOMO_DISBURSEMENTS_PRIMARY_KEY diff --git a/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/TransactionStatus.kt b/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/TransactionStatus.kt index ebc53fa8..629a4f8a 100644 --- a/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/TransactionStatus.kt +++ b/android/momo-api-sdk/src/main/java/io/rekast/sdk/utils/TransactionStatus.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/test/java/io/rekast/sdk/repository/MomoAPIRepositoryTest.kt b/android/momo-api-sdk/src/test/java/io/rekast/sdk/repository/MomoAPIRepositoryTest.kt index 1ddcc543..f13ca30b 100644 --- a/android/momo-api-sdk/src/test/java/io/rekast/sdk/repository/MomoAPIRepositoryTest.kt +++ b/android/momo-api-sdk/src/test/java/io/rekast/sdk/repository/MomoAPIRepositoryTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/momo-api-sdk/src/test/java/io/rekast/sdk/utils/SettingsTest.kt b/android/momo-api-sdk/src/test/java/io/rekast/sdk/utils/SettingsTest.kt index c265e539..2945e57d 100644 --- a/android/momo-api-sdk/src/test/java/io/rekast/sdk/utils/SettingsTest.kt +++ b/android/momo-api-sdk/src/test/java/io/rekast/sdk/utils/SettingsTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/license-header.txt b/android/sample/license-header.txt index 019016d3..ad913993 100644 --- a/android/sample/license-header.txt +++ b/android/sample/license-header.txt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/androidTest/java/io/rekast/sdk/sample/ExampleInstrumentedTest.kt b/android/sample/src/androidTest/java/io/rekast/sdk/sample/ExampleInstrumentedTest.kt index 74b9f919..765b6142 100644 --- a/android/sample/src/androidTest/java/io/rekast/sdk/sample/ExampleInstrumentedTest.kt +++ b/android/sample/src/androidTest/java/io/rekast/sdk/sample/ExampleInstrumentedTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/MomoApplication.kt b/android/sample/src/main/java/io/rekast/sdk/sample/MomoApplication.kt index 242e76dd..bce8608c 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/MomoApplication.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/MomoApplication.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/accountdetails/AccountBalanceComponent.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/accountdetails/AccountBalanceComponent.kt index 842047e1..f67b099c 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/accountdetails/AccountBalanceComponent.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/accountdetails/AccountBalanceComponent.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/accountdetails/AccountStatusComponent.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/accountdetails/AccountStatusComponent.kt index 84bf62ac..3ef3b223 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/accountdetails/AccountStatusComponent.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/accountdetails/AccountStatusComponent.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/accountdetails/BasicUserInfoComponent.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/accountdetails/BasicUserInfoComponent.kt index fe8bf713..b71a381e 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/accountdetails/BasicUserInfoComponent.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/accountdetails/BasicUserInfoComponent.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/CircularProgressBarComponent.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/CircularProgressBarComponent.kt index dbdcac2c..e7d93027 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/CircularProgressBarComponent.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/CircularProgressBarComponent.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/PaymentDataCaptureComponent.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/PaymentDataCaptureComponent.kt index 0ad4f7e2..5e60122c 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/PaymentDataCaptureComponent.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/PaymentDataCaptureComponent.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/SnackBarComponent.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/SnackBarComponent.kt index cfcdf662..a3438159 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/SnackBarComponent.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/SnackBarComponent.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/TextFieldDefaultsComponent.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/TextFieldDefaultsComponent.kt index bd9dad2d..73d74129 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/TextFieldDefaultsComponent.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/general/TextFieldDefaultsComponent.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/mainscreen/BasicUserInfoComponent.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/mainscreen/BasicUserInfoComponent.kt index b6f2c281..24026836 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/mainscreen/BasicUserInfoComponent.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/mainscreen/BasicUserInfoComponent.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/screens/PaymentDataCaptureComponent.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/screens/PaymentDataCaptureComponent.kt index 3b5cd00b..d0c813ab 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/screens/PaymentDataCaptureComponent.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/screens/PaymentDataCaptureComponent.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/screens/PaymentDataDisplayComponent.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/screens/PaymentDataDisplayComponent.kt index 0b5d194f..61fc02d6 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/screens/PaymentDataDisplayComponent.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/components/screens/PaymentDataDisplayComponent.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/drawer/Drawer.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/drawer/Drawer.kt index e4c7b062..1252be50 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/drawer/Drawer.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/drawer/Drawer.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/drawer/DrawerItem.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/drawer/DrawerItem.kt index eb36f53d..9d30b4b9 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/drawer/DrawerItem.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/drawer/DrawerItem.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/navigation/NavigationDrawerItem.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/navigation/NavigationDrawerItem.kt index 1a9d66e8..1a878a51 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/navigation/NavigationDrawerItem.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/navigation/NavigationDrawerItem.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/topbar/TopBar.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/topbar/TopBar.kt index 0f935871..60312aaf 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/topbar/TopBar.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/navigation/topbar/TopBar.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/splash/SplashScreen.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/splash/SplashScreen.kt index 7777cf0e..980a63f0 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/splash/SplashScreen.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/splash/SplashScreen.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/splash/SplashScreenActivity.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/splash/SplashScreenActivity.kt index 41665e47..46be81ba 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/splash/SplashScreenActivity.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/splash/SplashScreenActivity.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/theme/Colors.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/theme/Colors.kt index 6098d933..556eef82 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/theme/Colors.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/theme/Colors.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/ui/theme/Themes.kt b/android/sample/src/main/java/io/rekast/sdk/sample/ui/theme/Themes.kt index 8e6be966..4b50d5a0 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/ui/theme/Themes.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/ui/theme/Themes.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/utils/AndroidExtensions.kt b/android/sample/src/main/java/io/rekast/sdk/sample/utils/AndroidExtensions.kt index c788242c..e771824b 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/utils/AndroidExtensions.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/utils/AndroidExtensions.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/utils/Constants.kt b/android/sample/src/main/java/io/rekast/sdk/sample/utils/Constants.kt index a0da3320..f48495fd 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/utils/Constants.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/utils/Constants.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/utils/DispatcherProvider.kt b/android/sample/src/main/java/io/rekast/sdk/sample/utils/DispatcherProvider.kt index 1e9d1ab9..612bf019 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/utils/DispatcherProvider.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/utils/DispatcherProvider.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/utils/SnackBarComponentConfiguration.kt b/android/sample/src/main/java/io/rekast/sdk/sample/utils/SnackBarComponentConfiguration.kt index 28516747..ec7c8f1b 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/utils/SnackBarComponentConfiguration.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/utils/SnackBarComponentConfiguration.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/utils/SnackBarThemeOptions.kt b/android/sample/src/main/java/io/rekast/sdk/sample/utils/SnackBarThemeOptions.kt index 0f3b4734..4d9b98e8 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/utils/SnackBarThemeOptions.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/utils/SnackBarThemeOptions.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/utils/Utils.kt b/android/sample/src/main/java/io/rekast/sdk/sample/utils/Utils.kt index e5c398d5..efd3040f 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/utils/Utils.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/utils/Utils.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/utils/annotation/ExcludeFromJacocoGeneratedReport.kt b/android/sample/src/main/java/io/rekast/sdk/sample/utils/annotation/ExcludeFromJacocoGeneratedReport.kt index eb777351..66c89187 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/utils/annotation/ExcludeFromJacocoGeneratedReport.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/utils/annotation/ExcludeFromJacocoGeneratedReport.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/utils/annotation/PreviewExcludeGenerated.kt b/android/sample/src/main/java/io/rekast/sdk/sample/utils/annotation/PreviewExcludeGenerated.kt index d370b950..e5166326 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/utils/annotation/PreviewExcludeGenerated.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/utils/annotation/PreviewExcludeGenerated.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/utils/annotation/PreviewWithBackgroundExcludeGenerated.kt b/android/sample/src/main/java/io/rekast/sdk/sample/utils/annotation/PreviewWithBackgroundExcludeGenerated.kt index 1a30021f..fb721ea6 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/utils/annotation/PreviewWithBackgroundExcludeGenerated.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/utils/annotation/PreviewWithBackgroundExcludeGenerated.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/AppMainActivity.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/AppMainActivity.kt index b55f26f3..613d406e 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/AppMainActivity.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/AppMainActivity.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/AppMainViewModel.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/AppMainViewModel.kt index 5cb2a931..959ba0d3 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/AppMainViewModel.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/AppMainViewModel.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,16 +21,16 @@ import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel import dagger.hilt.android.qualifiers.ApplicationContext import io.rekast.sdk.BuildConfig -import io.rekast.sdk.model.MomoTransaction +import io.rekast.sdk.model.ProviderCallBackHost import io.rekast.sdk.model.authentication.credentials.AccessTokenCredentials import io.rekast.sdk.model.authentication.credentials.BasicAuthCredentials import io.rekast.sdk.repository.DefaultRepository +import io.rekast.sdk.repository.data.NetworkResult import io.rekast.sdk.sample.utils.SnackBarComponentConfiguration import io.rekast.sdk.sample.utils.Utils import io.rekast.sdk.utils.ProductType import io.rekast.sdk.utils.Settings import javax.inject.Inject -import kotlin.toString import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.SharedFlow @@ -43,11 +43,16 @@ import timber.log.Timber * ViewModel for managing authentication and API interactions. * * This ViewModel handles setting authentication credentials and making API calls. + * + * @property defaultRepository The repository for handling API calls related to MTN MOMO. + * @property context The application context for accessing resources and utilities. + * @property settings The settings utility for managing application settings. */ @HiltViewModel open class AppMainViewModel @Inject constructor( private val defaultRepository: DefaultRepository, - @ApplicationContext private val context: Context + @ApplicationContext private val context: Context, + private val settings: Settings ) : ViewModel() { private val _snackBarStateFlow = MutableSharedFlow() @@ -80,27 +85,27 @@ open class AppMainViewModel @Inject constructor( /** * Checks the user status and creates an API user if necessary. + * + * This method checks if the API user exists and creates a new one if it does not. */ fun checkUser() { - viewModelScope.launch { - val validUser = defaultRepository.checkApiUser( - BuildConfig.MOMO_API_VERSION_V1, - Settings().getProductSubscriptionKeys(ProductType.COLLECTION) - ) - - if (validUser.isSuccessful == true) { - createApiKey() - } else { - Timber.e(validUser.errorBody()?.string()) - val createdUser = defaultRepository.createApiUser( - BuildConfig.MOMO_API_VERSION_V1, - BuildConfig.MOMO_API_USER_ID, - Settings().getProductSubscriptionKeys(ProductType.COLLECTION) - ) - if (createdUser.isSuccessful == true) { - checkUser() - } else { - Timber.e("ApiUser was not created") + val productType = settings.getProductSubscriptionKeys(ProductType.COLLECTION) + viewModelScope.launch(Dispatchers.IO) { + defaultRepository.checkApiUser(BuildConfig.MOMO_API_VERSION_V1, productType).collect { apiUser -> + when (apiUser) { + is NetworkResult.Success -> { createApiKey() } + is NetworkResult.Error -> { + Timber.e(apiUser.message) + val providerCallBackHost = ProviderCallBackHost(providerCallbackHost = BuildConfig.MOMO_PROVIDER_CALBACK_HOST) + defaultRepository.createApiUser(providerCallBackHost, BuildConfig.MOMO_API_VERSION_V1, BuildConfig.MOMO_API_USER_ID, productType).collect { newApiUser -> + when (newApiUser) { + is NetworkResult.Success -> { checkUser() } + is NetworkResult.Error -> { Timber.e("New Api user was not created %s", newApiUser.message) } + else -> { Timber.e("An error occurred") } + } + } + } + else -> { Timber.e("An error occurred") } } } } @@ -108,28 +113,31 @@ open class AppMainViewModel @Inject constructor( /** * Creates an API key for the user. + * + * This method retrieves the API key for the user and sets up basic authentication. */ private fun createApiKey() { + val productType = settings.getProductSubscriptionKeys(ProductType.REMITTANCE) viewModelScope.launch(Dispatchers.IO) { val apiUserKey = this@AppMainViewModel.context.let { Utils.getApiKey(it) } if (StringUtils.isNotBlank(apiUserKey)) { this@AppMainViewModel.setBasicAuth(BuildConfig.MOMO_API_USER_ID, apiUserKey.toString()) getAccessToken() } else { - val userApiKey = defaultRepository.createApiKey( - BuildConfig.MOMO_API_VERSION_V1, - Settings().getProductSubscriptionKeys(ProductType.REMITTANCE) - ) - try { - if (userApiKey.isSuccessful == true) { - context?.let { Utils.saveApiKey(it, userApiKey.body()?.apiKey.toString()) } - this@AppMainViewModel.setBasicAuth(BuildConfig.MOMO_API_USER_ID, apiUserKey.toString()) - Timber.d("Api Key fetched and saved successfully") - getAccessToken() - } else { - Timber.e("Api Key creation failed %s", userApiKey?.errorBody()?.string()) + defaultRepository.createApiKey(BuildConfig.MOMO_API_VERSION_V1, productType).collect { apiKey -> + when (apiKey) { + is NetworkResult.Success -> { + try { + context.let { Utils.saveApiKey(it, apiKey.response?.apiKey.toString()) } + this@AppMainViewModel.setBasicAuth(BuildConfig.MOMO_API_USER_ID, apiUserKey.toString()) + Timber.d("Api Key fetched and saved successfully") + getAccessToken() + } catch (exception: Exception) { + Timber.d("An Error occurred %s", exception.message) + } + } + else -> { Timber.e("Api Key creation failed %s", apiKey.message) } } - } catch (exception: Exception) { } } } @@ -137,32 +145,37 @@ open class AppMainViewModel @Inject constructor( /** * Retrieves the access token for the user. + * + * This method checks if the access token is available and retrieves it if not. */ private fun getAccessToken() { + val productType = settings.getProductSubscriptionKeys(ProductType.REMITTANCE) viewModelScope.launch(Dispatchers.IO) { - val apiUserKey = context?.let { Utils.getApiKey(it) } - val accessToken = context?.let { Utils.getAccessToken(it) } + val apiUserKey = context.let { Utils.getApiKey(it) } + val accessToken = context.let { Utils.getAccessToken(it) } if (StringUtils.isNotBlank(apiUserKey) && StringUtils.isBlank(accessToken)) { - apiUserKey?.let { apiKey -> - val accessToken = defaultRepository.getAccessToken( - Settings().getProductSubscriptionKeys(ProductType.REMITTANCE), - ProductType.REMITTANCE.productType - ) - try { - if (accessToken?.isSuccessful == true) { - context?.let { activityContext -> - Utils.saveAccessToken( - activityContext, - accessToken.body() - ) + apiUserKey.let { apiKey -> + defaultRepository.getAccessToken(productType, ProductType.REMITTANCE.productType).collect { accessToken -> + when (accessToken) { + is NetworkResult.Success -> { + try { + context.let { activityContext -> + Utils.saveAccessToken(activityContext, accessToken.response) + } + this@AppMainViewModel.setAccessToken(Utils.getAccessToken(context)) + Timber.d("Access token created and saved successfully") + } catch (exception: Exception) { + Timber.d("An Error occurred %s", exception.message) + } + } + is NetworkResult.Error -> { + Timber.e("Access token creation failed %s", accessToken.message) + } + else -> { + Timber.e("Access token creation failed") } - this@AppMainViewModel.setAccessToken(Utils.getAccessToken(context)) - Timber.d("Access token created and saved successfully") - } else { - Timber.e("Access token creation failed %s", accessToken?.errorBody()?.string()) } - } catch (exception: Exception) { } } } else { @@ -217,115 +230,70 @@ open class AppMainViewModel @Inject constructor( } } } - }*/ + } - /* private fun getApiKey() { - viewModelScope.launch { - val apiUserKey = context?.let { Utils.getApiKey(it) } - if (StringUtils.isNotBlank(apiUserKey)) { - getAccessToken() - } else { - defaultRepository.getUserApiKey( - Settings().getProductSubscriptionKeys(ProductType.REMITTANCE), - BuildConfig.MOMO_API_VERSION_V1 - ) { momoAPIResult -> - when (momoAPIResult) { - is MomoResponse.Success -> { - val generatedApiUserKey = momoAPIResult.value - context?.let { Utils.saveApiKey(it, generatedApiUserKey.apiKey) } - getAccessToken() - } - is MomoResponse.Failure -> { - val momoAPIException = momoAPIResult.momoException!! - } - } - } - } - } - } - private fun getAccessToken() { - viewModelScope.launch { - val apiUserKey = context?.let { Utils.getApiKey(it) } - val accessToken = context?.let { Utils.getAccessToken(it) } - if (StringUtils.isNotBlank(apiUserKey) && StringUtils.isBlank(accessToken)) { - apiUserKey?.let { apiKey -> - defaultRepository.getAccessToken( - Settings().getProductSubscriptionKeys(ProductType.REMITTANCE), - apiKey, - ProductType.REMITTANCE.productType - ) { momoAPIResult -> - when (momoAPIResult) { - is MomoResponse.Success -> { - val generatedAccessToken = momoAPIResult.value - context?.let { activityContext -> - Utils.saveAccessToken( - activityContext, - generatedAccessToken - ) - } - } - is MomoResponse.Failure -> { - val momoAPIException = momoAPIResult.momoException!! - } - } - } - } - } else { - } - } - } - fun refund(requestToPayUuid: String) { - val accessToken = context?.let { Utils.getAccessToken(it) } - val transactionUuid = Settings().generateUUID() - if (StringUtils.isNotBlank(accessToken) && StringUtils.isNotBlank(requestToPayUuid)) { - val creditTransaction = createRefundTransaction(requestToPayUuid) - accessToken?.let { - defaultRepository.refund( - it, - creditTransaction, - BuildConfig.MOMO_API_VERSION_V2, - Settings().getProductSubscriptionKeys(ProductType.DISBURSEMENTS), - transactionUuid - ) { momoAPIResult -> - when (momoAPIResult) { - is MomoResponse.Success -> { - getRefundStatus(transactionUuid) - } - is MomoResponse.Failure -> { - val momoAPIException = momoAPIResult.momoException - } + /** + * Requests a refund for a transaction. + * + * @param requestToPayUuid The UUID of the request to pay. + */ + fun refund(requestToPayUuid: String) { + val accessToken = context?.let { Utils.getAccessToken(it) } + val transactionUuid = Settings().generateUUID() + if (StringUtils.isNotBlank(accessToken) && StringUtils.isNotBlank(requestToPayUuid)) { + val creditTransaction = createRefundTransaction(requestToPayUuid) + accessToken?.let { + defaultRepository.refund( + it, + creditTransaction, + BuildConfig.MOMO_API_VERSION_V2, + Settings().getProductSubscriptionKeys(ProductType.DISBURSEMENTS), + transactionUuid + ) { momoAPIResult -> + when (momoAPIResult) { + is MomoResponse.Success -> { + getRefundStatus(transactionUuid) + } + is MomoResponse.Failure -> { + val momoAPIException = momoAPIResult.momoException } } } } } + } - private fun getRefundStatus(referenceId: String) { - val accessToken = context?.let { Utils.getAccessToken(it) } - if (StringUtils.isNotBlank(accessToken)) { - accessToken?.let { - defaultRepository.getRefundStatus( - referenceId, - BuildConfig.MOMO_API_VERSION_V1, - Settings().getProductSubscriptionKeys(ProductType.DISBURSEMENTS), - it - ) { momoAPIResult -> - when (momoAPIResult) { - is MomoResponse.Success -> { - val completeTransfer = - Gson().fromJson(momoAPIResult.value!!.source().readUtf8(), MomoTransaction::class.java) - Timber.d(completeTransfer.toString()) - } - is MomoResponse.Failure -> { - val momoAPIException = momoAPIResult.momoException - } + /** + * Retrieves the status of a refund transaction. + * + * @param referenceId The reference ID of the transaction. + */ + private fun getRefundStatus(referenceId: String) { + val accessToken = context?.let { Utils.getAccessToken(it) } + if (StringUtils.isNotBlank(accessToken)) { + accessToken?.let { + defaultRepository.getRefundStatus( + referenceId, + BuildConfig.MOMO_API_VERSION_V1, + Settings().getProductSubscriptionKeys(ProductType.DISBURSEMENTS), + it + ) { momoAPIResult -> + when (momoAPIResult) { + is MomoResponse.Success -> { + val completeTransfer = + Gson().fromJson(momoAPIResult.value!!.source().readUtf8(), MomoTransaction::class.java) + Timber.d(completeTransfer.toString()) + } + is MomoResponse.Failure -> { + val momoAPIException = momoAPIResult.momoException } } } } - }*/ + } + } /** * Creates a refund transaction. @@ -335,19 +303,19 @@ open class AppMainViewModel @Inject constructor( */ private fun createRefundTransaction(requestToPayUuid: String): MomoTransaction { return MomoTransaction( - "30", - "EUR", - null, - Settings().generateUUID(), - null, - null, - "Testing", - "The Good Company", - null, - null, - requestToPayUuid + amount = "30", + currency = "EUR", + financialTransactionId = null, + externalId = Settings().generateUUID(), + payee = null, + payer = null, + payerMessage = "Testing", + payeeNote = "The Good Company", + status = null, + reason = null, + referenceIdToRefund = requestToPayUuid ) - } + }*/ /** * Emits the state of the SnackBar component. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/pay/CollectionPayScreen.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/pay/CollectionPayScreen.kt index d92918df..4863de2e 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/pay/CollectionPayScreen.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/pay/CollectionPayScreen.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/pay/CollectionPayScreenFragment.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/pay/CollectionPayScreenFragment.kt index 5b431086..9f4a7678 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/pay/CollectionPayScreenFragment.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/pay/CollectionPayScreenFragment.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/pay/CollectionPayScreenViewModel.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/pay/CollectionPayScreenViewModel.kt index 453bf140..e930387d 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/pay/CollectionPayScreenViewModel.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/pay/CollectionPayScreenViewModel.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/withdraw/CollectionWithdrawScreen.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/withdraw/CollectionWithdrawScreen.kt index bd1f8060..5a74225e 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/withdraw/CollectionWithdrawScreen.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/withdraw/CollectionWithdrawScreen.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/withdraw/CollectionWithdrawScreenFragment.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/withdraw/CollectionWithdrawScreenFragment.kt index 8e9a7906..f5224757 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/withdraw/CollectionWithdrawScreenFragment.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/withdraw/CollectionWithdrawScreenFragment.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/withdraw/CollectionWithdrawScreenViewModel.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/withdraw/CollectionWithdrawScreenViewModel.kt index ff437397..c098b73c 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/withdraw/CollectionWithdrawScreenViewModel.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/collection/withdraw/CollectionWithdrawScreenViewModel.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/deposit/DisbursementDepositScreen.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/deposit/DisbursementDepositScreen.kt index eae1b14a..7a05801c 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/deposit/DisbursementDepositScreen.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/deposit/DisbursementDepositScreen.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/deposit/DisbursementDepositScreenFragment.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/deposit/DisbursementDepositScreenFragment.kt index 3dbdcfe0..9f8081ea 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/deposit/DisbursementDepositScreenFragment.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/deposit/DisbursementDepositScreenFragment.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/deposit/DisbursementDepositScreenViewModel.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/deposit/DisbursementDepositScreenViewModel.kt index 1baa49fa..ce1a412d 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/deposit/DisbursementDepositScreenViewModel.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/deposit/DisbursementDepositScreenViewModel.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/refund/DisbursementRefundScreen.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/refund/DisbursementRefundScreen.kt index 03ba36d3..7f542571 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/refund/DisbursementRefundScreen.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/refund/DisbursementRefundScreen.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/refund/DisbursementRefundScreenFragment.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/refund/DisbursementRefundScreenFragment.kt index 230621cb..e4946552 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/refund/DisbursementRefundScreenFragment.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/refund/DisbursementRefundScreenFragment.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/refund/DisbursementRefundScreenViewModel.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/refund/DisbursementRefundScreenViewModel.kt index 030ba3be..dbfa9504 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/refund/DisbursementRefundScreenViewModel.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/disbursement/refund/DisbursementRefundScreenViewModel.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/home/HomeScreen.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/home/HomeScreen.kt index 93f4779c..dd48c03c 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/home/HomeScreen.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/home/HomeScreen.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/home/HomeScreenFragment.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/home/HomeScreenFragment.kt index 413ead83..8b48e9bb 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/home/HomeScreenFragment.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/home/HomeScreenFragment.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/home/HomeScreenViewModel.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/home/HomeScreenViewModel.kt index c40a174d..d60d6c40 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/home/HomeScreenViewModel.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/home/HomeScreenViewModel.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/remittance/RemittanceScreen.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/remittance/RemittanceScreen.kt index adab0d6c..33f39678 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/remittance/RemittanceScreen.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/remittance/RemittanceScreen.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/remittance/RemittanceScreenFragment.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/remittance/RemittanceScreenFragment.kt index 9147fd11..a3de7190 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/remittance/RemittanceScreenFragment.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/remittance/RemittanceScreenFragment.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/main/java/io/rekast/sdk/sample/views/remittance/RemittanceScreenViewModel.kt b/android/sample/src/main/java/io/rekast/sdk/sample/views/remittance/RemittanceScreenViewModel.kt index 29250814..c00fe1b9 100644 --- a/android/sample/src/main/java/io/rekast/sdk/sample/views/remittance/RemittanceScreenViewModel.kt +++ b/android/sample/src/main/java/io/rekast/sdk/sample/views/remittance/RemittanceScreenViewModel.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/test/java/io/rekast/sdk/sample/ExampleUnitTest.kt b/android/sample/src/test/java/io/rekast/sdk/sample/ExampleUnitTest.kt index 3556d322..68d2c707 100644 --- a/android/sample/src/test/java/io/rekast/sdk/sample/ExampleUnitTest.kt +++ b/android/sample/src/test/java/io/rekast/sdk/sample/ExampleUnitTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/android/sample/src/test/java/io/rekast/sdk/sample/views/MainActivityTest.kt b/android/sample/src/test/java/io/rekast/sdk/sample/views/MainActivityTest.kt index 51665a02..5144ae12 100644 --- a/android/sample/src/test/java/io/rekast/sdk/sample/views/MainActivityTest.kt +++ b/android/sample/src/test/java/io/rekast/sdk/sample/views/MainActivityTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 - 2024, Benjamin Mwalimu + * Copyright 2023-2024, Benjamin Mwalimu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.