diff --git a/.github/workflows/SonarCloud.yml b/.github/workflows/SonarCloud.yml index 61298a5..5735a46 100644 --- a/.github/workflows/SonarCloud.yml +++ b/.github/workflows/SonarCloud.yml @@ -10,21 +10,22 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: 11 + distribution: 'temurin' + java-version: 17 - name: Cache SonarCloud packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - name: Cache Gradle packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} diff --git a/paystack/src/main/java/co/paystack/android/Constants.kt b/paystack/src/main/java/co/paystack/android/Constants.kt new file mode 100644 index 0000000..40447c2 --- /dev/null +++ b/paystack/src/main/java/co/paystack/android/Constants.kt @@ -0,0 +1,4 @@ +package co.paystack.android + +const val DEPRECATION_MESSAGE = + "This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/" diff --git a/paystack/src/main/java/co/paystack/android/Paystack.java b/paystack/src/main/java/co/paystack/android/Paystack.java index ad308f9..33caac4 100644 --- a/paystack/src/main/java/co/paystack/android/Paystack.java +++ b/paystack/src/main/java/co/paystack/android/Paystack.java @@ -1,5 +1,7 @@ package co.paystack.android; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + import android.app.Activity; import co.paystack.android.exceptions.AuthenticationException; @@ -7,6 +9,7 @@ import co.paystack.android.model.Charge; import co.paystack.android.model.PaystackModel; import co.paystack.android.utils.Utils; +import kotlin.Deprecated; /** * This is the Paystack model class.\n @@ -15,7 +18,9 @@ * Instead, access the functionalities of this class via the {@link PaystackSdk} * * @author {androidsupport@paystack.co} on 9/16/15. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class Paystack extends PaystackModel { private String publicKey; @@ -53,6 +58,10 @@ private void validatePublicKey(String publicKey) throws AuthenticationException } + /** + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ + */ + @Deprecated(message = DEPRECATION_MESSAGE) void chargeCard(Activity activity, Charge charge, TransactionCallback transactionCallback) { chargeCard(activity, charge, publicKey, transactionCallback); } @@ -79,11 +88,34 @@ private void chargeCard(Activity activity, Charge charge, String publicKey, Tran private interface BaseCallback { } + /** + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ + */ + @Deprecated(message = DEPRECATION_MESSAGE) public interface TransactionCallback extends BaseCallback { + /** + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ + */ + @Deprecated(message = DEPRECATION_MESSAGE) void onSuccess(Transaction transaction); + + /** + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ + */ + @Deprecated(message = DEPRECATION_MESSAGE) void beforeValidate(Transaction transaction); + + /** + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ + */ + @Deprecated(message = DEPRECATION_MESSAGE) void showLoading(Boolean isProcessing); + + /** + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ + */ + @Deprecated(message = DEPRECATION_MESSAGE) void onError(Throwable error, Transaction transaction); } -} \ No newline at end of file +} diff --git a/paystack/src/main/java/co/paystack/android/PaystackSdk.java b/paystack/src/main/java/co/paystack/android/PaystackSdk.java index 2eaa3c0..86d27d0 100644 --- a/paystack/src/main/java/co/paystack/android/PaystackSdk.java +++ b/paystack/src/main/java/co/paystack/android/PaystackSdk.java @@ -1,5 +1,7 @@ package co.paystack.android; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + import android.app.Activity; import android.content.Context; import android.content.pm.ApplicationInfo; @@ -8,6 +10,7 @@ import co.paystack.android.exceptions.PaystackSdkNotInitializedException; import co.paystack.android.model.Charge; import co.paystack.android.utils.Utils; +import kotlin.Deprecated; /** * This is the overall paystack sdk manager class. @@ -71,12 +74,18 @@ private static synchronized void initialize(Context applicationContext, SdkIniti * Initialize an sdk without a callback * * @param context - Application Context + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ + @Deprecated(message = DEPRECATION_MESSAGE) public static synchronized void initialize(Context context) { initialize(context, null); } - + /** + * @return Boolean - if the SDK has been initialised + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ + */ + @Deprecated(message = DEPRECATION_MESSAGE) public static boolean isSdkInitialized() { return sdkInitialized; } @@ -86,7 +95,9 @@ public static boolean isSdkInitialized() { * * @return public key * @throws PaystackSdkNotInitializedException if the sdk hasn't been initialized + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ + @Deprecated(message = DEPRECATION_MESSAGE) public static String getPublicKey() throws PaystackSdkNotInitializedException { //validate that the sdk has been initialized Utils.Validate.validateSdkInitialized(); @@ -98,7 +109,9 @@ public static String getPublicKey() throws PaystackSdkNotInitializedException { * Sets the public key * * @param publicKey - App Developer's public key + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ + @Deprecated(message = DEPRECATION_MESSAGE) public static void setPublicKey(String publicKey) { PaystackSdk.publicKey = publicKey; } @@ -137,6 +150,10 @@ private static void performChecks() { Utils.Validate.hasPublicKey(); } + /** + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ + */ + @Deprecated(message = DEPRECATION_MESSAGE) public static void chargeCard(Activity activity, Charge charge, Paystack.TransactionCallback transactionCallback) { if (BuildConfig.DEBUG && (activity == null)) { throw new AssertionError("activity must not be null"); @@ -151,6 +168,10 @@ public static void chargeCard(Activity activity, Charge charge, Paystack.Transac paystack.chargeCard(activity, charge, transactionCallback); } + /** + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ + */ + @Deprecated(message = DEPRECATION_MESSAGE) public interface SdkInitializeCallback { void onInitialized(); } diff --git a/paystack/src/main/java/co/paystack/android/Transaction.java b/paystack/src/main/java/co/paystack/android/Transaction.java index 5a50e92..24c424e 100644 --- a/paystack/src/main/java/co/paystack/android/Transaction.java +++ b/paystack/src/main/java/co/paystack/android/Transaction.java @@ -1,7 +1,14 @@ package co.paystack.android; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + import co.paystack.android.api.model.TransactionApiResponse; +import kotlin.Deprecated; +/** + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ + */ +@Deprecated(message = DEPRECATION_MESSAGE) public class Transaction { private String id; private String reference; diff --git a/paystack/src/main/java/co/paystack/android/TransactionManager.java b/paystack/src/main/java/co/paystack/android/TransactionManager.java index 801e7bb..3c8666d 100644 --- a/paystack/src/main/java/co/paystack/android/TransactionManager.java +++ b/paystack/src/main/java/co/paystack/android/TransactionManager.java @@ -1,5 +1,6 @@ package co.paystack.android; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; import static co.paystack.android.Transaction.EMPTY_TRANSACTION; import android.app.Activity; @@ -38,7 +39,12 @@ import co.paystack.android.ui.PinSingleton; import co.paystack.android.utils.Crypto; import co.paystack.android.utils.StringUtils; +import kotlin.Deprecated; +/** + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ + */ +@Deprecated(message = DEPRECATION_MESSAGE) class TransactionManager { private static final String LOG_TAG = TransactionManager.class.getSimpleName(); @@ -95,7 +101,7 @@ void chargeCard(Activity activity, String publicKey, Charge charge, Paystack.Tra validateCardThenInitTransaction(publicKey, charge); } - private void validateCardThenInitTransaction(String publicKey, Charge charge) { + private void validateCardThenInitTransaction(String publicKey, Charge charge){ try { if (charge.getCard() == null || !charge.getCard().isValid()) { final CardSingleton si = CardSingleton.getInstance(); @@ -468,4 +474,4 @@ protected void onPostExecute(Address address) { } } } -} \ No newline at end of file +} diff --git a/paystack/src/main/java/co/paystack/android/api/ChargeApiCallback.kt b/paystack/src/main/java/co/paystack/android/api/ChargeApiCallback.kt index d83bcbf..a52514e 100644 --- a/paystack/src/main/java/co/paystack/android/api/ChargeApiCallback.kt +++ b/paystack/src/main/java/co/paystack/android/api/ChargeApiCallback.kt @@ -1,10 +1,15 @@ package co.paystack.android.api +import co.paystack.android.DEPRECATION_MESSAGE import co.paystack.android.api.model.ChargeResponse import co.paystack.android.api.request.ChargeParams +/** + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ + */ +@Deprecated(message = DEPRECATION_MESSAGE) interface ChargeApiCallback { fun onSuccess(params: ChargeParams, response: ChargeResponse) fun onError(exception: Throwable, reference: String?) -} \ No newline at end of file +} diff --git a/paystack/src/main/java/co/paystack/android/exceptions/AuthenticationException.java b/paystack/src/main/java/co/paystack/android/exceptions/AuthenticationException.java index 500f7a0..7a8b5ba 100644 --- a/paystack/src/main/java/co/paystack/android/exceptions/AuthenticationException.java +++ b/paystack/src/main/java/co/paystack/android/exceptions/AuthenticationException.java @@ -1,8 +1,14 @@ package co.paystack.android.exceptions; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + +import kotlin.Deprecated; + /** * @author {androidsupport@paystack.co} on 9/16/15. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class AuthenticationException extends PaystackException { public AuthenticationException(String message) { super(message); @@ -11,4 +17,4 @@ public AuthenticationException(String message) { public AuthenticationException(String message, Throwable e) { super(message, e); } -} +} \ No newline at end of file diff --git a/paystack/src/main/java/co/paystack/android/exceptions/CardException.java b/paystack/src/main/java/co/paystack/android/exceptions/CardException.java index 1cfb597..1f20181 100644 --- a/paystack/src/main/java/co/paystack/android/exceptions/CardException.java +++ b/paystack/src/main/java/co/paystack/android/exceptions/CardException.java @@ -1,8 +1,14 @@ package co.paystack.android.exceptions; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + +import kotlin.Deprecated; + /** * @author {androidsupport@paystack.co} on 9/13/15. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class CardException extends PaystackException { public CardException(String message) { diff --git a/paystack/src/main/java/co/paystack/android/exceptions/ChargeException.java b/paystack/src/main/java/co/paystack/android/exceptions/ChargeException.java index 032e41b..ea20978 100644 --- a/paystack/src/main/java/co/paystack/android/exceptions/ChargeException.java +++ b/paystack/src/main/java/co/paystack/android/exceptions/ChargeException.java @@ -1,8 +1,14 @@ package co.paystack.android.exceptions; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + +import kotlin.Deprecated; + /** * @author {androidsupport@paystack.co} on 9/25/15. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class ChargeException extends PaystackException { public ChargeException(String message) { super(message); diff --git a/paystack/src/main/java/co/paystack/android/exceptions/ExpiredAccessCodeException.java b/paystack/src/main/java/co/paystack/android/exceptions/ExpiredAccessCodeException.java index 49fc573..d8f8767 100644 --- a/paystack/src/main/java/co/paystack/android/exceptions/ExpiredAccessCodeException.java +++ b/paystack/src/main/java/co/paystack/android/exceptions/ExpiredAccessCodeException.java @@ -1,8 +1,14 @@ package co.paystack.android.exceptions; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + +import kotlin.Deprecated; + /** * @author {androidsupport@paystack.co} on 9/25/15. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class ExpiredAccessCodeException extends PaystackException { public ExpiredAccessCodeException(String message) { super(message); diff --git a/paystack/src/main/java/co/paystack/android/exceptions/InvalidAmountException.java b/paystack/src/main/java/co/paystack/android/exceptions/InvalidAmountException.java index 81c2967..3e6b9b1 100644 --- a/paystack/src/main/java/co/paystack/android/exceptions/InvalidAmountException.java +++ b/paystack/src/main/java/co/paystack/android/exceptions/InvalidAmountException.java @@ -1,8 +1,14 @@ package co.paystack.android.exceptions; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + +import kotlin.Deprecated; + /** * Created by i on 24/08/2016. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class InvalidAmountException extends PaystackException { private int amount; diff --git a/paystack/src/main/java/co/paystack/android/exceptions/InvalidEmailException.java b/paystack/src/main/java/co/paystack/android/exceptions/InvalidEmailException.java index ba60b4b..c8c206c 100644 --- a/paystack/src/main/java/co/paystack/android/exceptions/InvalidEmailException.java +++ b/paystack/src/main/java/co/paystack/android/exceptions/InvalidEmailException.java @@ -1,8 +1,14 @@ package co.paystack.android.exceptions; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + +import kotlin.Deprecated; + /** * Created by i on 24/08/2016. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class InvalidEmailException extends PaystackException { private String email; diff --git a/paystack/src/main/java/co/paystack/android/exceptions/PaystackActivityNotFoundException.java b/paystack/src/main/java/co/paystack/android/exceptions/PaystackActivityNotFoundException.java index 8396cfd..1a2407e 100644 --- a/paystack/src/main/java/co/paystack/android/exceptions/PaystackActivityNotFoundException.java +++ b/paystack/src/main/java/co/paystack/android/exceptions/PaystackActivityNotFoundException.java @@ -1,8 +1,14 @@ package co.paystack.android.exceptions; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + +import kotlin.Deprecated; + /** * @author {androidsupport@paystack.co} on 9/22/15. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class PaystackActivityNotFoundException extends PaystackException { public PaystackActivityNotFoundException(String message) { super(message); diff --git a/paystack/src/main/java/co/paystack/android/exceptions/PaystackException.java b/paystack/src/main/java/co/paystack/android/exceptions/PaystackException.java index ef6734b..585f721 100644 --- a/paystack/src/main/java/co/paystack/android/exceptions/PaystackException.java +++ b/paystack/src/main/java/co/paystack/android/exceptions/PaystackException.java @@ -1,12 +1,18 @@ package co.paystack.android.exceptions; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + import java.io.Serializable; +import kotlin.Deprecated; + /** * Base class for exceptions * * @author {androidsupport@paystack.co} on 9/13/15. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class PaystackException extends RuntimeException implements Serializable { public PaystackException(String message) { diff --git a/paystack/src/main/java/co/paystack/android/exceptions/PaystackSdkNotInitializedException.java b/paystack/src/main/java/co/paystack/android/exceptions/PaystackSdkNotInitializedException.java index 49aff68..8f2d230 100644 --- a/paystack/src/main/java/co/paystack/android/exceptions/PaystackSdkNotInitializedException.java +++ b/paystack/src/main/java/co/paystack/android/exceptions/PaystackSdkNotInitializedException.java @@ -1,8 +1,14 @@ package co.paystack.android.exceptions; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + +import kotlin.Deprecated; + /** * @author {androidsupport@paystack.co} on 9/22/15. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class PaystackSdkNotInitializedException extends PaystackException { public PaystackSdkNotInitializedException(String message) { super(message); diff --git a/paystack/src/main/java/co/paystack/android/exceptions/ProcessingException.java b/paystack/src/main/java/co/paystack/android/exceptions/ProcessingException.java index 0aad910..9522113 100644 --- a/paystack/src/main/java/co/paystack/android/exceptions/ProcessingException.java +++ b/paystack/src/main/java/co/paystack/android/exceptions/ProcessingException.java @@ -1,8 +1,14 @@ package co.paystack.android.exceptions; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + +import kotlin.Deprecated; + /** * @author {androidsupport@paystack.co} on 9/25/15. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class ProcessingException extends ChargeException { public ProcessingException() { super("A transaction is currently processing, please wait till it concludes before attempting a new charge."); diff --git a/paystack/src/main/java/co/paystack/android/exceptions/TokenException.java b/paystack/src/main/java/co/paystack/android/exceptions/TokenException.java index a902a3f..79c2087 100644 --- a/paystack/src/main/java/co/paystack/android/exceptions/TokenException.java +++ b/paystack/src/main/java/co/paystack/android/exceptions/TokenException.java @@ -1,8 +1,14 @@ package co.paystack.android.exceptions; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + +import kotlin.Deprecated; + /** * @author {androidsupport@paystack.co} on 9/20/15. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class TokenException extends PaystackException { public TokenException(String message) { super(message); diff --git a/paystack/src/main/java/co/paystack/android/exceptions/ValidateException.java b/paystack/src/main/java/co/paystack/android/exceptions/ValidateException.java index 4f8b5c1..28548a0 100644 --- a/paystack/src/main/java/co/paystack/android/exceptions/ValidateException.java +++ b/paystack/src/main/java/co/paystack/android/exceptions/ValidateException.java @@ -1,8 +1,14 @@ package co.paystack.android.exceptions; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + +import kotlin.Deprecated; + /** * Created by i on 24/08/2016. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class ValidateException extends PaystackException { public ValidateException(String message) { super(message); diff --git a/paystack/src/main/java/co/paystack/android/utils/CardUtils.java b/paystack/src/main/java/co/paystack/android/utils/CardUtils.java index 21f3c58..e056e67 100644 --- a/paystack/src/main/java/co/paystack/android/utils/CardUtils.java +++ b/paystack/src/main/java/co/paystack/android/utils/CardUtils.java @@ -1,16 +1,22 @@ package co.paystack.android.utils; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + import java.util.Calendar; import java.util.Locale; +import kotlin.Deprecated; + /** * Utils used with the Card model. * * @author {androidsupport@paystack.co} on 9/13/15. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class CardUtils { - public static boolean isWholePositiveNumber(String value) { + public static boolean isWholePositiveNumber(String value) { if (value == null) { return false; } diff --git a/paystack/src/main/java/co/paystack/android/utils/Crypto.java b/paystack/src/main/java/co/paystack/android/utils/Crypto.java index e830bf1..4565c15 100644 --- a/paystack/src/main/java/co/paystack/android/utils/Crypto.java +++ b/paystack/src/main/java/co/paystack/android/utils/Crypto.java @@ -1,5 +1,7 @@ package co.paystack.android.utils; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + import android.util.Base64; import java.security.KeyFactory; @@ -12,13 +14,16 @@ import javax.crypto.Cipher; import co.paystack.android.exceptions.AuthenticationException; +import kotlin.Deprecated; /** * Class for encrypting the card details, for token creation. * * @author {androidsupport@paystack.co} on 8/10/15. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class Crypto { private static final String PAYSTACK_RSA_PUBLIC_KEY = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALhZs/7hP0g0+hrqTq0hFyGVxgco0NMxZD8nPS6ihxap0yNFjzdyUuZED6P4/aK9Ezl5ajEI9pcx5/1BrEE+F3kCAwEAAQ=="; private static String ALGORITHM = "RSA"; diff --git a/paystack/src/main/java/co/paystack/android/utils/Logger.java b/paystack/src/main/java/co/paystack/android/utils/Logger.java index 9941034..c62985e 100644 --- a/paystack/src/main/java/co/paystack/android/utils/Logger.java +++ b/paystack/src/main/java/co/paystack/android/utils/Logger.java @@ -1,15 +1,21 @@ package co.paystack.android.utils; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + import android.util.Log; +import kotlin.Deprecated; + /** * Logger util class * * @author {androidsupport@paystack.co} on 9/18/15. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class Logger { - public static boolean DEBUG_ON = false; + public static boolean DEBUG_ON = false; public static String DEFAULT_TAG = "Paystack"; public static void d(String tag, String message) { diff --git a/paystack/src/main/java/co/paystack/android/utils/StringUtils.java b/paystack/src/main/java/co/paystack/android/utils/StringUtils.java index 3d7bb95..ce7fc13 100644 --- a/paystack/src/main/java/co/paystack/android/utils/StringUtils.java +++ b/paystack/src/main/java/co/paystack/android/utils/StringUtils.java @@ -1,13 +1,18 @@ package co.paystack.android.utils; +import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; + import co.paystack.android.exceptions.CardException; import co.paystack.android.model.Card; +import kotlin.Deprecated; /** * String utility methods * * @author {androidsupport@paystack.co} on 9/13/15. + * @deprecated This SDK has been deprecated, Please refer to our new SDK: https://paystack.com/docs/developer-tools/android-sdk/ */ +@Deprecated(message = DEPRECATION_MESSAGE) public class StringUtils { public static final String CARD_CONCATENATOR = "*"; diff --git a/paystack/src/test/java/co/paystack/android/TransactionManagerTest.kt b/paystack/src/test/java/co/paystack/android/TransactionManagerTest.kt index 85ea895..91065d4 100644 --- a/paystack/src/test/java/co/paystack/android/TransactionManagerTest.kt +++ b/paystack/src/test/java/co/paystack/android/TransactionManagerTest.kt @@ -12,6 +12,7 @@ import co.paystack.android.model.Card import co.paystack.android.model.Charge import com.nhaarman.mockitokotlin2.any import com.nhaarman.mockitokotlin2.isA +import com.nhaarman.mockitokotlin2.times import com.nhaarman.mockitokotlin2.verify import com.nhaarman.mockitokotlin2.whenever import org.junit.Before @@ -62,7 +63,7 @@ class TransactionManagerTest { charge, mock(Paystack.TransactionCallback::class.java) ) - verify(paystackRepository).initializeTransaction(isA(), isA(), isA(), isA()) + verify(paystackRepository, times(0)).initializeTransaction(isA(), isA(), isA(), isA>()) } } }