-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
kind:improvementtriagedIssue has been reviewed by Stripe and is being tracked internallyIssue has been reviewed by Stripe and is being tracked internally
Description
Is your feature request related to a problem? Please describe.
Our app supports multiple regions, and each region requires a different Stripe publishableKey.
To support this, we need to configure STPAPIClient dynamically at runtime.
In the case of Apple Pay, we’re able to set STPApplePayContext.apiClient after initialization.
let context = STPApplePayContext(
paymentRequest: paymentRequest,
delegate: delegate
)
context?.apiClient = STPAPIClient(publishableKey: publishableKey)However, during the confirm setup intent flow, we need to inject a new STPAPIClient with a different publishableKey into STPPaymentHandler.
The problem is that STPPaymentHandler does not expose a public initializer, so we can’t pass in a custom API client.
We’re using @_spi(STP) import Stripe to access the internal initializer, which works — but is it OK to use in production for now?
Describe the solution you'd like
We’d like the initializer for STPPaymentHandler that accepts a custom STPAPIClient to be made public
Describe alternatives you've considered
- Relying on @_spi(STP) access
- Mutating
STPPaymentHandler.shared().apiClient, which is unsafe in concurrent scenarios.
Metadata
Metadata
Assignees
Labels
kind:improvementtriagedIssue has been reviewed by Stripe and is being tracked internallyIssue has been reviewed by Stripe and is being tracked internally