From ca11aae92338e439e8009c4e829894b2bbc80478 Mon Sep 17 00:00:00 2001 From: Ferdian Julianto Date: Mon, 20 Feb 2023 16:54:49 +0700 Subject: [PATCH] refactor: move corekit to uikit --- corekit/.gitignore | 1 - corekit/build.gradle.kts | 135 ----- corekit/consumer-rules.pro | 0 corekit/proguard-rules.pro | 25 - .../sdk/corekit/ExampleInstrumentedTest.kt | 24 - corekit/src/main/AndroidManifest.xml | 7 - .../com/midtrans/sdk/corekit/SnapCoreTest.kt | 106 ---- ...nvenienceStorePaymentRequestBuilderTest.kt | 29 - .../CreditCardPaymentRequestBuilderTest.kt | 70 --- .../DirectDebitPaymentRequestBuilderTest.kt | 63 --- .../EWalletRequestBuilderTest.kt | 43 -- .../NormalCardTokenRequestBuilderTest.kt | 72 --- .../OneClickCardPaymentRequestBuilderTest.kt | 70 --- .../PayLaterPaymentRequestBuilderTest.kt | 23 - .../TwoClicksCardTokenRequestBuilderTest.kt | 75 --- .../internal/analytics/EventAnalyticsTest.kt | 518 ------------------ .../internal/usecase/PaymentUsecaseTest.kt | 347 ------------ .../corekit/internal/util/StringUtilTest.kt | 15 - .../org.mockito.plugins.MockMaker | 1 - settings.gradle.kts | 1 - ui/build.gradle.kts | 47 +- ui/src/main/AndroidManifest.xml | 3 + .../com/midtrans/sdk/corekit/core/Logger.java | 10 +- .../com/midtrans/sdk/corekit/SnapCore.kt | 0 .../sdk/corekit/api/callback/Callback.kt | 1 - .../CallbackUnimplementedException.kt | 0 .../exception/InvalidPaymentTypeException.kt | 0 .../exception/MissingParameterException.kt | 0 .../sdk/corekit/api/exception/SnapError.kt | 0 .../midtrans/sdk/corekit/api/model/Address.kt | 0 .../corekit/api/model/BankPointResponse.kt | 0 .../corekit/api/model/BankTransferRequest.kt | 0 .../midtrans/sdk/corekit/api/model/BinData.kt | 0 .../sdk/corekit/api/model/BinDetail.kt | 0 .../sdk/corekit/api/model/BinResponse.kt | 0 .../corekit/api/model/CardTokenResponse.kt | 0 .../sdk/corekit/api/model/CreditCard.kt | 0 .../sdk/corekit/api/model/CustomerDetails.kt | 0 .../api/model/DeleteSavedCardResponse.kt | 0 .../midtrans/sdk/corekit/api/model/Expiry.kt | 0 .../sdk/corekit/api/model/FreeText.kt | 0 .../sdk/corekit/api/model/FreeTextLanguage.kt | 0 .../corekit/api/model/GopayPaymentCallback.kt | 0 .../sdk/corekit/api/model/Installment.kt | 0 .../sdk/corekit/api/model/InstallmentBank.kt | 0 .../sdk/corekit/api/model/ItemDetails.kt | 0 .../sdk/corekit/api/model/PaymentCallback.kt | 0 .../sdk/corekit/api/model/PaymentMethod.kt | 0 .../sdk/corekit/api/model/PaymentOption.kt | 0 .../sdk/corekit/api/model/PaymentType.kt | 0 .../midtrans/sdk/corekit/api/model/Promo.kt | 0 .../sdk/corekit/api/model/PromoDetails.kt | 0 .../sdk/corekit/api/model/PromoRequest.kt | 0 .../sdk/corekit/api/model/PromoResponse.kt | 0 .../sdk/corekit/api/model/SavedToken.kt | 0 .../api/model/SnapTransactionDetail.kt | 0 .../corekit/api/model/TransactionResponse.kt | 0 .../corekit/api/model/TransactionResult.kt | 0 .../sdk/corekit/api/model/VaNumber.kt | 0 .../CreditCardTokenRequestBuilder.kt | 0 .../NormalCardTokenRequestBuilder.kt | 0 .../TwoClickCardTokenRequestBuilder.kt | 0 .../BankTransferPaymentRequestBuilder.kt | 0 .../ConvenienceStorePaymentRequestBuilder.kt | 0 .../CreditCardPaymentRequestBuilder.kt | 0 .../DirectDebitPaymentRequestBuilder.kt | 0 .../payment/EWalletPaymentRequestBuilder.kt | 0 .../OneClickCardPaymentRequestBuilder.kt | 0 .../payment/PayLaterPaymentRequestBuilder.kt | 0 .../payment/PaymentRequestBuilder.kt | 0 .../snaptoken/SnapTokenRequestBuilder.kt | 0 .../internal/analytics/EventAnalytics.kt | 2 +- .../corekit/internal/analytics/EventName.kt | 0 .../internal/analytics/MixpanelTracker.kt | 0 .../corekit/internal/analytics/PageName.kt | 0 .../sdk/corekit/internal/config/Config.kt | 0 .../internal/constant/Authentication.kt | 0 .../internal/constant/CommonConstant.kt | 0 .../data/repository/BaseRepository.kt | 0 .../data/repository/CoreApiRepository.kt | 0 .../data/repository/MerchantApiRepository.kt | 0 .../data/repository/SnapRepository.kt | 0 .../internal/data/service/BaseService.kt | 0 .../internal/data/sharedpref/SharedData.kt | 0 .../corekit/internal/di/AnalyticsModule.kt | 2 +- .../corekit/internal/di/RepositoryModule.kt | 0 .../corekit/internal/di/RestClientModule.kt | 2 +- .../sdk/corekit/internal/di/SnapComponent.kt | 0 .../sdk/corekit/internal/di/UsecaseModule.kt | 0 .../corekit/internal/exception/ApiError.kt | 0 .../internal/extension/ViewExtensions.kt | 0 .../corekit/internal/mapper/InternalMapper.kt | 0 .../internal/network/MerchantInterceptor.kt | 0 .../network/SnapRequestAuthenticator.kt | 0 .../network/SnapRequestInterceptor.kt | 2 +- .../model/request/BankTransferRequest.kt | 0 .../model/request/CustomerDetailRequest.kt | 0 .../model/request/InstallmentRequest.kt | 0 .../network/model/request/PaymentParam.kt | 0 .../network/model/request/PaymentRequest.kt | 0 .../model/request/PromoDetailRequest.kt | 0 .../network/model/request/SnapTokenRequest.kt | 0 .../network/model/response/Callbacks.kt | 0 .../network/model/response/EnabledPayment.kt | 0 .../network/model/response/Merchant.kt | 0 .../model/response/MerchantPreferences.kt | 0 .../model/response/SnapTokenResponse.kt | 0 .../network/model/response/Transaction.kt | 0 .../model/response/TransactionDetails.kt | 0 .../internal/network/restapi/CoreApi.kt | 0 .../internal/network/restapi/MerchantApi.kt | 0 .../internal/network/restapi/PaymentApi.kt | 0 .../internal/network/restapi/SnapApi.kt | 0 .../internal/scheduler/BaseSdkScheduler.kt | 0 .../internal/scheduler/SdkScheduler.kt | 0 .../internal/scheduler/TestSdkScheduler.kt | 0 .../corekit/internal/usecase/AssetReader.kt | 0 .../internal/usecase/PaymentUsecase.kt | 0 .../corekit/internal/util/BytesExtensions.kt | 0 .../sdk/corekit/internal/util/NetworkUtil.kt | 0 .../corekit/internal/util/NumberExtension.kt | 0 .../sdk/corekit/internal/util/NumberUtil.kt | 0 .../corekit/internal/util/ObjectExtension.kt | 0 .../corekit/internal/util/SingleLiveEvent.kt | 0 .../corekit/internal/util/StringExtensions.kt | 0 .../sdk/corekit/internal/util/StringUtil.kt | 0 .../sdk/corekit/internal/util/TimeProvider.kt | 0 .../sdk/corekit/internal/util/Utils.kt | 0 .../corekit/internal/util/UuidGenerator.kt | 0 129 files changed, 53 insertions(+), 1641 deletions(-) delete mode 100644 corekit/.gitignore delete mode 100644 corekit/build.gradle.kts delete mode 100644 corekit/consumer-rules.pro delete mode 100644 corekit/proguard-rules.pro delete mode 100644 corekit/src/androidTest/java/com/midtrans/sdk/corekit/ExampleInstrumentedTest.kt delete mode 100644 corekit/src/main/AndroidManifest.xml delete mode 100644 corekit/src/test/java/com/midtrans/sdk/corekit/SnapCoreTest.kt delete mode 100644 corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/ConvenienceStorePaymentRequestBuilderTest.kt delete mode 100644 corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/CreditCardPaymentRequestBuilderTest.kt delete mode 100644 corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/DirectDebitPaymentRequestBuilderTest.kt delete mode 100644 corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/EWalletRequestBuilderTest.kt delete mode 100644 corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/NormalCardTokenRequestBuilderTest.kt delete mode 100644 corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/OneClickCardPaymentRequestBuilderTest.kt delete mode 100644 corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/PayLaterPaymentRequestBuilderTest.kt delete mode 100644 corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/TwoClicksCardTokenRequestBuilderTest.kt delete mode 100644 corekit/src/test/java/com/midtrans/sdk/corekit/internal/analytics/EventAnalyticsTest.kt delete mode 100644 corekit/src/test/java/com/midtrans/sdk/corekit/internal/usecase/PaymentUsecaseTest.kt delete mode 100644 corekit/src/test/java/com/midtrans/sdk/corekit/internal/util/StringUtilTest.kt delete mode 100644 corekit/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/SnapCore.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/callback/Callback.kt (76%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/CallbackUnimplementedException.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/InvalidPaymentTypeException.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/MissingParameterException.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/SnapError.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Address.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BankPointResponse.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BankTransferRequest.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinData.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinDetail.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinResponse.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CardTokenResponse.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CreditCard.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CustomerDetails.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/DeleteSavedCardResponse.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Expiry.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/FreeText.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/FreeTextLanguage.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/GopayPaymentCallback.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Installment.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/InstallmentBank.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/ItemDetails.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentCallback.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentMethod.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentOption.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentType.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Promo.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoDetails.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoRequest.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoResponse.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/SavedToken.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/SnapTransactionDetail.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/TransactionResponse.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/TransactionResult.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/model/VaNumber.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/CreditCardTokenRequestBuilder.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/NormalCardTokenRequestBuilder.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/TwoClickCardTokenRequestBuilder.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/BankTransferPaymentRequestBuilder.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/ConvenienceStorePaymentRequestBuilder.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/CreditCardPaymentRequestBuilder.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/DirectDebitPaymentRequestBuilder.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/EWalletPaymentRequestBuilder.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/OneClickCardPaymentRequestBuilder.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/PayLaterPaymentRequestBuilder.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/PaymentRequestBuilder.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/snaptoken/SnapTokenRequestBuilder.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/EventAnalytics.kt (99%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/EventName.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/MixpanelTracker.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/PageName.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/config/Config.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/constant/Authentication.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/constant/CommonConstant.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/BaseRepository.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/CoreApiRepository.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/MerchantApiRepository.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/SnapRepository.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/service/BaseService.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/sharedpref/SharedData.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/AnalyticsModule.kt (94%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/RepositoryModule.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/RestClientModule.kt (99%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/SnapComponent.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/UsecaseModule.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/exception/ApiError.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/extension/ViewExtensions.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/mapper/InternalMapper.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/MerchantInterceptor.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/SnapRequestAuthenticator.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/SnapRequestInterceptor.kt (92%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/BankTransferRequest.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/CustomerDetailRequest.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/InstallmentRequest.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PaymentParam.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PaymentRequest.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PromoDetailRequest.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/SnapTokenRequest.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Callbacks.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/EnabledPayment.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Merchant.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/MerchantPreferences.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/SnapTokenResponse.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Transaction.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/TransactionDetails.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/CoreApi.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/MerchantApi.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/PaymentApi.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/SnapApi.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/BaseSdkScheduler.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/SdkScheduler.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/TestSdkScheduler.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/usecase/AssetReader.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/usecase/PaymentUsecase.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/BytesExtensions.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NetworkUtil.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NumberExtension.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NumberUtil.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/ObjectExtension.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/SingleLiveEvent.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/StringExtensions.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/StringUtil.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/TimeProvider.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/Utils.kt (100%) rename {corekit => ui}/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/UuidGenerator.kt (100%) diff --git a/corekit/.gitignore b/corekit/.gitignore deleted file mode 100644 index 42afabfd2..000000000 --- a/corekit/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/corekit/build.gradle.kts b/corekit/build.gradle.kts deleted file mode 100644 index c751267e1..000000000 --- a/corekit/build.gradle.kts +++ /dev/null @@ -1,135 +0,0 @@ -plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("kotlin-kapt") - id("kotlin-parcelize") - id("maven-publish") -} - -android { - compileSdk = 32 - project.property("sdkVersion")?.let { - version = it - } - - defaultConfig { - minSdk = 21 - targetSdk = 32 - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile("proguard-android.txt"), - "proguard-rules.pro" - ) //TODO: check this working or not - buildConfigField("String", "SNAP_BASE_URL", "\"https://app.midtrans.com/snap/\"") - buildConfigField("String", "CORE_API_BASE_URL", "\"https://api.midtrans.com/\"") - buildConfigField("String", "MIXPANEL_TOKEN", "\"84ed63a9507c49b373945b13633b8a0c\"") - buildConfigField("String", "SDK_VERSION", "${project.property("sdkVersion")}") - } - - debug { - buildConfigField("String", "SNAP_BASE_URL", "\"https://app.sandbox.midtrans.com/snap/\"") - buildConfigField("String", "CORE_API_BASE_URL", "\"https://api.sandbox.midtrans.com/\"") - buildConfigField("String", "MIXPANEL_TOKEN", "\"f070570da8b882fda74c77541f0926a0\"") - buildConfigField("String", "SDK_VERSION", "${project.property("sdkVersion")}") - - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = ("1.8") - } - - publishing { - singleVariant("release") { - withSourcesJar() - withJavadocJar() - } - } -} - -afterEvaluate { - publishing { - publications { - // 1. configure repositories - repositories { - maven { - url = uri("https://github.com") //change to repo url - // credentials are stored in ~/.gradle/gradle.properties with ~ being the path of the home directory - credentials { - username = project.properties["maven_user_name"]?.toString() - ?: throw IllegalStateException("maven repo user name not found") - password = project.properties["maven_password"]?.toString() - ?: throw IllegalStateException("maven password not found") - } - } - } - // 2. configure publication - // 3. sign the artifacts - } - } -} - -dependencies { - - implementation(com.gtf.snap.KotlinExtensionLibraries.coreKtx) - implementation(com.gtf.snap.AndroidSupportLibraries.appCompact) - implementation(com.gtf.snap.CommonLibraries.androidxDatastore) - implementation(com.gtf.snap.JodaTimeLibraries.jodaTime) - implementation(com.gtf.snap.CommonLibraries.uuid) - implementation(com.gtf.snap.CommonLibraries.mixpanel) - testImplementation("junit:junit:4.13.2") - androidTestImplementation("androidx.test.ext:junit:1.1.3") - androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") - - //dagger - implementation(com.gtf.snap.DaggerLibraries.dagger) - kapt(com.gtf.snap.DaggerLibraries.daggerCompiler) - implementation(com.gtf.snap.DaggerLibraries.daggerAndroid) - kapt(com.gtf.snap.DaggerLibraries.daggerAndroidCompiler) - - testImplementation(com.gtf.snap.DaggerLibraries.dagger) - kaptTest(com.gtf.snap.DaggerLibraries.daggerCompiler) - testImplementation(com.gtf.snap.DaggerLibraries.daggerAndroid) - kaptTest(com.gtf.snap.DaggerLibraries.daggerAndroidCompiler) - - //rx android - implementation(com.gtf.snap.RxLibraries.rxAndroid2) - implementation(com.gtf.snap.RxLibraries.rxJava2) - implementation(com.gtf.snap.RxLibraries.rxBinding) - - //network rest-client -// implementation networkLibraries.curlLoggerInterceptor - implementation(com.gtf.snap.NetworkLibraries.retrofit) - implementation(com.gtf.snap.NetworkLibraries.retrofitGson) - implementation(com.gtf.snap.NetworkLibraries.retrofitRx) - implementation(com.gtf.snap.NetworkLibraries.okHttp) - implementation(com.gtf.snap.NetworkLibraries.okHttpLogging) - implementation(com.gtf.snap.NetworkLibraries.okHttpUrlConnection) - - debugImplementation(com.gtf.snap.NetworkLibraries.chuck) - releaseImplementation(com.gtf.snap.NetworkLibraries.chuckNoOp) - - - //testing-tools - testImplementation(com.gtf.snap.TestLibraries.junit) - testImplementation(com.gtf.snap.TestLibraries.mockito) - testImplementation(com.gtf.snap.TestLibraries.mockitoKotlin) - testImplementation(com.gtf.snap.TestLibraries.robolectric) - testImplementation(com.gtf.snap.TestLibraries.androidxJunit) - testImplementation(com.gtf.snap.TestLibraries.androidxArchTesting) - testImplementation(com.gtf.snap.TestLibraries.jodaTime) - testImplementation(com.gtf.snap.TestLibraries.powerMockModule) - testImplementation(com.gtf.snap.TestLibraries.powerMockApi) - testImplementation(com.gtf.snap.TestLibraries.powerMockCore) - testImplementation(com.gtf.snap.TestLibraries.powerMockModuleRule) - testImplementation(com.gtf.snap.TestLibraries.mockK) -} \ No newline at end of file diff --git a/corekit/consumer-rules.pro b/corekit/consumer-rules.pro deleted file mode 100644 index e69de29bb..000000000 diff --git a/corekit/proguard-rules.pro b/corekit/proguard-rules.pro deleted file mode 100644 index 4505667ed..000000000 --- a/corekit/proguard-rules.pro +++ /dev/null @@ -1,25 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile - --keep public class com.midtrans.sdk.corekit.api.** { *; } --keep public class com.midtrans.sdk.corekit.internal.model.** { *; } --keep public class com.midtrans.sdk.corekit.internal.network.model.** { *; } \ No newline at end of file diff --git a/corekit/src/androidTest/java/com/midtrans/sdk/corekit/ExampleInstrumentedTest.kt b/corekit/src/androidTest/java/com/midtrans/sdk/corekit/ExampleInstrumentedTest.kt deleted file mode 100644 index 8240fb8c9..000000000 --- a/corekit/src/androidTest/java/com/midtrans/sdk/corekit/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.midtrans.sdk.corekit - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.midtrans.sdk.corekit.test", appContext.packageName) - } -} \ No newline at end of file diff --git a/corekit/src/main/AndroidManifest.xml b/corekit/src/main/AndroidManifest.xml deleted file mode 100644 index 32c79bbe5..000000000 --- a/corekit/src/main/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/corekit/src/test/java/com/midtrans/sdk/corekit/SnapCoreTest.kt b/corekit/src/test/java/com/midtrans/sdk/corekit/SnapCoreTest.kt deleted file mode 100644 index e790f8014..000000000 --- a/corekit/src/test/java/com/midtrans/sdk/corekit/SnapCoreTest.kt +++ /dev/null @@ -1,106 +0,0 @@ -package com.midtrans.sdk.corekit - -import com.midtrans.sdk.corekit.api.model.PaymentType -import com.midtrans.sdk.corekit.internal.data.repository.SnapRepository -import com.midtrans.sdk.corekit.internal.network.restapi.SnapApi -import com.midtrans.sdk.corekit.internal.scheduler.TestSdkScheduler - -import io.mockk.mockk -import io.reactivex.Single -import org.junit.Test - -import org.junit.Assert.* - -import org.mockito.Mockito.`when` -import org.mockito.kotlin.* - - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ - - -class SnapCoreTest { - @Test - fun testAdd() { - assertEquals(4, 2 + 2) - } -/* fix after pr make it to test only 1 api with multiple payment type - @Test - fun snapRE() { - val snapApi = mock() - - `when`(snapApi.paymentUsingVa(any(), any())).thenReturn(Single.just(mockk())) - val snapRepository = SnapRepository(snapApi = snapApi) - val snapToken = "token" - val bankTransferPaymentRequest = mockk() - val scheduler = TestSdkScheduler().io() - snapRepository.chargeBankTransfer( - snapToken = snapToken, - request = bankTransferPaymentRequest - ) - .subscribeOn(scheduler) - .subscribe() - - scheduler.start() - verify(snapApi).paymentUsingVa(snapToken, bankTransferPaymentRequest) - } - - @Test - fun bankTransferUsecase() { - val snapRepository = mock() - val scheduler = TestSdkScheduler().io() - `when`(snapRepository.chargeBankTransfer(any(), any())).thenReturn(Single.just(mock())) - val bankTransferUsecase = BankTransferUsecase(snapRepository) - val snapToken = "token" - val email = "email" - bankTransferUsecase.charge( - snaptoken = snapToken, - email = email, - paymentType = PaymentType.BCA_VA - ).subscribeOn(scheduler) - .subscribe() - scheduler.start() - - var capturedBankTfPaymentRequest: BankTransferPaymentRequest? = null - verify(snapRepository).chargeBankTransfer(eq(snapToken), argThat { - capturedBankTfPaymentRequest = this - true - }) - assertEquals(PaymentType.BCA_VA, capturedBankTfPaymentRequest?.paymentType) - assertEquals(email, capturedBankTfPaymentRequest?.customerDetails?.email) - } - - @Test - fun directDebitUsecase() { - val snapRepository = mock() - val scheduler = TestSdkScheduler().io() - `when`(snapRepository.chargeDirectDebit(any(), any())).thenReturn(Single.just(mock())) - val directDebitUsecase = DirectDebitUsecase(snapRepository) - val snapToken = "token" - directDebitUsecase.charge( - snaptoken = snapToken, - paymentType = PaymentType.KLIK_BCA, - input3 = "input3", - token = "token", - tokenId = "tokenId", - userId = "userId" - ).subscribeOn(scheduler) - .subscribe() - scheduler.start() - - var capturedDirectDebitPaymentRequest: DirectDebitPaymentRequest? = null - verify(snapRepository).chargeDirectDebit(eq(snapToken), argThat { - capturedDirectDebitPaymentRequest = this - true - }) - assertEquals(PaymentType.KLIK_BCA, capturedDirectDebitPaymentRequest?.paymentType) - assertEquals("input3", capturedDirectDebitPaymentRequest?.paymentParams?.input3) - assertEquals("token", capturedDirectDebitPaymentRequest?.paymentParams?.token) - assertEquals("tokenId", capturedDirectDebitPaymentRequest?.paymentParams?.tokenId) - assertEquals("userId", capturedDirectDebitPaymentRequest?.paymentParams?.userId) - } -*/ -} \ No newline at end of file diff --git a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/ConvenienceStorePaymentRequestBuilderTest.kt b/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/ConvenienceStorePaymentRequestBuilderTest.kt deleted file mode 100644 index 36712bef5..000000000 --- a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/ConvenienceStorePaymentRequestBuilderTest.kt +++ /dev/null @@ -1,29 +0,0 @@ -package com.midtrans.sdk.corekit.api.requestbuilder - -import com.midtrans.sdk.corekit.api.exception.InvalidPaymentTypeException -import com.midtrans.sdk.corekit.api.model.PaymentType -import com.midtrans.sdk.corekit.api.requestbuilder.payment.ConvenienceStorePaymentRequestBuilder -import org.junit.Assert -import org.junit.Test - -internal class ConvenienceStorePaymentRequestBuilderTest { - - @Test - fun shouldConstructIndomaretPaymentRequest() { - val request = ConvenienceStorePaymentRequestBuilder().withPaymentType(PaymentType.INDOMARET).build() - Assert.assertEquals(PaymentType.INDOMARET, request.paymentType) - } - - @Test - fun shouldConstructAlfamartPaymentRequest() { - val request = ConvenienceStorePaymentRequestBuilder().withPaymentType(PaymentType.ALFAMART).build() - Assert.assertEquals(PaymentType.ALFAMART, request.paymentType) - } - - @Test - fun shouldThrowInvalidPaymentTypeExceptionWhenPaymentTypeIsNotSupported() { - Assert.assertThrows( - InvalidPaymentTypeException::class.java - ) { ConvenienceStorePaymentRequestBuilder().withPaymentType(PaymentType.KLIK_BCA).build() } - } -} \ No newline at end of file diff --git a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/CreditCardPaymentRequestBuilderTest.kt b/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/CreditCardPaymentRequestBuilderTest.kt deleted file mode 100644 index e28fc5045..000000000 --- a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/CreditCardPaymentRequestBuilderTest.kt +++ /dev/null @@ -1,70 +0,0 @@ -package com.midtrans.sdk.corekit.api.requestbuilder - -import com.midtrans.sdk.corekit.api.exception.InvalidPaymentTypeException -import com.midtrans.sdk.corekit.api.model.PaymentType -import com.midtrans.sdk.corekit.api.requestbuilder.payment.CreditCardPaymentRequestBuilder -import com.midtrans.sdk.corekit.internal.util.NumberUtil -import org.junit.Assert -import org.junit.Test - -internal class CreditCardPaymentRequestBuilderTest { - - private val cardToken = "cardToken" - private val installment = "offline_3" - private val discountedGrossAmount = 145000.0 - private val promoId = "promoId" - - @Test - fun shouldConstructCreditCardPaymentRequestBasic() { - val request = CreditCardPaymentRequestBuilder() - .withPaymentType(PaymentType.CREDIT_CARD) - .withCardToken(cardToken) - .build() - Assert.assertEquals(PaymentType.CREDIT_CARD, request.paymentType) - Assert.assertEquals(cardToken, request.paymentParams?.cardToken) - } - - @Test - fun shouldConstructCreditCardPaymentRequestWithInstallment() { - val request = CreditCardPaymentRequestBuilder() - .withPaymentType(PaymentType.CREDIT_CARD) - .withCardToken(cardToken) - .withInstallment(installment) - .build() - Assert.assertEquals(PaymentType.CREDIT_CARD, request.paymentType) - Assert.assertEquals(cardToken, request.paymentParams?.cardToken) - Assert.assertEquals(installment, request.paymentParams?.installment) - } - - @Test - fun shouldConstructCreditCardPaymentRequestWithPromo() { - val request = CreditCardPaymentRequestBuilder() - .withPaymentType(PaymentType.CREDIT_CARD) - .withCardToken(cardToken) - .withPromo(discountedGrossAmount = discountedGrossAmount, promoId = promoId) - .build() - Assert.assertEquals(PaymentType.CREDIT_CARD, request.paymentType) - Assert.assertEquals(cardToken, request.paymentParams?.cardToken) - Assert.assertEquals(discountedGrossAmount?.let { NumberUtil.formatDoubleToString(it) }, request.promoDetails?.discountedGrossAmount) - Assert.assertEquals(promoId, request.promoDetails?.promoId) - } - - @Test - fun shouldThrowUninitializedPropertyAccessExceptionWhenCardTokenIsNotInitialize() { - Assert.assertThrows( - UninitializedPropertyAccessException::class.java - ) { CreditCardPaymentRequestBuilder() - .withPaymentType(PaymentType.CREDIT_CARD) - .build() } - } - - @Test - fun shouldThrowInvalidPaymentTypeExceptionWhenPaymentTypeIsNotSupported() { - Assert.assertThrows( - InvalidPaymentTypeException::class.java - ) { CreditCardPaymentRequestBuilder() - .withPaymentType(PaymentType.KLIK_BCA) - .withCardToken(cardToken) - .build() } - } -} \ No newline at end of file diff --git a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/DirectDebitPaymentRequestBuilderTest.kt b/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/DirectDebitPaymentRequestBuilderTest.kt deleted file mode 100644 index 3d1d40caf..000000000 --- a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/DirectDebitPaymentRequestBuilderTest.kt +++ /dev/null @@ -1,63 +0,0 @@ -package com.midtrans.sdk.corekit.api.requestbuilder - -import com.midtrans.sdk.corekit.api.exception.InvalidPaymentTypeException -import com.midtrans.sdk.corekit.api.exception.MissingParameterException -import com.midtrans.sdk.corekit.api.model.PaymentType -import com.midtrans.sdk.corekit.api.requestbuilder.payment.DirectDebitPaymentRequestBuilder -import org.junit.Assert.assertEquals -import org.junit.Assert.assertThrows -import org.junit.Test - -class DirectDebitPaymentRequestBuilderTest { - - @Test - fun shouldConstructKlikBcaPaymentRequest() { - val request = DirectDebitPaymentRequestBuilder() - .withPaymentType(PaymentType.KLIK_BCA) - .withKlikBcaUserId("User ID") - .build() - assertEquals(PaymentType.KLIK_BCA, request.paymentType) - assertEquals("User ID", request.paymentParams?.userId) - } - - @Test - fun shouldThrowMissingParameterExceptionWhenUserIdKlikBcaIsNull() { - assertThrows(MissingParameterException::class.java) { - DirectDebitPaymentRequestBuilder() - .withPaymentType(PaymentType.KLIK_BCA) - .build() - } - } - - @Test - fun shouldConstructDirectDebitPaymentRequest() { - val klikPayRequest = DirectDebitPaymentRequestBuilder() - .withPaymentType(PaymentType.BCA_KLIKPAY) - .build() - assertEquals(PaymentType.BCA_KLIKPAY, klikPayRequest.paymentType) - - val cimbRequest = DirectDebitPaymentRequestBuilder() - .withPaymentType(PaymentType.CIMB_CLICKS) - .build() - assertEquals(PaymentType.CIMB_CLICKS, cimbRequest.paymentType) - - val danamonRequest = DirectDebitPaymentRequestBuilder() - .withPaymentType(PaymentType.DANAMON_ONLINE) - .build() - assertEquals(PaymentType.DANAMON_ONLINE, danamonRequest.paymentType) - - val briEpayRequest = DirectDebitPaymentRequestBuilder() - .withPaymentType(PaymentType.BRI_EPAY) - .build() - assertEquals(PaymentType.BRI_EPAY, briEpayRequest.paymentType) - } - - @Test - fun shouldThrowInvalidPaymentTypeExceptionWhenPaymentTypeIsNotSupported() { - assertThrows(InvalidPaymentTypeException::class.java) { - DirectDebitPaymentRequestBuilder() - .withPaymentType(PaymentType.AKULAKU) - .build() - } - } -} \ No newline at end of file diff --git a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/EWalletRequestBuilderTest.kt b/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/EWalletRequestBuilderTest.kt deleted file mode 100644 index 2d2981a65..000000000 --- a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/EWalletRequestBuilderTest.kt +++ /dev/null @@ -1,43 +0,0 @@ -package com.midtrans.sdk.corekit.api.requestbuilder - -import com.midtrans.sdk.corekit.api.exception.InvalidPaymentTypeException -import com.midtrans.sdk.corekit.api.model.PaymentType -import com.midtrans.sdk.corekit.api.requestbuilder.payment.EWalletPaymentRequestBuilder -import org.junit.Assert -import org.junit.Test - -internal class EWalletRequestBuilderTest { - - @Test - fun shouldConstructGopayRequest() { - val obj = EWalletPaymentRequestBuilder().withPaymentType(PaymentType.GOPAY).build() - Assert.assertEquals(PaymentType.GOPAY, obj.paymentType) - } - - @Test - fun shouldConstructShoopepayRequest() { - val obj = EWalletPaymentRequestBuilder().withPaymentType(PaymentType.SHOPEEPAY).build() - Assert.assertEquals(PaymentType.SHOPEEPAY, obj.paymentType) - } - - @Test - fun shouldConstructShoopepayQrisRequest() { - val obj = EWalletPaymentRequestBuilder().withPaymentType(PaymentType.SHOPEEPAY_QRIS).build() - Assert.assertEquals(PaymentType.QRIS, obj.paymentType) - Assert.assertEquals(PaymentType.SHOPEEPAY, obj.paymentParams!!.acquirer!![0]) - } - - @Test - fun shouldConstructGopayQrisRequest() { - val obj = EWalletPaymentRequestBuilder().withPaymentType(PaymentType.GOPAY_QRIS).build() - Assert.assertEquals(PaymentType.QRIS, obj.paymentType) - Assert.assertEquals(PaymentType.GOPAY, obj.paymentParams!!.acquirer!![0]) - } - - @Test - fun shouldErrorOnUnsupportedPaymentType() { - Assert.assertThrows( - InvalidPaymentTypeException::class.java - ) { EWalletPaymentRequestBuilder().withPaymentType(PaymentType.BNI_VA).build() } - } -} \ No newline at end of file diff --git a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/NormalCardTokenRequestBuilderTest.kt b/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/NormalCardTokenRequestBuilderTest.kt deleted file mode 100644 index 4a8dae15d..000000000 --- a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/NormalCardTokenRequestBuilderTest.kt +++ /dev/null @@ -1,72 +0,0 @@ -package com.midtrans.sdk.corekit.api.requestbuilder - -import com.midtrans.sdk.corekit.api.requestbuilder.cardtoken.CreditCardTokenRequestBuilder -import com.midtrans.sdk.corekit.api.requestbuilder.cardtoken.NormalCardTokenRequestBuilder -import com.midtrans.sdk.corekit.internal.network.model.request.InstallmentRequest -import com.midtrans.sdk.corekit.internal.util.NumberUtil -import org.junit.Assert -import org.junit.Test - -internal class NormalCardTokenRequestBuilderTest { - private val clientKey = "clientKey" - private val grossAmount = 150000.0 - private val cardNumber = "cardNumber" - private val expMonth = "12" - private val expYear = "24" - private val cvv = "123" - private val orderId = "orderId" - private val currency = "IDR" - private val installment = InstallmentRequest(installment = true, bank = "offline", installmentTerm = 3) - - @Test - fun shouldConstructCardTokenRequestBasic() { - val request = NormalCardTokenRequestBuilder() - .withGrossAmount(grossAmount) - .withCardNumber(cardNumber) - .withCardExpMonth(expMonth) - .withCardExpYear(expYear) - .withCardCvv(cvv) - .withOrderId(orderId) - .withCurrency(currency) - .withClientKey(clientKey) - .build() - - Assert.assertEquals(clientKey, request.getValue(CreditCardTokenRequestBuilder.CLIENT_KEY)) - Assert.assertEquals(NumberUtil.formatDoubleToString(grossAmount), request.getValue(CreditCardTokenRequestBuilder.GROSS_AMOUNT)) - Assert.assertEquals(cardNumber, request.getValue(CreditCardTokenRequestBuilder.CARD_NUMBER)) - Assert.assertEquals(expMonth, request.getValue(CreditCardTokenRequestBuilder.CARD_EXPIRY_MONTH)) - Assert.assertEquals(expYear, request.getValue(CreditCardTokenRequestBuilder.CARD_EXPIRY_YEAR)) - Assert.assertEquals(cvv, request.getValue(CreditCardTokenRequestBuilder.CARD_CVV)) - Assert.assertEquals(orderId, request.getValue(CreditCardTokenRequestBuilder.ORDER_ID)) - Assert.assertEquals(currency, request.getValue(CreditCardTokenRequestBuilder.CURRENCY)) - } - - @Test - fun shouldConstructCardTokenRequestWithInstallment() { - val request = NormalCardTokenRequestBuilder() - .withGrossAmount(grossAmount) - .withCardNumber(cardNumber) - .withCardExpMonth(expMonth) - .withCardExpYear(expYear) - .withCardCvv(cvv) - .withOrderId(orderId) - .withCurrency(currency) - .withInstallment( - value = installment.installment, - installmentTerm = installment.installmentTerm, - bank = installment.bank - ) - .withClientKey(clientKey) - .build() - - Assert.assertEquals(clientKey, request.getValue(CreditCardTokenRequestBuilder.CLIENT_KEY)) - Assert.assertEquals(NumberUtil.formatDoubleToString(grossAmount), request.getValue(CreditCardTokenRequestBuilder.GROSS_AMOUNT)) - Assert.assertEquals(cardNumber, request.getValue(CreditCardTokenRequestBuilder.CARD_NUMBER)) - Assert.assertEquals(expMonth, request.getValue(CreditCardTokenRequestBuilder.CARD_EXPIRY_MONTH)) - Assert.assertEquals(expYear, request.getValue(CreditCardTokenRequestBuilder.CARD_EXPIRY_YEAR)) - Assert.assertEquals(cvv, request.getValue(CreditCardTokenRequestBuilder.CARD_CVV)) - Assert.assertEquals(orderId, request.getValue(CreditCardTokenRequestBuilder.ORDER_ID)) - Assert.assertEquals(currency, request.getValue(CreditCardTokenRequestBuilder.CURRENCY)) - Assert.assertEquals(installment.installmentTerm.toString(), request.getValue(CreditCardTokenRequestBuilder.INSTALLMENT_TERM)) - } -} \ No newline at end of file diff --git a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/OneClickCardPaymentRequestBuilderTest.kt b/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/OneClickCardPaymentRequestBuilderTest.kt deleted file mode 100644 index 931e18527..000000000 --- a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/OneClickCardPaymentRequestBuilderTest.kt +++ /dev/null @@ -1,70 +0,0 @@ -package com.midtrans.sdk.corekit.api.requestbuilder - -import com.midtrans.sdk.corekit.api.exception.InvalidPaymentTypeException -import com.midtrans.sdk.corekit.api.model.PaymentType -import com.midtrans.sdk.corekit.api.requestbuilder.payment.OneClickCardPaymentRequestBuilder -import com.midtrans.sdk.corekit.internal.network.model.request.PromoDetailRequest -import com.midtrans.sdk.corekit.internal.util.NumberUtil -import org.junit.Assert -import org.junit.Test - -internal class OneClickCardPaymentRequestBuilderTest{ - private val maskedCard = "maskedCard" - private val installment = "offline_3" - private val discountedGrossAmount = 145000.0 - private val promoId = "promoId" - - @Test - fun shouldConstructCreditCardPaymentRequestBasic() { - val request = OneClickCardPaymentRequestBuilder() - .withPaymentType(PaymentType.CREDIT_CARD) - .withMaskedCard(maskedCard) - .build() - Assert.assertEquals(PaymentType.CREDIT_CARD, request.paymentType) - Assert.assertEquals(maskedCard, request.paymentParams?.maskedCard) - } - - @Test - fun shouldConstructCreditCardPaymentRequestWithInstallment() { - val request = OneClickCardPaymentRequestBuilder() - .withPaymentType(PaymentType.CREDIT_CARD) - .withMaskedCard(maskedCard) - .withInstallment(installment) - .build() - Assert.assertEquals(PaymentType.CREDIT_CARD, request.paymentType) - Assert.assertEquals(maskedCard, request.paymentParams?.maskedCard) - Assert.assertEquals(installment, request.paymentParams?.installment) - } - - @Test - fun shouldConstructCreditCardPaymentRequestWithPromo() { - val request = OneClickCardPaymentRequestBuilder() - .withPaymentType(PaymentType.CREDIT_CARD) - .withMaskedCard(maskedCard) - .withPromo(discountedGrossAmount = discountedGrossAmount, promoId = promoId) - .build() - Assert.assertEquals(PaymentType.CREDIT_CARD, request.paymentType) - Assert.assertEquals(maskedCard, request.paymentParams?.maskedCard) - Assert.assertEquals(discountedGrossAmount?.let { NumberUtil.formatDoubleToString(it) }, request.promoDetails?.discountedGrossAmount) - Assert.assertEquals(promoId, request.promoDetails?.promoId) - } - - @Test - fun shouldThrowUninitializedPropertyAccessExceptionWhenCardTokenIsNotInitialize() { - Assert.assertThrows( - UninitializedPropertyAccessException::class.java - ) { OneClickCardPaymentRequestBuilder() - .withPaymentType(PaymentType.CREDIT_CARD) - .build() } - } - - @Test - fun shouldThrowInvalidPaymentTypeExceptionWhenPaymentTypeIsNotSupported() { - Assert.assertThrows( - InvalidPaymentTypeException::class.java - ) { OneClickCardPaymentRequestBuilder() - .withPaymentType(PaymentType.KLIK_BCA) - .withMaskedCard(maskedCard) - .build() } - } -} \ No newline at end of file diff --git a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/PayLaterPaymentRequestBuilderTest.kt b/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/PayLaterPaymentRequestBuilderTest.kt deleted file mode 100644 index bc728543b..000000000 --- a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/PayLaterPaymentRequestBuilderTest.kt +++ /dev/null @@ -1,23 +0,0 @@ -package com.midtrans.sdk.corekit.api.requestbuilder - -import com.midtrans.sdk.corekit.api.exception.InvalidPaymentTypeException -import com.midtrans.sdk.corekit.api.model.PaymentType -import com.midtrans.sdk.corekit.api.requestbuilder.payment.PayLaterPaymentRequestBuilder -import org.junit.Assert -import org.junit.Test - -internal class PayLaterPaymentRequestBuilderTest { - - @Test - fun shouldConstructAkulakuPaymentRequest() { - val request = PayLaterPaymentRequestBuilder().withPaymentType(PaymentType.AKULAKU).build() - Assert.assertEquals(PaymentType.AKULAKU, request.paymentType) - } - - @Test - fun shouldThrowInvalidPaymentTypeExceptionWhenPaymentTypeIsNotSupported() { - Assert.assertThrows( - InvalidPaymentTypeException::class.java - ) { PayLaterPaymentRequestBuilder().withPaymentType(PaymentType.KLIK_BCA).build() } - } -} \ No newline at end of file diff --git a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/TwoClicksCardTokenRequestBuilderTest.kt b/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/TwoClicksCardTokenRequestBuilderTest.kt deleted file mode 100644 index 66535459a..000000000 --- a/corekit/src/test/java/com/midtrans/sdk/corekit/api/requestbuilder/TwoClicksCardTokenRequestBuilderTest.kt +++ /dev/null @@ -1,75 +0,0 @@ -package com.midtrans.sdk.corekit.api.requestbuilder - -import com.midtrans.sdk.corekit.api.requestbuilder.cardtoken.CreditCardTokenRequestBuilder -import com.midtrans.sdk.corekit.api.requestbuilder.cardtoken.TwoClickCardTokenRequestBuilder -import com.midtrans.sdk.corekit.internal.network.model.request.InstallmentRequest -import com.midtrans.sdk.corekit.internal.util.NumberUtil -import org.junit.Assert -import org.junit.Test - -class TwoClicksCardTokenRequestBuilderTest { - private val tokenId = "tokenId" - private val clientKey = "clientKey" - private val grossAmount = 150000.0 - private val cvv = "123" - private val orderId = "orderId" - private val currency = "IDR" - private val installment = - InstallmentRequest(installment = true, bank = "offline", installmentTerm = 3) - - @Test - fun shouldConstructCardTokenRequestBasic() { - val request = TwoClickCardTokenRequestBuilder() - .withTokenId(tokenId) - .withGrossAmount(grossAmount) - .withCardCvv(cvv) - .withOrderId(orderId) - .withCurrency(currency) - .withClientKey(clientKey) - .build() - - Assert.assertEquals(tokenId, request.getValue(CreditCardTokenRequestBuilder.TOKEN_ID)) - Assert.assertEquals(clientKey, request.getValue(CreditCardTokenRequestBuilder.CLIENT_KEY)) - Assert.assertEquals( - NumberUtil.formatDoubleToString(grossAmount), request.getValue( - CreditCardTokenRequestBuilder.GROSS_AMOUNT - ) - ) - Assert.assertEquals(cvv, request.getValue(CreditCardTokenRequestBuilder.CARD_CVV)) - Assert.assertEquals(orderId, request.getValue(CreditCardTokenRequestBuilder.ORDER_ID)) - Assert.assertEquals(currency, request.getValue(CreditCardTokenRequestBuilder.CURRENCY)) - } - - @Test - fun shouldConstructCardTokenRequestWithInstallment() { - val request = TwoClickCardTokenRequestBuilder() - .withTokenId(tokenId) - .withGrossAmount(grossAmount) - .withCardCvv(cvv) - .withOrderId(orderId) - .withCurrency(currency) - .withInstallment( - value = installment.installment, - installmentTerm = installment.installmentTerm, - bank = installment.bank - ) - .withClientKey(clientKey) - .build() - - Assert.assertEquals(tokenId, request.getValue(CreditCardTokenRequestBuilder.TOKEN_ID)) - Assert.assertEquals(clientKey, request.getValue(CreditCardTokenRequestBuilder.CLIENT_KEY)) - Assert.assertEquals( - NumberUtil.formatDoubleToString(grossAmount), request.getValue( - CreditCardTokenRequestBuilder.GROSS_AMOUNT - ) - ) - Assert.assertEquals(cvv, request.getValue(CreditCardTokenRequestBuilder.CARD_CVV)) - Assert.assertEquals(orderId, request.getValue(CreditCardTokenRequestBuilder.ORDER_ID)) - Assert.assertEquals(currency, request.getValue(CreditCardTokenRequestBuilder.CURRENCY)) - Assert.assertEquals( - installment.installmentTerm.toString(), request.getValue( - CreditCardTokenRequestBuilder.INSTALLMENT_TERM - ) - ) - } -} \ No newline at end of file diff --git a/corekit/src/test/java/com/midtrans/sdk/corekit/internal/analytics/EventAnalyticsTest.kt b/corekit/src/test/java/com/midtrans/sdk/corekit/internal/analytics/EventAnalyticsTest.kt deleted file mode 100644 index e4b1f99bd..000000000 --- a/corekit/src/test/java/com/midtrans/sdk/corekit/internal/analytics/EventAnalyticsTest.kt +++ /dev/null @@ -1,518 +0,0 @@ -package com.midtrans.sdk.corekit.internal.analytics - -import com.midtrans.sdk.corekit.BuildConfig -import com.midtrans.sdk.corekit.api.model.PaymentType -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_3DS_RESULT -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_ACCOUNT_NUMBER_COPIED -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_CHARGE_REQUEST -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_CHARGE_RESULTS -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_CTA_CLICKED -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_ERROR -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_CUSTOMER_DATA_INPUT -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_EXBIN_RESPONSE -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_GET_TOKEN_REQUEST -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_GET_TOKEN_RESULT -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_HOW_TO_PAY_VIEWED -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_NOTICE -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_OPEN_DEEPLINK -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_ORDER_DETAILS_VIEWED -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_PAGE_CLOSED -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_PAYMENT_NUMBER_BUTTON_RETRIED -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_PAGE_VIEWED -import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_TOKENIZATION_RESULT -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_3DS_VERSION -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CARD_BANK -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CTA_NAME -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CARD_BANK_CODE -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CARD_BIN -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CARD_BIN_CLASSS -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CARD_BIN_TYPE -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CARD_BRAND -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CARD_CHANNEL -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CARD_COUNTRY_CODE -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CARD_TYPE -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CHANNEL_RESPONSE_CODE -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CURRENCY -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CUSTOMER_CITY -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CUSTOMER_EMAIL -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CUSTOMER_NAME -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CUSTOMER_PHONE_NUMBER -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_CUSTOMER_POST_CODE -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_DISPLAY_FIELD -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_ECI -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_ERROR_MESSAGE -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_FRAUD_STATUS -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_MERCHANT_URL -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_NET_AMOUNT -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_NOTICE_MESSAGE -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_PAGE_NAME -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_PAYMENT_METHOD_NAME -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_PLATFORM -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_REGISTRATION_REQUIRED -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_RESPONSE_TIME -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_SDK_TYPE -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_SDK_VERSION -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_SERVICE_TYPE -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_SNAP_TOKEN -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_SNAP_TYPE -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_SOURCE_TYPE -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_STATUS_CODE -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_STATUS_TEXT -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_STEP_NUMBER -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_TOKEN_ID -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_TOTAL_ITEMS -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_TOTAL_QUANTITY -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_TRANSACTION_ID -import com.midtrans.sdk.corekit.internal.analytics.EventName.PROPERTY_TRANSACTION_STATUS -import org.junit.After -import org.junit.Before -import org.junit.Test -import org.mockito.Mock -import org.mockito.MockitoAnnotations -import org.mockito.kotlin.verify - -internal class EventAnalyticsTest { - private lateinit var closeable: AutoCloseable - private lateinit var eventAnalytics: EventAnalytics - - @Mock - private lateinit var mixpanelTracker: MixpanelTracker - - @Before - fun setUp() { - closeable = MockitoAnnotations.openMocks(this) - eventAnalytics = EventAnalytics(mixpanelTracker) - } - - @After - fun tearDown() { - closeable.close() - } - - @Test - fun verifySetUserIdentity() { - eventAnalytics.setUserIdentity("user_id", "user_name", mapOf()) - verify(mixpanelTracker).setUserIdentity("user_id", "user_name", mapOf()) - } - - @Test - fun verifyRegisterCommonProperties() { - eventAnalytics.registerCommonProperties("tablet", "merchant-url") - verify(mixpanelTracker).registerCommonProperties( - mapOf( - PROPERTY_SDK_VERSION to BuildConfig.SDK_VERSION, - PROPERTY_SDK_TYPE to "UI", - PROPERTY_SOURCE_TYPE to "mobile-android", - PROPERTY_SERVICE_TYPE to "snap", - PROPERTY_SNAP_TYPE to "Sdk", - PROPERTY_PLATFORM to "tablet", - PROPERTY_MERCHANT_URL to "merchant-url" - ) - ) - } - - @Test - fun verifyRegisterCommonTransactionProperties() { - eventAnalytics.registerCommonTransactionProperties( - snapToken = "snap-token", - orderId = "order-id", - grossAmount = "gross-amount", - merchantId = "merchant-id", - merchantName = "merchant-name", - colourSchema = "colour-schema", - enabledPayments = "enabled-payments", - enabledPaymentsLength = "5", - snapRedirectUrl = "redirect-url", - allowRetry = "allow-retry", - otherVaProcessor = "other-va" - ) - verify(mixpanelTracker).registerCommonProperties( - mapOf( - PROPERTY_SNAP_TOKEN to "snap-token", - EventName.PROPERTY_ORDER_ID to "order-id", - EventName.PROPERTY_GROSS_AMOUNT to "gross-amount", - EventName.PROPERTY_MERCHANT_ID to "merchant-id", - EventName.PROPERTY_MERCHANT_NAME to "merchant-name", - EventName.PROPERTY_COLOUR_SCHEME to "colour-schema", - EventName.PROPERTY_PAYMENTS_ENABLED to "enabled-payments", - EventName.PROPERTY_PAYMENTS_ENABLED_LENGTH to "5", - EventName.PROPERTY_SNAP_REDIRECT_URL to "redirect-url", - EventName.PROPERTY_ALLOW_RETRY to "allow-retry", - EventName.PROPERTY_OTHER_VA_PROCESSOR to "other-va" - ) - ) - } - - @Test - fun verifyRegisterCommonCustomerProperties() { - eventAnalytics.registerCommonCustomerProperties( - customerName = "name", - customerEmail = "email", - customerPhoneNumber = "phone", - customerCity = "city", - customerPostCode = "post-code", - totalItems = "total-items", - totalQuantity = "total-quantity" - ) - verify(mixpanelTracker).registerCommonProperties( - mapOf( - PROPERTY_CUSTOMER_NAME to "name", - PROPERTY_CUSTOMER_EMAIL to "email", - PROPERTY_CUSTOMER_PHONE_NUMBER to "phone", - PROPERTY_CUSTOMER_CITY to "city", - PROPERTY_CUSTOMER_POST_CODE to "post-code", - PROPERTY_TOTAL_ITEMS to "total-items", - PROPERTY_TOTAL_QUANTITY to "total-quantity" - ) - ) - } - - @Test - fun verifyRegisterCommonCreditCardProperties() { - eventAnalytics.registerCommonCreditCardProperties( - cardOneClickTokenAvailable = "available", - cardTwoClickTokenAvailable = "available", - priorityCardFeature = "priority", - savedTokens = "tokens", - promoEnabled = "promo-enabled", - secure = "secure-enabled", - saveCard = "save-card-enabled", - blacklistedBins = "blacklist", - allowlistedBins = "allowlist", - installmentTerms = "terms", - installmentBank = "bank", - installmentRequired = "required" - ) - - verify(mixpanelTracker).registerCommonProperties( - mapOf( - EventName.PROPERTY_ONE_CLICK_TOKEN_AVAILABLE to "available", - EventName.PROPERTY_TWO_CLICK_TOKEN_AVAILABLE to "available", - EventName.PROPERTY_PRIORITY_CARD_FEATURE to "priority", - EventName.PROPERTY_SAVED_TOKENS to "tokens", - EventName.PROPERTY_PROMO_ENABLED to "promo-enabled", - EventName.PROPERTY_SECURE_ENABLED to "secure-enabled", - EventName.PROPERTY_SAVE_CARD_ENABLED to "save-card-enabled", - EventName.PROPERTY_BLACKLISTED_BINS to "blacklist", - EventName.PROPERTY_ALLOWLISTED_BINS to "allowlist", - EventName.PROPERTY_INSTALLMENT_TERMS to "terms", - EventName.PROPERTY_INSTALLMENT_BANK to "bank", - EventName.PROPERTY_INSTALLMENT_REQUIRED to "required", - ) - ) - } - - @Test - fun verifyTrackSnapGetTokenRequest() { - eventAnalytics.trackSnapGetTokenRequest("token") - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_GET_TOKEN_REQUEST, - properties = mapOf(PROPERTY_SNAP_TOKEN to "token") - ) - } - - @Test - fun verifyTrackSnapGetTokenResult() { - eventAnalytics.trackSnapGetTokenResult("token", "1000") - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_GET_TOKEN_RESULT, - properties = mapOf( - PROPERTY_SNAP_TOKEN to "token", - PROPERTY_RESPONSE_TIME to "1000" - ) - ) - } - - @Test - fun verifyTrackSnapAccountNumberCopied() { - eventAnalytics.trackSnapAccountNumberCopied(PageName.BRI_VA_PAGE, PaymentType.BRI_VA) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_ACCOUNT_NUMBER_COPIED, - properties = mapOf( - PROPERTY_PAGE_NAME to PageName.BRI_VA_PAGE, - PROPERTY_PAYMENT_METHOD_NAME to PaymentType.BRI_VA - ) - ) - } - - @Test - fun verifyTrackSnapPaymentNumberButtonRetried() { - eventAnalytics.trackSnapPaymentNumberButtonRetried(PageName.GOPAY_QR_PAGE, PaymentType.GOPAY) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_PAYMENT_NUMBER_BUTTON_RETRIED, - properties = mapOf( - PROPERTY_PAGE_NAME to PageName.GOPAY_QR_PAGE, - PROPERTY_PAYMENT_METHOD_NAME to PaymentType.GOPAY - ) - ) - } - - @Test - fun verifyTrackSnapChargeRequest() { - eventAnalytics.trackSnapChargeRequest("page-name", "credit-card") - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_CHARGE_REQUEST, - properties = mapOf( - PROPERTY_PAGE_NAME to "page-name", - PROPERTY_PAYMENT_METHOD_NAME to "credit-card" - ) - ) - } - - @Test - fun verifyTrackSnapChargeResult() { - eventAnalytics.trackSnapChargeResult( - transactionStatus = "transaction-status", - fraudStatus = "fraud-status", - currency = "currency", - statusCode = "status-code", - transactionId = "transaction-id", - pageName = PageName.CREDIT_DEBIT_CARD_PAGE, - paymentMethodName = "payment-type", - responseTime = "response-time" - ) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_CHARGE_RESULTS, - properties = mapOf( - PROPERTY_TRANSACTION_STATUS to "transaction-status", - PROPERTY_FRAUD_STATUS to "fraud-status", - PROPERTY_CURRENCY to "currency", - PROPERTY_STATUS_CODE to "status-code", - PROPERTY_TRANSACTION_ID to "transaction-id", - PROPERTY_PAGE_NAME to PageName.CREDIT_DEBIT_CARD_PAGE, - PROPERTY_PAYMENT_METHOD_NAME to "payment-type", - PROPERTY_RESPONSE_TIME to "response-time" - ) - ) - } - - @Test - fun verifyTrackCtaClicked() { - eventAnalytics.trackSnapCtaClicked( - ctaName = "cta-name", - pageName = "page-name", - paymentMethodName = "payment-type" - ) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_CTA_CLICKED, - properties = mapOf( - PROPERTY_CTA_NAME to "cta-name", - PROPERTY_PAGE_NAME to "page-name", - PROPERTY_PAYMENT_METHOD_NAME to "payment-type" - ) - ) - } - - @Test - fun verifyTrackHowToPayViewed() { - eventAnalytics.trackSnapHowToPayViewed( - pageName = "page-name", - paymentMethodName = "payment-type" - ) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_HOW_TO_PAY_VIEWED, - properties = mapOf( - PROPERTY_PAGE_NAME to "page-name", - PROPERTY_PAYMENT_METHOD_NAME to "payment-type" - ) - ) - } - - @Test - fun verifyTrackSnapExbinResponse() { - eventAnalytics.trackSnapExbinResponse( - pageName = "page-name", - paymentMethodName = "payment-type", - registrationRequired = "false", - countryCode = "country-code", - channel = "channel", - brand = "brand", - binType = "bin-type", - binClass = "bin-class", - bin = "bin", - bankCode = "bank-code" - ) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_EXBIN_RESPONSE, - properties = mapOf( - PROPERTY_PAGE_NAME to "page-name", - PROPERTY_PAYMENT_METHOD_NAME to "payment-type", - PROPERTY_REGISTRATION_REQUIRED to "false", - PROPERTY_CARD_COUNTRY_CODE to "country-code", - PROPERTY_CARD_CHANNEL to "channel", - PROPERTY_CARD_BRAND to "brand", - PROPERTY_CARD_BIN_TYPE to "bin-type", - PROPERTY_CARD_BIN_CLASSS to "bin-class", - PROPERTY_CARD_BIN to "bin", - PROPERTY_CARD_BANK_CODE to "bank-code" - ) - ) - } - - @Test - fun verifyTrackSnapPageClosed() { - eventAnalytics.trackSnapPageClosed( - pageName = "page-name" - ) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_PAGE_CLOSED, - properties = mapOf(PROPERTY_PAGE_NAME to "page-name") - ) - } - - @Test - fun verifyTrackSnapOpenDeeplink() { - eventAnalytics.trackSnapOpenDeeplink( - pageName = "page-name", - paymentMethodName = "payment-type" - ) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_OPEN_DEEPLINK, - properties = mapOf( - PROPERTY_PAGE_NAME to "page-name", - PROPERTY_PAYMENT_METHOD_NAME to "payment-type" - ) - ) - } - - @Test - fun verifyTrack3DsResult() { - eventAnalytics.trackSnap3DsResult( - transactionStatus = "transaction-status", - cardType = "card-type", - bank = "bank", - threeDsVersion = "3ds-version", - channelResponseCode = "response-code", - eci = "eci", - paymentMethodName = "payment-type" - ) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_3DS_RESULT, - properties = mapOf( - PROPERTY_TRANSACTION_STATUS to "transaction-status", - PROPERTY_CARD_TYPE to "card-type", - PROPERTY_CARD_BANK to "bank", - PROPERTY_3DS_VERSION to "3ds-version", - PROPERTY_CHANNEL_RESPONSE_CODE to "response-code", - PROPERTY_ECI to "eci", - PROPERTY_PAYMENT_METHOD_NAME to "payment-type" - ) - ) - } - - @Test - fun verifyTrackSnapOrderDetailsViewed() { - eventAnalytics.trackSnapOrderDetailsViewed( - pageName = "page-name", - paymentMethodName = "payment-type", - transactionId = "transaction-id", - netAmount = "net-amount" - ) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_ORDER_DETAILS_VIEWED, - properties = mapOf( - PROPERTY_PAGE_NAME to "page-name", - PROPERTY_PAYMENT_METHOD_NAME to "payment-type", - PROPERTY_TRANSACTION_ID to "transaction-id", - PROPERTY_NET_AMOUNT to "net-amount" - ) - ) - } - - @Test - fun verifyTrackSnapPageViewed() { - eventAnalytics.trackSnapPageViewed( - pageName = "page-name", - paymentMethodName = "payment-type", - transactionId = "transaction-id", - stepNumber = "1" - ) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_PAGE_VIEWED, - properties = mapOf( - PROPERTY_PAGE_NAME to "page-name", - PROPERTY_PAYMENT_METHOD_NAME to "payment-type", - PROPERTY_TRANSACTION_ID to "transaction-id", - PROPERTY_STEP_NUMBER to "1" - ) - ) - } - - @Test - fun verifyTrackSnapTokenizationResult() { - eventAnalytics.trackSnapTokenizationResult( - pageName = "page-name", - paymentMethodName = "payment-type", - statusCode = "status-code", - tokenId = "token-id" - ) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_TOKENIZATION_RESULT, - properties = mapOf( - PROPERTY_PAGE_NAME to "page-name", - PROPERTY_PAYMENT_METHOD_NAME to "payment-type", - PROPERTY_STATUS_CODE to "status-code", - PROPERTY_TOKEN_ID to "token-id" - ) - ) - } - - @Test - fun verifyTrackSnapCustomerDataInput() { - eventAnalytics.trackSnapCustomerDataInput( - pageName = "page-name", - paymentMethodName = "payment-type", - email = "email", - phoneNumber = "phone", - displayField = "true" - ) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_CUSTOMER_DATA_INPUT, - properties = mapOf( - PROPERTY_PAGE_NAME to "page-name", - PROPERTY_PAYMENT_METHOD_NAME to "payment-type", - PROPERTY_CUSTOMER_EMAIL to "email", - PROPERTY_CUSTOMER_PHONE_NUMBER to "phone", - PROPERTY_DISPLAY_FIELD to "true" - ) - ) - } - - @Test - fun verifyTrackSnapError() { - eventAnalytics.trackSnapError( - pageName = "page-name", - paymentMethodName = "payment-type", - statusCode = "status-code", - errorMessage = "error-message" - ) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_ERROR, - properties = mapOf( - PROPERTY_PAGE_NAME to "page-name", - PROPERTY_PAYMENT_METHOD_NAME to "payment-type", - PROPERTY_STATUS_CODE to "status-code", - PROPERTY_ERROR_MESSAGE to "error-message" - ) - ) - } - - @Test - fun verifyTrackSnapNotice() { - eventAnalytics.trackSnapNotice( - pageName = "page-name", - paymentMethodName = "payment-type", - statusText = "status-text", - noticeMessage = "notice-message" - ) - verify(mixpanelTracker).trackEvent( - eventName = EVENT_SNAP_NOTICE, - properties = mapOf( - PROPERTY_PAGE_NAME to "page-name", - PROPERTY_PAYMENT_METHOD_NAME to "payment-type", - PROPERTY_STATUS_TEXT to "status-text", - PROPERTY_NOTICE_MESSAGE to "notice-message" - ) - ) - } -} \ No newline at end of file diff --git a/corekit/src/test/java/com/midtrans/sdk/corekit/internal/usecase/PaymentUsecaseTest.kt b/corekit/src/test/java/com/midtrans/sdk/corekit/internal/usecase/PaymentUsecaseTest.kt deleted file mode 100644 index d45f2f21f..000000000 --- a/corekit/src/test/java/com/midtrans/sdk/corekit/internal/usecase/PaymentUsecaseTest.kt +++ /dev/null @@ -1,347 +0,0 @@ -package com.midtrans.sdk.corekit.internal.usecase - -import com.midtrans.sdk.corekit.api.callback.Callback -import com.midtrans.sdk.corekit.api.exception.SnapError -import com.midtrans.sdk.corekit.api.model.* -import com.midtrans.sdk.corekit.api.model.PaymentType.Companion.ALFAMART -import com.midtrans.sdk.corekit.api.model.PaymentType.Companion.BANK_TRANSFER -import com.midtrans.sdk.corekit.api.model.PaymentType.Companion.SHOPEEPAY_QRIS -import com.midtrans.sdk.corekit.api.model.PaymentType.Companion.UOB_EZPAY -import com.midtrans.sdk.corekit.api.requestbuilder.snaptoken.SnapTokenRequestBuilder -import com.midtrans.sdk.corekit.internal.analytics.EventAnalytics -import com.midtrans.sdk.corekit.internal.data.repository.CoreApiRepository -import com.midtrans.sdk.corekit.internal.data.repository.MerchantApiRepository -import com.midtrans.sdk.corekit.internal.data.repository.SnapRepository -import com.midtrans.sdk.corekit.internal.network.model.request.SnapTokenRequest -import com.midtrans.sdk.corekit.internal.network.model.response.* -import com.midtrans.sdk.corekit.internal.scheduler.BaseSdkScheduler -import com.midtrans.sdk.corekit.internal.scheduler.TestSdkScheduler -import io.reactivex.Single -import org.hamcrest.CoreMatchers.hasItems -import org.hamcrest.MatcherAssert.assertThat -import org.junit.After -import org.junit.Assert.assertEquals -import org.junit.Assert.assertTrue -import org.junit.Before -import org.junit.Test -import org.mockito.Mock -import org.mockito.MockitoAnnotations -import org.mockito.kotlin.* - -class PaymentUsecaseTest { - private lateinit var closeable: AutoCloseable - private lateinit var scheduler: BaseSdkScheduler - private lateinit var usecase: PaymentUsecase - - @Mock - private lateinit var mockSnapRepository: SnapRepository - - @Mock - private lateinit var mockCoreApiRepository: CoreApiRepository - - @Mock - private lateinit var mockMerchantApiRepository: MerchantApiRepository - - @Mock - private lateinit var eventAnalytics: EventAnalytics - - @Before - fun setUp() { - closeable = MockitoAnnotations.openMocks(this) - scheduler = TestSdkScheduler() - usecase = PaymentUsecase( - scheduler, mockSnapRepository, mockCoreApiRepository, mockMerchantApiRepository, "clientKey", eventAnalytics - ) - } - - @After - fun tearDown() { - closeable.close() - } - - @Test - fun getPaymentOptionWhenSnapTokenProvidedShouldNotGenerateNewSnapToken() { - val paymentOptionCaptor = argumentCaptor() - val mockCallback: Callback = mock() - val snapTransactionDetail = SnapTransactionDetail( - orderId = "order-id", - grossAmount = 1234.00, - currency = "currency" - ) - val customerDetails = CustomerDetails( - firstName = "first", - lastName = "last", - email = "email" - ) - whenever(mockSnapRepository.getTransactionDetail("snap-token")) doReturn Single.just( - Transaction( - enabledPayments = provideEnabledPayments(), - merchant = Merchant( - merchantId = "merchant-id", - preference = MerchantPreferences( - displayName = "merchant-name" - ) - ) - ) - ) - usecase.getPaymentOption( - "snap-token", - SnapTokenRequestBuilder() - .withTransactionDetails(value = snapTransactionDetail) - .withCustomerDetails(value = customerDetails), - mockCallback - ) - verify(mockSnapRepository).getTransactionDetail("snap-token") - verify(mockMerchantApiRepository, never()).getSnapToken(any()) - verify(eventAnalytics).setUserIdentity("email", "first last", mapOf()) - verify(mockCallback).onSuccess(paymentOptionCaptor.capture()) - val result = paymentOptionCaptor.firstValue - assertPaymentOption(result, "snap-token") - } - - @Test - fun getPaymentOptionWhenSnapTokenNotProvidedShouldGenerateNewSnapToken() { - val paymentOptionCaptor = argumentCaptor() - val mockCallback: Callback = mock() - val snapTransactionDetail = SnapTransactionDetail( - orderId = "order-id", - grossAmount = 1234.00, - currency = "currency" - ) - val customerDetails = CustomerDetails( - firstName = "first", - lastName = "last", - email = "email" - ) - whenever(mockMerchantApiRepository.getSnapToken(any())) doReturn Single.just( - SnapTokenResponse( - token = "snap-token-generated", - redirectUrl = "redirect-url-generated" - ) - ) - whenever(mockSnapRepository.getTransactionDetail("snap-token-generated")) doReturn Single.just( - Transaction( - enabledPayments = provideEnabledPayments(), - merchant = Merchant( - merchantId = "merchant-id", - preference = MerchantPreferences( - displayName = "merchant-name" - ) - ) - ) - ) - usecase.getPaymentOption( - null, - SnapTokenRequestBuilder() - .withTransactionDetails(value = snapTransactionDetail) - .withCustomerDetails(value = customerDetails), - mockCallback - ) - verify(mockSnapRepository).getTransactionDetail("snap-token-generated") - verify(mockMerchantApiRepository).getSnapToken( - eq( - SnapTokenRequest( - transactionDetails = snapTransactionDetail, - customerDetails = customerDetails - ) - ) - ) - verify(eventAnalytics).setUserIdentity("email", "first last", mapOf()) - verify(eventAnalytics).trackSnapGetTokenRequest(any()) - verify(eventAnalytics).trackSnapGetTokenResult(eq("snap-token-generated"), any()) - verify(mockCallback).onSuccess(paymentOptionCaptor.capture()) - val result = paymentOptionCaptor.firstValue - assertPaymentOption(result, "snap-token-generated") - } - - @Test - fun getPaymentOptionWhenSnapFailedToBeGeneratedShouldCreateSnapError() { - val errorCaptor = argumentCaptor() - val mockCallback: Callback = mock() - val snapTransactionDetail = SnapTransactionDetail( - orderId = "order-id", - grossAmount = 1234.00, - currency = "currency" - ) - whenever(mockMerchantApiRepository.getSnapToken(any())) doReturn Single.error(RuntimeException("test snap token error")) - usecase.getPaymentOption( - null, - SnapTokenRequestBuilder().withTransactionDetails(value = snapTransactionDetail), - mockCallback - ) - verify(mockSnapRepository, never()).getTransactionDetail(any()) - verify(mockMerchantApiRepository).getSnapToken( - eq(SnapTokenRequest(transactionDetails = snapTransactionDetail)) - ) - verify(mockCallback).onError(errorCaptor.capture()) - val error = errorCaptor.firstValue - assertTrue(error.cause is RuntimeException) - assertEquals("test snap token error", error.cause?.message) - assertEquals("Failed on getting snap token", error.message) - } - - @Test - fun getPaymentOptionWhenSnapProvidedAndTransactionDetailFailedShouldCreateSnapError() { - val errorCaptor = argumentCaptor() - val mockCallback: Callback = mock() - whenever(mockSnapRepository.getTransactionDetail("snap-token")) doReturn Single.error(RuntimeException("test get transaction detail error")) - usecase.getPaymentOption( - "snap-token", - provideRequestBuilder(), - mockCallback - ) - verify(mockSnapRepository).getTransactionDetail("snap-token") - verify(mockMerchantApiRepository, never()).getSnapToken(any()) - verify(mockCallback).onError(errorCaptor.capture()) - val error = errorCaptor.firstValue - assertTrue(error.cause is RuntimeException) - assertEquals("test get transaction detail error", error.cause?.message) - } - - @Test - fun getPaymentOptionWhenSnapIsNotProvidedAndTransactionDetailFailedShouldCreateSnapError() { - val errorCaptor = argumentCaptor() - val mockCallback: Callback = mock() - val snapTransactionDetail = SnapTransactionDetail( - orderId = "order-id", - grossAmount = 1234.00, - currency = "currency" - ) - whenever(mockMerchantApiRepository.getSnapToken(any())) doReturn Single.just( - SnapTokenResponse( - token = "snap-token-generated", - redirectUrl = "redirect-url-generated" - ) - ) - whenever(mockSnapRepository.getTransactionDetail("snap-token-generated")) doReturn Single.error(RuntimeException("test get transaction detail error")) - usecase.getPaymentOption( - null, - SnapTokenRequestBuilder().withTransactionDetails(value = snapTransactionDetail), - mockCallback - ) - verify(mockSnapRepository).getTransactionDetail("snap-token-generated") - verify(mockMerchantApiRepository).getSnapToken( - eq(SnapTokenRequest(transactionDetails = snapTransactionDetail)) - ) - verify(mockCallback).onError(errorCaptor.capture()) - val error = errorCaptor.firstValue - assertTrue(error.cause is RuntimeException) - assertEquals("test get transaction detail error", error.cause?.message) - } - - @Test - fun getTransactionStatusWhenSucceedShouldCallbackOnSuccess() { - val mockCallback: Callback = mock() - val single = Single.just( - TransactionResponse( - transactionId = "transactionId", - transactionStatus = "pending" - ) - ) - - whenever(mockSnapRepository.getTransactionStatus(any())) doReturn single - usecase.getTransactionStatus("snap-token", mockCallback) - single.test() - .assertComplete() - - verify(mockCallback).onSuccess(any()) - } - - @Test - fun setAnalyticsUserIdentityWhenCustomerDataIsNullShouldSetSnapTokenAsUserId() { - val mockCallback: Callback = mock() - whenever(mockSnapRepository.getTransactionDetail("snap-token")) doReturn Single.just( - Transaction( - token = "snap-token", - merchant = Merchant( - merchantId = "merchant-id", - preference = MerchantPreferences( - displayName = "merchant-name" - ) - ) - ) - ) - usecase.getPaymentOption( - "snap-token", - provideRequestBuilder(), - mockCallback - ) - verify(eventAnalytics).setUserIdentity("snap-token", "", mapOf()) - } - - private fun assertPaymentOption(result: PaymentOption, snapToken: String) { - assertThat( - result.options, - hasItems( - PaymentMethod( - type = BANK_TRANSFER, - channels = listOf("bni_va", "permata_va") - ), - PaymentMethod( - type = SHOPEEPAY_QRIS, - channels = emptyList() - ), - PaymentMethod( - type = ALFAMART, - channels = emptyList() - ), - PaymentMethod( - type = UOB_EZPAY, - channels = listOf("uob_1", "uob_2") - ) - ) - ) - assertEquals(4, result.options.size) - assertEquals(snapToken, result.token) - } - - private fun provideEnabledPayments(): List { - return listOf( - EnabledPayment( - type = "bni_va", - category = "bank_transfer", - status = "up", - ), - EnabledPayment( - type = "bca_va", - category = "bank_transfer", - status = "down", - ), - EnabledPayment( - type = "permata_va", - category = "bank_transfer", - status = "up", - ), - EnabledPayment( - type = "qris", - acquirer = "shopeepay", - status = "up" - ), - EnabledPayment( - type = "gopay", - status = "down" - ), - EnabledPayment( - type = "alfamart", - category = "cstore", - status = "up" - ), - EnabledPayment( - type = "uob_ezpay", - mode = listOf("uob_1", "uob_2"), - status = "up" - ), - ) - } - - private fun provideRequestBuilder(): SnapTokenRequestBuilder { - return SnapTokenRequestBuilder() - .withTransactionDetails( - value = SnapTransactionDetail( - orderId = "order-id", - grossAmount = 1234.00, - currency = "currency" - ) - ) - } -} \ No newline at end of file diff --git a/corekit/src/test/java/com/midtrans/sdk/corekit/internal/util/StringUtilTest.kt b/corekit/src/test/java/com/midtrans/sdk/corekit/internal/util/StringUtilTest.kt deleted file mode 100644 index 8dd691c6b..000000000 --- a/corekit/src/test/java/com/midtrans/sdk/corekit/internal/util/StringUtilTest.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.midtrans.sdk.corekit.internal.util - -import org.junit.Assert.* -import org.junit.Test - -internal class StringUtilTest{ - @Test - internal fun testCheckIfContentNotNullShouldReturnFalse() { - assertFalse(StringUtil.checkIfContentNotNull(null, null, null, "")) - } - @Test - internal fun testCheckIfContentNotNullShouldReturnTrue() { - assertTrue(StringUtil.checkIfContentNotNull(null, null, null, "sesuatu")) - } -} \ No newline at end of file diff --git a/corekit/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/corekit/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker deleted file mode 100644 index 1f0955d45..000000000 --- a/corekit/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker +++ /dev/null @@ -1 +0,0 @@ -mock-maker-inline diff --git a/settings.gradle.kts b/settings.gradle.kts index 3966e4b20..b9d72594e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -20,5 +20,4 @@ dependencyResolutionManagement { rootProject.name = "Snap" include(":app") -include(":corekit") include(":ui") diff --git a/ui/build.gradle.kts b/ui/build.gradle.kts index e723d6d46..882d9cde2 100644 --- a/ui/build.gradle.kts +++ b/ui/build.gradle.kts @@ -3,6 +3,7 @@ plugins { id("org.jetbrains.kotlin.android") id("kotlin-kapt") id("kotlin-parcelize") + id("maven-publish") } android { @@ -26,11 +27,22 @@ android { getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) + buildConfigField("String", "SNAP_BASE_URL", "\"https://app.midtrans.com/snap/\"") + buildConfigField("String", "CORE_API_BASE_URL", "\"https://api.midtrans.com/\"") + buildConfigField("String", "MIXPANEL_TOKEN", "\"84ed63a9507c49b373945b13633b8a0c\"") + buildConfigField("String", "SDK_VERSION", "${project.property("sdkVersion")}") + } + + debug { + buildConfigField("String", "SNAP_BASE_URL", "\"https://app.sandbox.midtrans.com/snap/\"") + buildConfigField("String", "CORE_API_BASE_URL", "\"https://api.sandbox.midtrans.com/\"") + buildConfigField("String", "MIXPANEL_TOKEN", "\"f070570da8b882fda74c77541f0926a0\"") + buildConfigField("String", "SDK_VERSION", "${project.property("sdkVersion")}") } } compileOptions { - isCoreLibraryDesugaringEnabled = true + isCoreLibraryDesugaringEnabled = false sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } @@ -92,7 +104,6 @@ dependencies { //TODO: work around, remove when google fix compose tooling debugImplementation("androidx.customview:customview:1.2.0-alpha01") debugImplementation("androidx.customview:customview-poolingcontainer:1.0.0-alpha01") - implementation(project(":corekit")) //rx android implementation(com.gtf.snap.RxLibraries.rxAndroid2) @@ -115,4 +126,34 @@ dependencies { implementation(com.gtf.snap.CommonLibraries.zxing) debugImplementation(com.gtf.snap.CommonLibraries.leakCanary) -} \ No newline at end of file + + // Migrate corekit to uikit + implementation(com.gtf.snap.NetworkLibraries.retrofit) + implementation(com.gtf.snap.NetworkLibraries.retrofitGson) + implementation(com.gtf.snap.NetworkLibraries.retrofitRx) + implementation(com.gtf.snap.NetworkLibraries.okHttp) + implementation(com.gtf.snap.NetworkLibraries.okHttpLogging) + implementation(com.gtf.snap.NetworkLibraries.okHttpUrlConnection) + + debugImplementation(com.gtf.snap.NetworkLibraries.chuck) + releaseImplementation(com.gtf.snap.NetworkLibraries.chuckNoOp) + implementation(com.gtf.snap.CommonLibraries.mixpanel) + + implementation(com.gtf.snap.CommonLibraries.androidxDatastore) + implementation(com.gtf.snap.CommonLibraries.uuid) +} +afterEvaluate { + publishing { + publications { + register("debug") { + groupId = "com.snap" + artifactId = "uikit-test" + version = "1.0" + + afterEvaluate { + from(components["debug"]) + } + } + } + } +} diff --git a/ui/src/main/AndroidManifest.xml b/ui/src/main/AndroidManifest.xml index 4af9db26a..d83cfff32 100644 --- a/ui/src/main/AndroidManifest.xml +++ b/ui/src/main/AndroidManifest.xml @@ -2,6 +2,9 @@ + + + you can also disable log message for example - * in release mode of your application using instance of {@link SdkCoreFlowBuilder#enableLog(boolean)} - *

- * Created by shivam on 10/20/15. - */ +import com.midtrans.sdk.uikit.BuildConfig; + public class Logger { public static boolean enabled = false; diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/SnapCore.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/SnapCore.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/SnapCore.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/SnapCore.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/callback/Callback.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/callback/Callback.kt similarity index 76% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/callback/Callback.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/callback/Callback.kt index cdaf056cf..c5c579e33 100644 --- a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/callback/Callback.kt +++ b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/callback/Callback.kt @@ -1,7 +1,6 @@ package com.midtrans.sdk.corekit.api.callback import com.midtrans.sdk.corekit.api.exception.SnapError -import com.midtrans.sdk.corekit.api.model.TransactionResponse open interface Callback { fun onSuccess(result: T) diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/CallbackUnimplementedException.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/CallbackUnimplementedException.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/CallbackUnimplementedException.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/CallbackUnimplementedException.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/InvalidPaymentTypeException.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/InvalidPaymentTypeException.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/InvalidPaymentTypeException.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/InvalidPaymentTypeException.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/MissingParameterException.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/MissingParameterException.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/MissingParameterException.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/MissingParameterException.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/SnapError.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/SnapError.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/SnapError.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/exception/SnapError.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Address.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Address.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Address.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Address.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BankPointResponse.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BankPointResponse.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BankPointResponse.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BankPointResponse.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BankTransferRequest.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BankTransferRequest.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BankTransferRequest.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BankTransferRequest.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinData.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinData.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinData.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinData.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinDetail.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinDetail.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinDetail.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinDetail.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinResponse.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinResponse.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinResponse.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/BinResponse.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CardTokenResponse.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CardTokenResponse.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CardTokenResponse.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CardTokenResponse.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CreditCard.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CreditCard.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CreditCard.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CreditCard.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CustomerDetails.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CustomerDetails.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CustomerDetails.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/CustomerDetails.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/DeleteSavedCardResponse.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/DeleteSavedCardResponse.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/DeleteSavedCardResponse.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/DeleteSavedCardResponse.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Expiry.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Expiry.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Expiry.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Expiry.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/FreeText.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/FreeText.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/FreeText.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/FreeText.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/FreeTextLanguage.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/FreeTextLanguage.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/FreeTextLanguage.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/FreeTextLanguage.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/GopayPaymentCallback.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/GopayPaymentCallback.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/GopayPaymentCallback.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/GopayPaymentCallback.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Installment.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Installment.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Installment.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Installment.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/InstallmentBank.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/InstallmentBank.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/InstallmentBank.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/InstallmentBank.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/ItemDetails.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/ItemDetails.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/ItemDetails.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/ItemDetails.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentCallback.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentCallback.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentCallback.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentCallback.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentMethod.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentMethod.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentMethod.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentMethod.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentOption.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentOption.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentOption.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentOption.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentType.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentType.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentType.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PaymentType.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Promo.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Promo.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Promo.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/Promo.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoDetails.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoDetails.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoDetails.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoDetails.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoRequest.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoRequest.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoRequest.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoRequest.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoResponse.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoResponse.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoResponse.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/PromoResponse.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/SavedToken.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/SavedToken.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/SavedToken.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/SavedToken.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/SnapTransactionDetail.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/SnapTransactionDetail.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/SnapTransactionDetail.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/SnapTransactionDetail.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/TransactionResponse.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/TransactionResponse.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/TransactionResponse.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/TransactionResponse.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/TransactionResult.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/TransactionResult.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/TransactionResult.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/TransactionResult.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/VaNumber.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/VaNumber.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/model/VaNumber.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/model/VaNumber.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/CreditCardTokenRequestBuilder.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/CreditCardTokenRequestBuilder.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/CreditCardTokenRequestBuilder.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/CreditCardTokenRequestBuilder.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/NormalCardTokenRequestBuilder.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/NormalCardTokenRequestBuilder.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/NormalCardTokenRequestBuilder.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/NormalCardTokenRequestBuilder.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/TwoClickCardTokenRequestBuilder.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/TwoClickCardTokenRequestBuilder.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/TwoClickCardTokenRequestBuilder.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/cardtoken/TwoClickCardTokenRequestBuilder.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/BankTransferPaymentRequestBuilder.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/BankTransferPaymentRequestBuilder.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/BankTransferPaymentRequestBuilder.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/BankTransferPaymentRequestBuilder.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/ConvenienceStorePaymentRequestBuilder.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/ConvenienceStorePaymentRequestBuilder.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/ConvenienceStorePaymentRequestBuilder.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/ConvenienceStorePaymentRequestBuilder.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/CreditCardPaymentRequestBuilder.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/CreditCardPaymentRequestBuilder.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/CreditCardPaymentRequestBuilder.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/CreditCardPaymentRequestBuilder.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/DirectDebitPaymentRequestBuilder.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/DirectDebitPaymentRequestBuilder.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/DirectDebitPaymentRequestBuilder.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/DirectDebitPaymentRequestBuilder.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/EWalletPaymentRequestBuilder.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/EWalletPaymentRequestBuilder.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/EWalletPaymentRequestBuilder.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/EWalletPaymentRequestBuilder.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/OneClickCardPaymentRequestBuilder.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/OneClickCardPaymentRequestBuilder.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/OneClickCardPaymentRequestBuilder.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/OneClickCardPaymentRequestBuilder.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/PayLaterPaymentRequestBuilder.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/PayLaterPaymentRequestBuilder.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/PayLaterPaymentRequestBuilder.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/PayLaterPaymentRequestBuilder.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/PaymentRequestBuilder.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/PaymentRequestBuilder.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/PaymentRequestBuilder.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/payment/PaymentRequestBuilder.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/snaptoken/SnapTokenRequestBuilder.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/snaptoken/SnapTokenRequestBuilder.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/snaptoken/SnapTokenRequestBuilder.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/api/requestbuilder/snaptoken/SnapTokenRequestBuilder.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/EventAnalytics.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/EventAnalytics.kt similarity index 99% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/EventAnalytics.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/EventAnalytics.kt index 6f19b6815..bcc058c75 100644 --- a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/EventAnalytics.kt +++ b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/EventAnalytics.kt @@ -1,6 +1,6 @@ package com.midtrans.sdk.corekit.internal.analytics -import com.midtrans.sdk.corekit.BuildConfig +import com.midtrans.sdk.uikit.BuildConfig import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_3DS_RESULT import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_ACCOUNT_NUMBER_COPIED import com.midtrans.sdk.corekit.internal.analytics.EventName.EVENT_SNAP_CHARGE_REQUEST diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/EventName.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/EventName.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/EventName.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/EventName.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/MixpanelTracker.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/MixpanelTracker.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/MixpanelTracker.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/MixpanelTracker.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/PageName.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/PageName.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/PageName.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/analytics/PageName.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/config/Config.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/config/Config.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/config/Config.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/config/Config.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/constant/Authentication.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/constant/Authentication.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/constant/Authentication.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/constant/Authentication.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/constant/CommonConstant.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/constant/CommonConstant.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/constant/CommonConstant.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/constant/CommonConstant.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/BaseRepository.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/BaseRepository.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/BaseRepository.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/BaseRepository.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/CoreApiRepository.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/CoreApiRepository.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/CoreApiRepository.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/CoreApiRepository.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/MerchantApiRepository.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/MerchantApiRepository.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/MerchantApiRepository.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/MerchantApiRepository.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/SnapRepository.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/SnapRepository.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/SnapRepository.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/repository/SnapRepository.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/service/BaseService.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/service/BaseService.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/service/BaseService.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/service/BaseService.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/sharedpref/SharedData.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/sharedpref/SharedData.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/sharedpref/SharedData.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/data/sharedpref/SharedData.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/AnalyticsModule.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/AnalyticsModule.kt similarity index 94% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/AnalyticsModule.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/AnalyticsModule.kt index 7cb5dd889..3fdb662c5 100644 --- a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/AnalyticsModule.kt +++ b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/AnalyticsModule.kt @@ -1,7 +1,7 @@ package com.midtrans.sdk.corekit.internal.di import android.content.Context -import com.midtrans.sdk.corekit.BuildConfig +import com.midtrans.sdk.uikit.BuildConfig import com.midtrans.sdk.corekit.internal.analytics.EventAnalytics import com.midtrans.sdk.corekit.internal.analytics.MixpanelTracker import com.mixpanel.android.mpmetrics.MixpanelAPI diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/RepositoryModule.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/RepositoryModule.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/RepositoryModule.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/RepositoryModule.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/RestClientModule.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/RestClientModule.kt similarity index 99% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/RestClientModule.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/RestClientModule.kt index 7c6b891fd..28202abd1 100644 --- a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/RestClientModule.kt +++ b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/RestClientModule.kt @@ -6,7 +6,7 @@ import com.google.gson.FieldNamingPolicy import com.google.gson.Gson import com.google.gson.GsonBuilder import com.google.gson.internal.bind.DateTypeAdapter -import com.midtrans.sdk.corekit.BuildConfig +import com.midtrans.sdk.uikit.BuildConfig import com.midtrans.sdk.corekit.internal.network.MerchantInterceptor import com.midtrans.sdk.corekit.internal.network.SnapRequestInterceptor import com.midtrans.sdk.corekit.internal.network.restapi.CoreApi diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/SnapComponent.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/SnapComponent.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/SnapComponent.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/SnapComponent.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/UsecaseModule.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/UsecaseModule.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/UsecaseModule.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/di/UsecaseModule.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/exception/ApiError.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/exception/ApiError.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/exception/ApiError.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/exception/ApiError.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/extension/ViewExtensions.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/extension/ViewExtensions.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/extension/ViewExtensions.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/extension/ViewExtensions.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/mapper/InternalMapper.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/mapper/InternalMapper.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/mapper/InternalMapper.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/mapper/InternalMapper.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/MerchantInterceptor.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/MerchantInterceptor.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/MerchantInterceptor.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/MerchantInterceptor.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/SnapRequestAuthenticator.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/SnapRequestAuthenticator.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/SnapRequestAuthenticator.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/SnapRequestAuthenticator.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/SnapRequestInterceptor.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/SnapRequestInterceptor.kt similarity index 92% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/SnapRequestInterceptor.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/SnapRequestInterceptor.kt index 9d9644432..86663111e 100644 --- a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/SnapRequestInterceptor.kt +++ b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/SnapRequestInterceptor.kt @@ -1,6 +1,6 @@ package com.midtrans.sdk.corekit.internal.network -import com.midtrans.sdk.corekit.BuildConfig +import com.midtrans.sdk.uikit.BuildConfig import okhttp3.Interceptor import okhttp3.Response diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/BankTransferRequest.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/BankTransferRequest.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/BankTransferRequest.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/BankTransferRequest.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/CustomerDetailRequest.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/CustomerDetailRequest.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/CustomerDetailRequest.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/CustomerDetailRequest.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/InstallmentRequest.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/InstallmentRequest.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/InstallmentRequest.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/InstallmentRequest.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PaymentParam.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PaymentParam.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PaymentParam.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PaymentParam.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PaymentRequest.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PaymentRequest.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PaymentRequest.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PaymentRequest.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PromoDetailRequest.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PromoDetailRequest.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PromoDetailRequest.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/PromoDetailRequest.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/SnapTokenRequest.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/SnapTokenRequest.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/SnapTokenRequest.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/request/SnapTokenRequest.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Callbacks.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Callbacks.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Callbacks.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Callbacks.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/EnabledPayment.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/EnabledPayment.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/EnabledPayment.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/EnabledPayment.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Merchant.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Merchant.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Merchant.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Merchant.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/MerchantPreferences.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/MerchantPreferences.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/MerchantPreferences.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/MerchantPreferences.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/SnapTokenResponse.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/SnapTokenResponse.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/SnapTokenResponse.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/SnapTokenResponse.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Transaction.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Transaction.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Transaction.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/Transaction.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/TransactionDetails.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/TransactionDetails.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/TransactionDetails.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/model/response/TransactionDetails.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/CoreApi.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/CoreApi.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/CoreApi.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/CoreApi.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/MerchantApi.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/MerchantApi.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/MerchantApi.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/MerchantApi.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/PaymentApi.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/PaymentApi.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/PaymentApi.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/PaymentApi.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/SnapApi.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/SnapApi.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/SnapApi.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/network/restapi/SnapApi.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/BaseSdkScheduler.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/BaseSdkScheduler.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/BaseSdkScheduler.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/BaseSdkScheduler.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/SdkScheduler.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/SdkScheduler.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/SdkScheduler.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/SdkScheduler.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/TestSdkScheduler.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/TestSdkScheduler.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/TestSdkScheduler.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/scheduler/TestSdkScheduler.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/usecase/AssetReader.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/usecase/AssetReader.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/usecase/AssetReader.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/usecase/AssetReader.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/usecase/PaymentUsecase.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/usecase/PaymentUsecase.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/usecase/PaymentUsecase.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/usecase/PaymentUsecase.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/BytesExtensions.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/BytesExtensions.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/BytesExtensions.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/BytesExtensions.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NetworkUtil.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NetworkUtil.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NetworkUtil.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NetworkUtil.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NumberExtension.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NumberExtension.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NumberExtension.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NumberExtension.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NumberUtil.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NumberUtil.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NumberUtil.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/NumberUtil.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/ObjectExtension.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/ObjectExtension.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/ObjectExtension.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/ObjectExtension.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/SingleLiveEvent.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/SingleLiveEvent.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/SingleLiveEvent.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/SingleLiveEvent.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/StringExtensions.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/StringExtensions.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/StringExtensions.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/StringExtensions.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/StringUtil.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/StringUtil.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/StringUtil.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/StringUtil.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/TimeProvider.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/TimeProvider.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/TimeProvider.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/TimeProvider.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/Utils.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/Utils.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/Utils.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/Utils.kt diff --git a/corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/UuidGenerator.kt b/ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/UuidGenerator.kt similarity index 100% rename from corekit/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/UuidGenerator.kt rename to ui/src/main/kotlin/com/midtrans/sdk/corekit/internal/util/UuidGenerator.kt