From fa1416520f09b0be2eed47d2069def8d7051750e Mon Sep 17 00:00:00 2001 From: dmerino Date: Tue, 12 Feb 2019 10:15:46 -0800 Subject: [PATCH] Move PayPalLineItem class to PayPal module and update javadoc. --- .../src/main/java/com/braintreepayments/api/PayPal.java | 2 +- .../com/braintreepayments/api/models/PayPalRequest.java | 3 ++- .../com/braintreepayments/api/PayPalRequestUnitTest.java | 2 +- .../java/com/braintreepayments/api/PayPalUnitTest.java | 2 +- .../android/sdk/onetouch/core}/PayPalLineItem.java | 9 ++++++++- .../sdk/onetouch/core}/PayPalLineItemUnitTest.java | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) rename {Braintree/src/main/java/com/braintreepayments/api/models => PayPalOneTouch/src/main/java/com/paypal/android/sdk/onetouch/core}/PayPalLineItem.java (96%) rename {Braintree/src/test/java/com/braintreepayments/api/models => PayPalOneTouch/src/test/java/com/paypal/android/sdk/onetouch/core}/PayPalLineItemUnitTest.java (97%) diff --git a/Braintree/src/main/java/com/braintreepayments/api/PayPal.java b/Braintree/src/main/java/com/braintreepayments/api/PayPal.java index ededcc9776..d88ee9baa3 100644 --- a/Braintree/src/main/java/com/braintreepayments/api/PayPal.java +++ b/Braintree/src/main/java/com/braintreepayments/api/PayPal.java @@ -28,7 +28,7 @@ import com.braintreepayments.api.models.PayPalAccountBuilder; import com.braintreepayments.api.models.PayPalAccountNonce; import com.braintreepayments.api.models.PayPalConfiguration; -import com.braintreepayments.api.models.PayPalLineItem; +import com.paypal.android.sdk.onetouch.core.PayPalLineItem; import com.braintreepayments.api.models.PayPalPaymentResource; import com.braintreepayments.api.models.PayPalRequest; import com.braintreepayments.api.models.PaymentMethodNonce; diff --git a/Braintree/src/main/java/com/braintreepayments/api/models/PayPalRequest.java b/Braintree/src/main/java/com/braintreepayments/api/models/PayPalRequest.java index 01d58c47c1..feb0fee55f 100644 --- a/Braintree/src/main/java/com/braintreepayments/api/models/PayPalRequest.java +++ b/Braintree/src/main/java/com/braintreepayments/api/models/PayPalRequest.java @@ -4,11 +4,12 @@ import android.os.Parcelable; import androidx.annotation.StringDef; +import com.paypal.android.sdk.onetouch.core.PayPalLineItem; + import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.Collection; -import java.util.List; /** * Represents the parameters that are needed to start a Checkout with PayPal diff --git a/Braintree/src/test/java/com/braintreepayments/api/PayPalRequestUnitTest.java b/Braintree/src/test/java/com/braintreepayments/api/PayPalRequestUnitTest.java index 9c740df86f..1212e44e39 100644 --- a/Braintree/src/test/java/com/braintreepayments/api/PayPalRequestUnitTest.java +++ b/Braintree/src/test/java/com/braintreepayments/api/PayPalRequestUnitTest.java @@ -5,7 +5,7 @@ import com.braintreepayments.api.exceptions.InvalidArgumentException; import com.braintreepayments.api.models.Authorization; import com.braintreepayments.api.models.Configuration; -import com.braintreepayments.api.models.PayPalLineItem; +import com.paypal.android.sdk.onetouch.core.PayPalLineItem; import com.braintreepayments.api.models.PayPalRequest; import com.braintreepayments.api.models.PostalAddress; import com.paypal.android.sdk.onetouch.core.BillingAgreementRequest; diff --git a/Braintree/src/test/java/com/braintreepayments/api/PayPalUnitTest.java b/Braintree/src/test/java/com/braintreepayments/api/PayPalUnitTest.java index 80bd4e8412..3b704368c3 100644 --- a/Braintree/src/test/java/com/braintreepayments/api/PayPalUnitTest.java +++ b/Braintree/src/test/java/com/braintreepayments/api/PayPalUnitTest.java @@ -16,7 +16,7 @@ import com.braintreepayments.api.models.Configuration; import com.braintreepayments.api.models.PayPalAccountBuilder; import com.braintreepayments.api.models.PayPalAccountNonce; -import com.braintreepayments.api.models.PayPalLineItem; +import com.paypal.android.sdk.onetouch.core.PayPalLineItem; import com.braintreepayments.api.models.PayPalRequest; import com.braintreepayments.api.models.PaymentMethodBuilder; import com.braintreepayments.api.models.PaymentMethodNonce; diff --git a/Braintree/src/main/java/com/braintreepayments/api/models/PayPalLineItem.java b/PayPalOneTouch/src/main/java/com/paypal/android/sdk/onetouch/core/PayPalLineItem.java similarity index 96% rename from Braintree/src/main/java/com/braintreepayments/api/models/PayPalLineItem.java rename to PayPalOneTouch/src/main/java/com/paypal/android/sdk/onetouch/core/PayPalLineItem.java index df7317998a..afce041393 100644 --- a/Braintree/src/main/java/com/braintreepayments/api/models/PayPalLineItem.java +++ b/PayPalOneTouch/src/main/java/com/paypal/android/sdk/onetouch/core/PayPalLineItem.java @@ -1,4 +1,4 @@ -package com.braintreepayments.api.models; +package com.paypal.android.sdk.onetouch.core; import android.os.Parcel; import android.os.Parcelable; @@ -15,6 +15,13 @@ public class PayPalLineItem implements Parcelable { @Retention(RetentionPolicy.SOURCE) @StringDef({PayPalLineItem.KIND_CREDIT, PayPalLineItem.KIND_DEBIT}) + + /** + * The type of PayPal line item. + * + * {@link #KIND_CREDIT} A line item that is a credit. + * {@link #KIND_DEBIT} A line item that debits. + */ @interface PayPalLineItemKind {} public static final String KIND_CREDIT = "credit"; public static final String KIND_DEBIT = "debit"; diff --git a/Braintree/src/test/java/com/braintreepayments/api/models/PayPalLineItemUnitTest.java b/PayPalOneTouch/src/test/java/com/paypal/android/sdk/onetouch/core/PayPalLineItemUnitTest.java similarity index 97% rename from Braintree/src/test/java/com/braintreepayments/api/models/PayPalLineItemUnitTest.java rename to PayPalOneTouch/src/test/java/com/paypal/android/sdk/onetouch/core/PayPalLineItemUnitTest.java index 089579d69a..d6c59143fe 100644 --- a/Braintree/src/test/java/com/braintreepayments/api/models/PayPalLineItemUnitTest.java +++ b/PayPalOneTouch/src/test/java/com/paypal/android/sdk/onetouch/core/PayPalLineItemUnitTest.java @@ -1,4 +1,4 @@ -package com.braintreepayments.api.models; +package com.paypal.android.sdk.onetouch.core; import android.os.Parcel;