Skip to content

Commit

Permalink
Make deprecation warning a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
amk-stripe committed Oct 10, 2024
1 parent 9f1ea45 commit 29f05dc
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.stripe.android

internal const val BASIC_INTEGRATION_DEPRECATION_WARNING = "Please use Mobile Payment Element instead. If you " +
"already using Basic Integration, learn how to migrate here:" +
" https://docs.stripe.com/payments/mobile/migrating-to-mobile-payment-element-from-basic-integration"
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ import kotlin.coroutines.CoroutineContext
*
* See [Creating ephemeral keys](https://stripe.com/docs/mobile/android/standard#creating-ephemeral-keys)
*/
@Deprecated(
"Please use Mobile Payment Element instead. If you already using CustomerSession, learn how to migrate" +
" here: https://docs.stripe.com/payments/mobile/migrating-to-mobile-payment-element-from-basic-integration"
)
@Deprecated(BASIC_INTEGRATION_DEPRECATION_WARNING)
class CustomerSession @VisibleForTesting internal constructor(
stripeRepository: StripeRepository,
publishableKey: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ import kotlinx.coroutines.launch
* selected a payment method, [PaymentSessionData.paymentMethod] will be updated with the
* payment method and [PaymentSessionListener.onPaymentSessionDataChanged] will be called.
*/
@Deprecated(
"Please use Mobile Payment Element instead. If you already using PaymentSession, learn how to migrate here:" +
" https://docs.stripe.com/payments/mobile/migrating-to-mobile-payment-element-from-basic-integration"
)
@Deprecated(BASIC_INTEGRATION_DEPRECATION_WARNING)
class PaymentSession @VisibleForTesting internal constructor(
private val context: Context,
viewModelStoreOwner: ViewModelStoreOwner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.annotation.StringRes
import androidx.core.text.util.LinkifyCompat
import androidx.core.view.ViewCompat
import androidx.lifecycle.lifecycleScope
import com.stripe.android.BASIC_INTEGRATION_DEPRECATION_WARNING
import com.stripe.android.CustomerSession
import com.stripe.android.PaymentConfiguration
import com.stripe.android.R
Expand All @@ -32,11 +33,7 @@ import kotlinx.coroutines.launch
*
* Should be started with [AddPaymentMethodActivityStarter].
*/
@Deprecated(
"Please use Mobile Payment Element instead. If you already using AddPaymentMethodActivity, learn how to" +
" migrate here: " +
"https://docs.stripe.com/payments/mobile/migrating-to-mobile-payment-element-from-basic-integration"
)
@Deprecated(BASIC_INTEGRATION_DEPRECATION_WARNING)
class AddPaymentMethodActivity : StripeActivity() {

private val args: AddPaymentMethodActivityStarter.Args by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.activity.addCallback
import androidx.activity.viewModels
import androidx.lifecycle.lifecycleScope
import androidx.viewpager.widget.ViewPager
import com.stripe.android.BASIC_INTEGRATION_DEPRECATION_WARNING
import com.stripe.android.CustomerSession
import com.stripe.android.PaymentSession.Companion.EXTRA_PAYMENT_SESSION_DATA
import com.stripe.android.PaymentSessionConfig
Expand All @@ -23,11 +24,7 @@ import kotlinx.coroutines.launch
* Activity containing a two-part payment flow that allows users to provide a shipping address
* as well as select a shipping method.
*/
@Deprecated(
"Please use Mobile Payment Element instead. If you already using PaymentFlowActivity, learn how to" +
" migrate here:" +
" https://docs.stripe.com/payments/mobile/migrating-to-mobile-payment-element-from-basic-integration"
)
@Deprecated(BASIC_INTEGRATION_DEPRECATION_WARNING)
class PaymentFlowActivity : StripeActivity() {

private val viewBinding: StripePaymentFlowActivityBinding by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.core.view.ViewCompat
import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import com.google.android.material.snackbar.Snackbar
import com.stripe.android.BASIC_INTEGRATION_DEPRECATION_WARNING
import com.stripe.android.CustomerSession
import com.stripe.android.R
import com.stripe.android.core.exception.StripeException
Expand All @@ -38,11 +39,7 @@ import kotlinx.coroutines.launch
* Use [PaymentMethodsActivityStarter.Result.fromIntent]
* to retrieve the result of this activity from an intent in onActivityResult().
*/
@Deprecated(
"Please use Mobile Payment Element instead. If you already using PaymentMethodsActivity, learn how to" +
" migrate here:" +
" https://docs.stripe.com/payments/mobile/migrating-to-mobile-payment-element-from-basic-integration"
)
@Deprecated(BASIC_INTEGRATION_DEPRECATION_WARNING)
class PaymentMethodsActivity : AppCompatActivity() {
internal val viewBinding: StripePaymentMethodsActivityBinding by lazy {
StripePaymentMethodsActivityBinding.inflate(layoutInflater)
Expand Down

0 comments on commit 29f05dc

Please sign in to comment.