Skip to content

stripe-android v13.0.0

Compare
Choose a tag to compare
@mshafrir-stripe mshafrir-stripe released this 13 Jan 18:54
· 5873 commits to master since this release

This release includes several breaking changes.
See the migration guide for more details.

  • #1950 Add idempotency key for Stripe API POST methods
    class MyActivity : AppCompatActivity() {
    
       private fun createPaymentMethod(
           params: PaymentMethodCreateParams,
           idempotencyKey: String?
       ) {
           stripe.createPaymentMethod(
               params = params,
               idempotencyKey = idempotencyKey,
               callback = object : ApiResultCallback<PaymentMethod> {
                   override fun onSuccess(result: PaymentMethod) {
                   }
    
                   override fun onError(e: Exception) {
                   }
               }
           )
       }
    }
  • #1993 Remove deprecated methods from PaymentSession
  • #1994 Enable postal code field in CardInputWidget by default
  • #1995 Enable Google Pay option in Basic Integration and Stripe Activities
    • PaymentSession

      PaymentSessionConfig.Builder()
          // other settings
          .setShouldShowGooglePay(true)
          .build()
    • PaymentMethodsActivity

      PaymentMethodsActivityStarter.Args.Builder()
          // other settings
          .setShouldShowGooglePay(true)
          .build()
  • #1996 Update postal code logic for CardMultilineWidget
    • Default to showing postal code (i.e. shouldShowPostalCode = true)
    • Postal code is now optional when displayed
    • Remove validation on postal code field
    • Change postal code field hint text to "Postal Code"
    • Remove CardInputListener.onPostalCodeComplete()
  • #1998 Use CardBrand enum to represent card brands
    • Change the type of Card#brand and SourceCardData#brand properties from String? to CardBrand
    • Remove Card.CardBrand
  • #1999 Remove deprecated BroadcastReceiver logic from PaymentFlowActivity
  • #2000 Pass PaymentSessionConfig instance to PaymentSession constructor
  • #2002 Fix regression in CardInputWidget styling
    To customize the individual EditText fields of CardInputWidget, define a Stripe.CardInputWidget.EditText style
    that extends Stripe.Base.CardInputWidget.EditText. For example,
    <style name="Stripe.CardInputWidget.EditText" parent="Stripe.Base.CardInputWidget.EditText">
        <item name="android:textSize">22sp</item>
        <item name="android:textColor">@android:color/holo_blue_light</item>
        <item name="android:textColorHint">@android:color/holo_orange_light</item>
    </style>
  • #2003 Add support for authenticating a Source via in-app WebView
    class MyActivity : AppCompatActivity() {
        private fun authenticateSource(source: Source) {
            stripe.authenticateSource(this, source)
        }
    
        override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
            super.onActivityResult(requestCode, resultCode, data)
    
            if (data != null && stripe.isAuthenticateSourceResult(requestCode, data)) {
                stripe.onAuthenticateSourceResult(
                    data,
                    object : ApiResultCallback<Source> {
                        override fun onSuccess(result: Source) {
                        }
    
                        override fun onError(e: Exception) {
                        }
                    }
                )
            }
        }
    }
  • #2006 Create TokenizationMethod enum
    • Change the type of Card#tokenizationMethod and SourceCardData#tokenizationMethod from String? to TokenizationMethod?
  • #2013 Populate shipping address country from pre-populated shipping info
  • #2015 Update PaymentSessionConfig's default BillingAddressFields to PostalCode
  • #2020 Change PaymentMethod.type from String? to PaymentMethod.Type?
  • #2028 Update SourceParams fields
    • Update setOwner() to take OwnerParams instead of Map
    • Remove setRedirect(), use setReturnUrl() instead
    • Update some setters to take null values, simplifying usage
    • Update comments
  • #2029 Update CardInputWidget to use TextInputLayout
    • Make StripeEditText extend TextInputEditText
  • #2038 Update CardInputWidget to focus on first error field when validating
  • #2039 Add support for creating a person token
    • Add Stripe#createPersonToken() and Stripe#createPersonTokenSynchronous()
  • #2040 Add support for CVC recollection in PaymentIntents
    • Update ConfirmPaymentIntentParams.createWithPaymentMethodId() with optional PaymentMethodOptionsParams? argument
  • #2042 Create AccountParams.BusinessTypeParams
    • BusinessTypeParams.Company and BusinessTypeParams.Individual model the parameters for creating a
      company or
      individual
      account token.
      Use these instead of creating raw maps representing the data.
    • AccountParams.createAccountParams() is now deprecated. Use the appropriate AccountParams.create() method.

See the changelog for more details.