Skip to content

Commit

Permalink
Use CustomerSession.stripeAccountId in AddPaymentMethodActivity (#2542)
Browse files Browse the repository at this point in the history
This property must be used to correctly create a PaymentMethod as the
connected account, when specified.

MOBILE-266
  • Loading branch information
mshafrir-stripe authored Jun 4, 2020
1 parent 2ed227f commit 53bb8c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stripe/src/main/java/com/stripe/android/CustomerSession.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CustomerSession @VisibleForTesting internal constructor(
context: Context,
stripeRepository: StripeRepository,
publishableKey: String,
stripeAccountId: String?,
internal val stripeAccountId: String?,
private val workDispatcher: CoroutineDispatcher = createCoroutineDispatcher(),
private val operationIdFactory: OperationIdFactory = StripeOperationIdFactory(),
private val timeSupplier: TimeSupplier = { Calendar.getInstance().timeInMillis },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ class AddPaymentMethodActivity : StripeActivity() {
private val stripe: Stripe by lazy {
val paymentConfiguration = args.paymentConfiguration
?: PaymentConfiguration.getInstance(this)
Stripe(applicationContext, paymentConfiguration.publishableKey)
Stripe(
applicationContext,
publishableKey = paymentConfiguration.publishableKey,
stripeAccountId = customerSession.stripeAccountId
)
}

private val paymentMethodType: PaymentMethod.Type by lazy {
Expand Down

0 comments on commit 53bb8c0

Please sign in to comment.