Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove @Deprecated methods from StripeIntent models #1481

Merged
merged 2 commits into from
Sep 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions stripe/src/main/java/com/stripe/android/SourceCallback.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@
public abstract class StripeIntentResult<T extends StripeIntent> {
@NonNull private final T mStripeIntent;
@Outcome private final int mOutcome;
@Status private final int mStatus;

StripeIntentResult(@NonNull T stripeIntent, @Status int outcome) {
StripeIntentResult(@NonNull T stripeIntent, @Outcome int outcome) {
mStripeIntent = stripeIntent;
mOutcome = determineOutcome(Objects.requireNonNull(stripeIntent.getStatus()), outcome);
mStatus = mOutcome;
}

@StripeIntentResult.Outcome
Expand Down Expand Up @@ -69,15 +67,6 @@ public final int getOutcome() {
return mOutcome;
}

/**
* @deprecated use {@link #getOutcome()}
*/
@Deprecated
@Status
public final int getStatus() {
return mStatus;
}

@Override
public final boolean equals(@Nullable Object obj) {
return this == obj || (obj instanceof StripeIntentResult &&
Expand Down Expand Up @@ -123,34 +112,4 @@ public final int hashCode() {
*/
int TIMEDOUT = 4;
}

/**
* @deprecated use {@link Outcome}
*/
@Retention(RetentionPolicy.SOURCE)
@IntDef({Status.UNKNOWN, Status.SUCCEEDED, Status.FAILED, Status.CANCELED, Status.TIMEDOUT})
@Deprecated
public @interface Status {
int UNKNOWN = 0;

/**
* Confirmation or payment authentication succeeded
*/
int SUCCEEDED = 1;

/**
* Confirm or payment authentication failed
*/
int FAILED = 2;

/**
* Payment authentication was canceled by the user
*/
int CANCELED = 3;

/**
* Payment authentication timed-out
*/
int TIMEDOUT = 4;
}
}
13 changes: 0 additions & 13 deletions stripe/src/main/java/com/stripe/android/TokenCallback.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public final class PaymentIntent extends StripeModel implements StripeIntent {
private static final String FIELD_PAYMENT_METHOD_ID = "payment_method_id";
private static final String FIELD_PAYMENT_METHOD_TYPES = "payment_method_types";
private static final String FIELD_RECEIPT_EMAIL = "receipt_email";
private static final String FIELD_SOURCE = "source";
private static final String FIELD_STATUS = "status";
private static final String FIELD_SETUP_FUTURE_USAGE = "setup_future_usage";

Expand All @@ -71,7 +70,6 @@ public final class PaymentIntent extends StripeModel implements StripeIntent {
@Nullable private final NextActionType mNextActionType;
@Nullable private final String mPaymentMethodId;
@Nullable private final String mReceiptEmail;
@Nullable private final String mSource;
@Nullable private final Status mStatus;
@Nullable private final Usage mSetupFutureUsage;
@Nullable private final Error mLastPaymentError;
Expand Down Expand Up @@ -290,15 +288,6 @@ public String getReceiptEmail() {
return mReceiptEmail;
}

/**
* @deprecated use {@link #getPaymentMethodId()}
*/
@Deprecated
@Nullable
public String getSource() {
return mSource;
}

/**
* @return Status of this PaymentIntent.
*/
Expand Down Expand Up @@ -332,7 +321,6 @@ private PaymentIntent(
@Nullable Map<String, Object> nextAction,
@Nullable String paymentMethodId,
@Nullable String receiptEmail,
@Nullable String source,
@Nullable Status status,
@Nullable Usage setupFutureUsage,
@Nullable Error lastPaymentError) {
Expand All @@ -352,7 +340,6 @@ private PaymentIntent(
mNextAction = nextAction;
mPaymentMethodId = paymentMethodId;
mReceiptEmail = receiptEmail;
mSource = source;
mStatus = status;
mSetupFutureUsage = setupFutureUsage;
mNextActionType = mNextAction != null ?
Expand Down Expand Up @@ -402,7 +389,6 @@ public static PaymentIntent fromJson(@Nullable JSONObject jsonObject) {
final Usage setupFutureUsage =
Usage.fromCode(optString(jsonObject, FIELD_SETUP_FUTURE_USAGE));
final Map<String, Object> nextAction = optMap(jsonObject, FIELD_NEXT_ACTION);
final String source = optString(jsonObject, FIELD_SOURCE);
final Error lastPaymentError =
Error.fromJson(jsonObject.optJSONObject(FIELD_LAST_PAYMENT_ERROR));

Expand All @@ -423,7 +409,6 @@ public static PaymentIntent fromJson(@Nullable JSONObject jsonObject) {
nextAction,
paymentMethodId,
receiptEmail,
source,
status,
setupFutureUsage,
lastPaymentError
Expand All @@ -450,7 +435,6 @@ private boolean typedEquals(@NonNull PaymentIntent paymentIntent) {
&& ObjectUtils.equals(mLiveMode, paymentIntent.mLiveMode)
&& ObjectUtils.equals(mPaymentMethodId, paymentIntent.mPaymentMethodId)
&& ObjectUtils.equals(mReceiptEmail, paymentIntent.mReceiptEmail)
&& ObjectUtils.equals(mSource, paymentIntent.mSource)
&& ObjectUtils.equals(mStatus, paymentIntent.mStatus)
&& ObjectUtils.equals(mSetupFutureUsage, paymentIntent.mSetupFutureUsage)
&& ObjectUtils.equals(mPaymentMethodTypes, paymentIntent.mPaymentMethodTypes)
Expand All @@ -463,7 +447,7 @@ private boolean typedEquals(@NonNull PaymentIntent paymentIntent) {
public int hashCode() {
return ObjectUtils.hash(mId, mObjectType, mAmount, mCanceledAt, mCancellationReason,
mCaptureMethod, mClientSecret, mConfirmationMethod, mCreated, mCurrency,
mDescription, mLiveMode, mReceiptEmail, mSource, mStatus, mPaymentMethodTypes,
mDescription, mLiveMode, mReceiptEmail, mStatus, mPaymentMethodTypes,
mNextAction, mNextActionType, mPaymentMethodId, mSetupFutureUsage,
mLastPaymentError);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,6 @@ public long getCreated() {
return mCreated;
}

/**
* @deprecated this field is only available with a secret key
*/
@Deprecated
@Nullable
public String getCustomerId() {
return null;
}

/**
* @return An arbitrary string attached to the object. Often useful for displaying to users.
*/
Expand Down