Skip to content

Commit

Permalink
Add Fragment support to AddPaymentMethodActivityStarter (#2315)
Browse files Browse the repository at this point in the history
Fixes #2311
  • Loading branch information
mshafrir-stripe authored Mar 24, 2020
1 parent 60ede4d commit 2cd60c0
Showing 1 changed file with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.app.Activity
import android.content.Intent
import android.os.Bundle
import androidx.annotation.LayoutRes
import androidx.fragment.app.Fragment
import com.stripe.android.ObjectBuilder
import com.stripe.android.PaymentConfiguration
import com.stripe.android.model.PaymentMethod
Expand All @@ -18,14 +19,22 @@ import kotlinx.android.parcel.Parcelize
*
* The result will be returned with request code [REQUEST_CODE].
*/
class AddPaymentMethodActivityStarter constructor(
activity: Activity
) : ActivityStarter<AddPaymentMethodActivity, Args>(
activity,
AddPaymentMethodActivity::class.java,
Args.DEFAULT,
REQUEST_CODE
) {
class AddPaymentMethodActivityStarter : ActivityStarter<AddPaymentMethodActivity, Args> {

constructor(activity: Activity) : super(
activity,
AddPaymentMethodActivity::class.java,
Args.DEFAULT,
REQUEST_CODE
)

constructor(fragment: Fragment) : super(
fragment,
AddPaymentMethodActivity::class.java,
Args.DEFAULT,
REQUEST_CODE
)

@Parcelize
data class Args internal constructor(
internal val billingAddressFields: BillingAddressFields,
Expand Down

0 comments on commit 2cd60c0

Please sign in to comment.