StripeApiRepository

An implementation of StripeRepository that makes network requests to the Stripe API.

Constructors

Link copied to clipboard
@Inject
fun StripeApiRepository(appContext: Context, @Named(value = "publishableKey") publishableKeyProvider: () -> String, workContext: CoroutineContext, @Named(value = "productUsage") productUsageTokens: Set<String>, paymentAnalyticsRequestFactory: PaymentAnalyticsRequestFactory, analyticsRequestExecutor: AnalyticsRequestExecutor, logger: Logger)

Functions

open suspend override fun attachFinancialConnectionsSessionToPaymentIntent(clientSecret: String, paymentIntentId: String, financialConnectionsSessionId: String, requestOptions: ApiRequest.Options, expandFields: List<String>): PaymentIntent?

Attaches the Link Account Session to the Payment Intent

open suspend override fun attachFinancialConnectionsSessionToSetupIntent(clientSecret: String, setupIntentId: String, financialConnectionsSessionId: String, requestOptions: ApiRequest.Options, expandFields: List<String>): SetupIntent?

Attaches the Link Account Session to the Setup Intent

Link copied to clipboard
open suspend override fun attachPaymentMethod(customerId: String, publishableKey: String, productUsageTokens: Set<String>, paymentMethodId: String, requestOptions: ApiRequest.Options): PaymentMethod?
Link copied to clipboard
open suspend override fun confirmConsumerVerification(consumerSessionClientSecret: String, verificationCode: String, authSessionCookie: String?, requestOptions: ApiRequest.Options): ConsumerSession?

Confirms an SMS verification for the consumer corresponding to the given client secret.

Link copied to clipboard
open suspend override fun consumerSignUp(email: String, phoneNumber: String, country: String, name: String?, locale: Locale?, authSessionCookie: String?, consentAction: ConsumerSignUpConsentAction, requestOptions: ApiRequest.Options): ConsumerSession?

Creates a new Link account for the credentials provided.

Link copied to clipboard
open suspend override fun createLinkFinancialConnectionsSession(consumerSessionClientSecret: String, requestOptions: ApiRequest.Options): FinancialConnectionsSession?
Link copied to clipboard
open suspend override fun createPaymentDetails(consumerSessionClientSecret: String, paymentDetailsCreateParams: ConsumerPaymentDetailsCreateParams, requestOptions: ApiRequest.Options): ConsumerPaymentDetails?
open suspend override fun createPaymentDetails(consumerSessionClientSecret: String, financialConnectionsAccountId: String, requestOptions: ApiRequest.Options): ConsumerPaymentDetails?
Link copied to clipboard
open suspend override fun createPaymentMethod(paymentMethodCreateParams: PaymentMethodCreateParams, options: ApiRequest.Options): PaymentMethod?
Link copied to clipboard
open suspend override fun deletePaymentDetails(consumerSessionClientSecret: String, paymentDetailsId: String, requestOptions: ApiRequest.Options)

Deletes the consumer payment details with the given id.

Link copied to clipboard
open suspend override fun detachPaymentMethod(publishableKey: String, productUsageTokens: Set<String>, paymentMethodId: String, requestOptions: ApiRequest.Options): PaymentMethod?
Link copied to clipboard
open suspend override fun getPaymentMethods(listPaymentMethodsParams: ListPaymentMethodsParams, publishableKey: String, productUsageTokens: Set<String>, requestOptions: ApiRequest.Options): List<PaymentMethod>

Retrieve a Customer's PaymentMethods

Link copied to clipboard
open suspend override fun listPaymentDetails(consumerSessionClientSecret: String, paymentMethodTypes: Set<String>, requestOptions: ApiRequest.Options): ConsumerPaymentDetails?

Fetches the saved payment methods for the given customer.

Link copied to clipboard
open suspend override fun logoutConsumer(consumerSessionClientSecret: String, authSessionCookie: String?, requestOptions: ApiRequest.Options): ConsumerSession?

Logs out the consumer and invalidates the cookie.

Link copied to clipboard
open suspend override fun lookupConsumerSession(email: String?, authSessionCookie: String?, requestOptions: ApiRequest.Options): ConsumerSessionLookup?

Retrieves the ConsumerSession if the given email is associated with a Link account.

Link copied to clipboard
open suspend override fun retrieveCustomer(customerId: String, productUsageTokens: Set<String>, requestOptions: ApiRequest.Options): Customer?
Link copied to clipboard
open suspend override fun retrievePaymentIntent(clientSecret: String, options: ApiRequest.Options, expandFields: List<String>): PaymentIntent?

Retrieve a PaymentIntent using its client_secret

open suspend override fun retrievePaymentIntentWithOrderedPaymentMethods(clientSecret: String, options: ApiRequest.Options, locale: Locale): PaymentMethodPreference?

Retrieve a PaymentIntent using its client_secret, with the accepted payment method types ordered according to the locale provided.

Link copied to clipboard
open suspend override fun retrievePaymentMethodMessage(paymentMethods: List<String>, amount: Int, currency: String, country: String, locale: String, logoColor: String, requestOptions: ApiRequest.Options): PaymentMethodMessage?
Link copied to clipboard
open suspend override fun retrieveSetupIntent(clientSecret: String, options: ApiRequest.Options, expandFields: List<String>): SetupIntent?

Retrieve a SetupIntent using its client_secret

open suspend override fun retrieveSetupIntentWithOrderedPaymentMethods(clientSecret: String, options: ApiRequest.Options, locale: Locale): PaymentMethodPreference?

Retrieve a SetupIntent using its client_secret, with the accepted payment method types ordered according to the locale provided.

Link copied to clipboard
open suspend override fun startConsumerVerification(consumerSessionClientSecret: String, locale: Locale, authSessionCookie: String?, requestOptions: ApiRequest.Options): ConsumerSession?

Triggers an SMS verification for the consumer corresponding to the given client secret.

Link copied to clipboard
open suspend override fun updatePaymentDetails(consumerSessionClientSecret: String, paymentDetailsUpdateParams: ConsumerPaymentDetailsUpdateParams, requestOptions: ApiRequest.Options): ConsumerPaymentDetails?

Updates the consumer payment details with the given id.

Link copied to clipboard
open suspend override fun verifyPaymentIntentWithMicrodeposits(clientSecret: String, descriptorCode: String, requestOptions: ApiRequest.Options): PaymentIntent?

Verifies the PaymentIntent with microdeposits descriptor code

open suspend override fun verifyPaymentIntentWithMicrodeposits(clientSecret: String, firstAmount: Int, secondAmount: Int, requestOptions: ApiRequest.Options): PaymentIntent?

Verifies the PaymentIntent with microdeposits amounts

Link copied to clipboard
open suspend override fun verifySetupIntentWithMicrodeposits(clientSecret: String, descriptorCode: String, requestOptions: ApiRequest.Options): SetupIntent?

Verifies the SetupIntent with microdeposits descriptor code

open suspend override fun verifySetupIntentWithMicrodeposits(clientSecret: String, firstAmount: Int, secondAmount: Int, requestOptions: ApiRequest.Options): SetupIntent?

Verifies the SetupIntent with microdeposits amounts