-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass transaction reference and ID to callbacks for exception reporting
- Loading branch information
1 parent
25a2335
commit 256953d
Showing
22 changed files
with
118 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package co.paystack.android | ||
|
||
const val DEPRECATION_MESSAGE = | ||
"This SDK has been deprecated, Please refer to our new SDK: https://github.com/PaystackHQ/paystack-sdk-android" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
package co.paystack.android; | ||
|
||
import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; | ||
|
||
import android.app.Activity; | ||
|
||
import co.paystack.android.exceptions.AuthenticationException; | ||
import co.paystack.android.exceptions.PaystackSdkNotInitializedException; | ||
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 | ||
|
@@ -16,6 +19,7 @@ | |
* | ||
* @author {[email protected]} on 9/16/15. | ||
*/ | ||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
public class Paystack extends PaystackModel { | ||
|
||
private String publicKey; | ||
|
@@ -53,6 +57,7 @@ private void validatePublicKey(String publicKey) throws AuthenticationException | |
|
||
} | ||
|
||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
void chargeCard(Activity activity, Charge charge, TransactionCallback transactionCallback) { | ||
chargeCard(activity, charge, publicKey, transactionCallback); | ||
} | ||
|
@@ -79,11 +84,19 @@ private void chargeCard(Activity activity, Charge charge, String publicKey, Tran | |
private interface BaseCallback { | ||
} | ||
|
||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
public interface TransactionCallback extends BaseCallback { | ||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
void onSuccess(Transaction transaction); | ||
|
||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
void beforeValidate(Transaction transaction); | ||
|
||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
void showLoading(Boolean isProcessing); | ||
|
||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
void onError(Throwable error, Transaction transaction); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
paystack/src/main/java/co/paystack/android/api/ChargeApiCallback.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
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(message = DEPRECATION_MESSAGE) | ||
interface ChargeApiCallback { | ||
fun onSuccess(params: ChargeParams, response: ChargeResponse) | ||
|
||
fun onError(exception: Throwable, reference: String?) | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
paystack/src/main/java/co/paystack/android/exceptions/AuthenticationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
package co.paystack.android.exceptions; | ||
|
||
import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; | ||
|
||
import kotlin.Deprecated; | ||
|
||
/** | ||
* @author {[email protected]} on 9/16/15. | ||
*/ | ||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
public class AuthenticationException extends PaystackException { | ||
public AuthenticationException(String message) { | ||
super(message); | ||
|
5 changes: 5 additions & 0 deletions
5
paystack/src/main/java/co/paystack/android/exceptions/CardException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
package co.paystack.android.exceptions; | ||
|
||
import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; | ||
|
||
import kotlin.Deprecated; | ||
|
||
/** | ||
* @author {[email protected]} on 9/13/15. | ||
*/ | ||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
public class CardException extends PaystackException { | ||
|
||
public CardException(String message) { | ||
|
5 changes: 5 additions & 0 deletions
5
paystack/src/main/java/co/paystack/android/exceptions/ChargeException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
package co.paystack.android.exceptions; | ||
|
||
import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; | ||
|
||
import kotlin.Deprecated; | ||
|
||
/** | ||
* @author {[email protected]} on 9/25/15. | ||
*/ | ||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
public class ChargeException extends PaystackException { | ||
public ChargeException(String message) { | ||
super(message); | ||
|
5 changes: 5 additions & 0 deletions
5
paystack/src/main/java/co/paystack/android/exceptions/ExpiredAccessCodeException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
package co.paystack.android.exceptions; | ||
|
||
import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; | ||
|
||
import kotlin.Deprecated; | ||
|
||
/** | ||
* @author {[email protected]} on 9/25/15. | ||
*/ | ||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
public class ExpiredAccessCodeException extends PaystackException { | ||
public ExpiredAccessCodeException(String message) { | ||
super(message); | ||
|
5 changes: 5 additions & 0 deletions
5
paystack/src/main/java/co/paystack/android/exceptions/InvalidAmountException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
paystack/src/main/java/co/paystack/android/exceptions/InvalidEmailException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
paystack/src/main/java/co/paystack/android/exceptions/PaystackActivityNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
package co.paystack.android.exceptions; | ||
|
||
import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; | ||
|
||
import kotlin.Deprecated; | ||
|
||
/** | ||
* @author {[email protected]} on 9/22/15. | ||
*/ | ||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
public class PaystackActivityNotFoundException extends PaystackException { | ||
public PaystackActivityNotFoundException(String message) { | ||
super(message); | ||
|
5 changes: 5 additions & 0 deletions
5
paystack/src/main/java/co/paystack/android/exceptions/PaystackException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
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 {[email protected]} on 9/13/15. | ||
*/ | ||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
public class PaystackException extends RuntimeException implements Serializable { | ||
|
||
public PaystackException(String message) { | ||
|
5 changes: 5 additions & 0 deletions
5
...tack/src/main/java/co/paystack/android/exceptions/PaystackSdkNotInitializedException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
package co.paystack.android.exceptions; | ||
|
||
import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; | ||
|
||
import kotlin.Deprecated; | ||
|
||
/** | ||
* @author {[email protected]} on 9/22/15. | ||
*/ | ||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
public class PaystackSdkNotInitializedException extends PaystackException { | ||
public PaystackSdkNotInitializedException(String message) { | ||
super(message); | ||
|
5 changes: 5 additions & 0 deletions
5
paystack/src/main/java/co/paystack/android/exceptions/ProcessingException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
package co.paystack.android.exceptions; | ||
|
||
import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; | ||
|
||
import kotlin.Deprecated; | ||
|
||
/** | ||
* @author {[email protected]} on 9/25/15. | ||
*/ | ||
@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."); | ||
|
5 changes: 5 additions & 0 deletions
5
paystack/src/main/java/co/paystack/android/exceptions/TokenException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
package co.paystack.android.exceptions; | ||
|
||
import static co.paystack.android.ConstantsKt.DEPRECATION_MESSAGE; | ||
|
||
import kotlin.Deprecated; | ||
|
||
/** | ||
* @author {[email protected]} on 9/20/15. | ||
*/ | ||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
public class TokenException extends PaystackException { | ||
public TokenException(String message) { | ||
super(message); | ||
|
5 changes: 5 additions & 0 deletions
5
paystack/src/main/java/co/paystack/android/exceptions/ValidateException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
paystack/src/main/java/co/paystack/android/utils/CardUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
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 {[email protected]} on 9/13/15. | ||
*/ | ||
@Deprecated(message = DEPRECATION_MESSAGE) | ||
public class CardUtils { | ||
|
||
public static boolean isWholePositiveNumber(String value) { | ||
public static boolean isWholePositiveNumber(String value) { | ||
if (value == null) { | ||
return false; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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,15 @@ | |
import javax.crypto.Cipher; | ||
|
||
import co.paystack.android.exceptions.AuthenticationException; | ||
import kotlin.Deprecated; | ||
|
||
|
||
/** | ||
* Class for encrypting the card details, for token creation. | ||
* | ||
* @author {[email protected]} on 8/10/15. | ||
*/ | ||
@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"; | ||
|
Oops, something went wrong.