StripeApiRepository

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

Constructors

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

Functions

Link copied to clipboard
open suspend override fun addCustomerSource(customerId: String, publishableKey: String, productUsageTokens: Set<String>, sourceId: String, sourceType: String, requestOptions: ApiRequest.Options): Result<Source>
open suspend override fun attachFinancialConnectionsSessionToPaymentIntent(clientSecret: String, paymentIntentId: String, financialConnectionsSessionId: String, requestOptions: ApiRequest.Options, expandFields: List<String>): Result<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>): Result<SetupIntent>

Attaches the Link Account Session to the Setup Intent

Link copied to clipboard
open suspend override fun attachHCaptchaToRadarSession(radarSessionToken: String, hcaptchaToken: String, hcaptchaEKey: String?, requestOptions: ApiRequest.Options): Result<RadarSessionWithHCaptcha>
Link copied to clipboard
open suspend override fun attachPaymentMethod(customerId: String, productUsageTokens: Set<String>, paymentMethodId: String, requestOptions: ApiRequest.Options): Result<PaymentMethod>
Link copied to clipboard
open override fun buildPaymentUserAgent(attribution: Set<String>): String
Link copied to clipboard
open suspend override fun cancelPaymentIntentSource(paymentIntentId: String, sourceId: String, options: ApiRequest.Options): Result<PaymentIntent>
Link copied to clipboard
open suspend override fun cancelSetupIntentSource(setupIntentId: String, sourceId: String, options: ApiRequest.Options): Result<SetupIntent>
Link copied to clipboard
open suspend override fun complete3ds2Auth(sourceId: String, requestOptions: ApiRequest.Options): Result<Stripe3ds2AuthResult>
Link copied to clipboard
open suspend override fun confirmPaymentIntent(confirmPaymentIntentParams: ConfirmPaymentIntentParams, options: ApiRequest.Options, expandFields: List<String>): Result<PaymentIntent>

Confirm a PaymentIntent using the provided ConfirmPaymentIntentParams

Link copied to clipboard
open suspend override fun confirmSetupIntent(confirmSetupIntentParams: ConfirmSetupIntentParams, options: ApiRequest.Options, expandFields: List<String>): Result<SetupIntent>

Confirm a SetupIntent using the provided ConfirmSetupIntentParams

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): Result<ConsumerSession>

Creates a new Link account for the credentials provided.

Link copied to clipboard
open suspend override fun createFile(fileParams: StripeFileParams, requestOptions: ApiRequest.Options): Result<StripeFile>
Link copied to clipboard
open suspend override fun createPaymentDetails(consumerSessionClientSecret: String, paymentDetailsCreateParams: ConsumerPaymentDetailsCreateParams, requestOptions: ApiRequest.Options, active: Boolean): Result<ConsumerPaymentDetails>
Link copied to clipboard
open suspend override fun createPaymentMethod(paymentMethodCreateParams: PaymentMethodCreateParams, options: ApiRequest.Options): Result<PaymentMethod>
Link copied to clipboard
open suspend override fun createRadarSession(requestOptions: ApiRequest.Options): Result<RadarSessionWithHCaptcha>

Get the latest FraudDetectionData from FraudDetectionDataRepository and send in POST request to /v1/radar/session.

Link copied to clipboard
open suspend override fun createSource(sourceParams: SourceParams, options: ApiRequest.Options): Result<Source>

Create a Source using the input SourceParams.

Link copied to clipboard
open suspend override fun createToken(tokenParams: TokenParams, options: ApiRequest.Options): Result<Token>

Create a Token using the input token parameters.

Link copied to clipboard
open suspend override fun deleteCustomerSource(customerId: String, publishableKey: String, productUsageTokens: Set<String>, sourceId: String, requestOptions: ApiRequest.Options): Result<Source>
Link copied to clipboard
open suspend override fun detachPaymentMethod(productUsageTokens: Set<String>, paymentMethodId: String, requestOptions: ApiRequest.Options): Result<PaymentMethod>
Link copied to clipboard
open suspend override fun getCardMetadata(bin: Bin, options: ApiRequest.Options): Result<CardMetadata>
Link copied to clipboard
open suspend override fun getFpxBankStatus(options: ApiRequest.Options): Result<BankStatuses>
Link copied to clipboard
open suspend override fun getPaymentMethods(listPaymentMethodsParams: ListPaymentMethodsParams, productUsageTokens: Set<String>, requestOptions: ApiRequest.Options): Result<List<PaymentMethod>>

Retrieve a Customer's PaymentMethods

Link copied to clipboard
open suspend override fun logOut(consumerSessionClientSecret: String, consumerAccountPublishableKey: String?, requestOptions: ApiRequest.Options): Result<ConsumerSession>
Link copied to clipboard
open suspend override fun refreshPaymentIntent(clientSecret: String, options: ApiRequest.Options): Result<PaymentIntent>

Refresh a PaymentIntent using its client_secret

Link copied to clipboard
open suspend override fun retrieveCardElementConfig(requestOptions: ApiRequest.Options): Result<MobileCardElementConfig>
Link copied to clipboard
open suspend override fun retrieveCardMetadata(cardNumber: String, requestOptions: ApiRequest.Options): Result<CardMetadata>
Link copied to clipboard
open suspend override fun retrieveCustomer(customerId: String, productUsageTokens: Set<String>, requestOptions: ApiRequest.Options): Result<Customer>
Link copied to clipboard
Link copied to clipboard
open suspend override fun retrieveIssuingCardPin(cardId: String, verificationId: String, userOneTimeCode: String, requestOptions: ApiRequest.Options): Result<String>
Link copied to clipboard
open suspend override fun retrieveObject(url: String, requestOptions: ApiRequest.Options): Result<StripeResponse<String>>
Link copied to clipboard
open suspend override fun retrievePaymentIntent(clientSecret: String, options: ApiRequest.Options, expandFields: List<String>): Result<PaymentIntent>

Retrieve a PaymentIntent using its client_secret

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): Result<PaymentMethodMessage>
Link copied to clipboard
open suspend override fun retrieveSetupIntent(clientSecret: String, options: ApiRequest.Options, expandFields: List<String>): Result<SetupIntent>

Retrieve a SetupIntent using its client_secret

Link copied to clipboard
open suspend override fun retrieveSource(sourceId: String, clientSecret: String, options: ApiRequest.Options): Result<Source>

Retrieve an existing Source object from the server.

Link copied to clipboard
open suspend override fun retrieveStripeIntent(clientSecret: String, options: ApiRequest.Options, expandFields: List<String>): Result<StripeIntent>
Link copied to clipboard
open suspend override fun setCustomerShippingInfo(customerId: String, publishableKey: String, productUsageTokens: Set<String>, shippingInformation: ShippingInformation, requestOptions: ApiRequest.Options): Result<Customer>
Link copied to clipboard
open suspend override fun setDefaultCustomerSource(customerId: String, publishableKey: String, productUsageTokens: Set<String>, sourceId: String, sourceType: String, requestOptions: ApiRequest.Options): Result<Customer>
Link copied to clipboard
open suspend override fun sharePaymentDetails(consumerSessionClientSecret: String, id: String, requestOptions: ApiRequest.Options): Result<String>
Link copied to clipboard
Link copied to clipboard
open suspend override fun updateIssuingCardPin(cardId: String, newPin: String, verificationId: String, userOneTimeCode: String, requestOptions: ApiRequest.Options): Throwable?
Link copied to clipboard
open suspend override fun updatePaymentMethod(paymentMethodId: String, paymentMethodUpdateParams: PaymentMethodUpdateParams, options: ApiRequest.Options): Result<PaymentMethod>
Link copied to clipboard
open suspend override fun verifyPaymentIntentWithMicrodeposits(clientSecret: String, descriptorCode: String, requestOptions: ApiRequest.Options): Result<PaymentIntent>

Verifies the PaymentIntent with microdeposits descriptor code

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

Verifies the PaymentIntent with microdeposits amounts

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

Verifies the SetupIntent with microdeposits descriptor code

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

Verifies the SetupIntent with microdeposits amounts