Stripe

class Stripe

Entry-point to the Stripe SDK.

Supports asynchronous and synchronous methods to access the following Stripe APIs.

Constructors

Stripe
Link copied to clipboard
fun Stripe(context: Context, publishableKey: String, stripeAccountId: String? = null, enableLogging: Boolean = false)
Constructor with publishable key and Stripe Connect account id.

Types

Companion
Link copied to clipboard
object Companion

Functions

authenticatePayment
Link copied to clipboard
fun authenticatePayment(activity: Activity, clientSecret: String)
Authenticate a PaymentIntent.
fun authenticatePayment(fragment: Fragment, clientSecret: String)
Authenticate a PaymentIntent.
authenticateSetup
Link copied to clipboard
fun authenticateSetup(activity: Activity, clientSecret: String)
Authenticate a SetupIntent.
fun authenticateSetup(fragment: Fragment, clientSecret: String)
Authenticate a SetupIntent.
authenticateSource
Link copied to clipboard
fun authenticateSource(activity: Activity, source: Source, stripeAccountId: String? = this.stripeAccountId)
Authenticate a Source that requires user action via a redirect (i.e.
fun authenticateSource(fragment: Fragment, source: Source, stripeAccountId: String? = this.stripeAccountId)
Authenticate a Source that requires user action via a redirect (i.e.
confirmAlipayPayment
Link copied to clipboard
fun confirmAlipayPayment(confirmPaymentIntentParams: ConfirmPaymentIntentParams, authenticator: AlipayAuthenticator, stripeAccountId: String? = this.stripeAccountId, callback: ApiResultCallback<PaymentIntentResult>)
Confirm and authenticate a PaymentIntent using the Alipay SDK
confirmPayment
Link copied to clipboard
fun confirmPayment(activity: Activity, confirmPaymentIntentParams: ConfirmPaymentIntentParams, stripeAccountId: String? = this.stripeAccountId)
Confirm and, if necessary, authenticate a PaymentIntent.
fun confirmPayment(fragment: Fragment, confirmPaymentIntentParams: ConfirmPaymentIntentParams, stripeAccountId: String? = this.stripeAccountId)
Confirm and, if necessary, authenticate a PaymentIntent.
confirmPaymentIntentSynchronous
Link copied to clipboard
fun confirmPaymentIntentSynchronous(confirmPaymentIntentParams: ConfirmPaymentIntentParams, idempotencyKey: String? = null): PaymentIntent?
Blocking method to confirm a PaymentIntent object.
confirmSetupIntent
Link copied to clipboard
fun confirmSetupIntent(activity: Activity, confirmSetupIntentParams: ConfirmSetupIntentParams, stripeAccountId: String? = this.stripeAccountId)
Confirm and, if necessary, authenticate a SetupIntent.
fun confirmSetupIntent(fragment: Fragment, confirmSetupIntentParams: ConfirmSetupIntentParams, stripeAccountId: String? = this.stripeAccountId)
Confirm and, if necessary, authenticate a SetupIntent.
confirmSetupIntentSynchronous
Link copied to clipboard
fun confirmSetupIntentSynchronous(confirmSetupIntentParams: ConfirmSetupIntentParams, idempotencyKey: String? = null): SetupIntent?
Blocking method to confirm a SetupIntent object.
createAccountToken
Link copied to clipboard
fun createAccountToken(accountParams: AccountParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId, callback: ApiResultCallback<Token>)
Create a Token asynchronously.
createAccountTokenSynchronous
Link copied to clipboard
fun createAccountTokenSynchronous(accountParams: AccountParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Token?
Blocking method to create a Token for a Connect Account.
createBankAccountToken
Link copied to clipboard
fun createBankAccountToken(bankAccountTokenParams: BankAccountTokenParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId, callback: ApiResultCallback<Token>)
Create a BankAccount token asynchronously.
createBankAccountTokenSynchronous
Link copied to clipboard
fun createBankAccountTokenSynchronous(bankAccountTokenParams: BankAccountTokenParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Token?
Blocking method to create a Token for a BankAccount.
createCardToken
Link copied to clipboard
fun createCardToken(card: Card, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId, callback: ApiResultCallback<Token>)
Create a Card token asynchronously.
fun createCardToken(cardParams: CardParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId, callback: ApiResultCallback<Token>)
Create a Card token asynchronously.
createCardTokenSynchronous
Link copied to clipboard
fun createCardTokenSynchronous(card: Card, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Token?
Blocking method to create a Token.
fun createCardTokenSynchronous(cardParams: CardParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Token?
Blocking method to create a Token.
createCvcUpdateToken
Link copied to clipboard
fun createCvcUpdateToken(@Size(min = 3.toLong(), max = 4.toLong()cvc: String, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId, callback: ApiResultCallback<Token>)
Create a CVC update token asynchronously.
createCvcUpdateTokenSynchronous
Link copied to clipboard
fun createCvcUpdateTokenSynchronous(cvc: String, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Token?
Blocking method to create a Token for CVC updating.
createFile
Link copied to clipboard
fun createFile(fileParams: StripeFileParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId, callback: ApiResultCallback<StripeFile>)
Create a file asynchronously
createFileSynchronous
Link copied to clipboard
fun createFileSynchronous(fileParams: StripeFileParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): StripeFile
Create a file synchronously
createPaymentMethod
Link copied to clipboard
fun createPaymentMethod(paymentMethodCreateParams: PaymentMethodCreateParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId, callback: ApiResultCallback<PaymentMethod>)
Create a PaymentMethod asynchronously.
createPaymentMethodSynchronous
Link copied to clipboard
fun createPaymentMethodSynchronous(paymentMethodCreateParams: PaymentMethodCreateParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): PaymentMethod?
Blocking method to create a PaymentMethod object.
createPersonToken
Link copied to clipboard
fun createPersonToken(params: PersonTokenParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId, callback: ApiResultCallback<Token>)
Creates a single-use token that represents the details for a person.
createPersonTokenSynchronous
Link copied to clipboard
fun createPersonTokenSynchronous(params: PersonTokenParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Token?
Creates a single-use token that represents the details for a person.
createPiiToken
Link copied to clipboard
fun createPiiToken(personalId: String, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId, callback: ApiResultCallback<Token>)
Create a PII token asynchronously.
createPiiTokenSynchronous
Link copied to clipboard
fun createPiiTokenSynchronous(personalId: String, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Token?
Blocking method to create a Token for PII.
createSource
Link copied to clipboard
fun createSource(sourceParams: SourceParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId, callback: ApiResultCallback<Source>)
Create a Source asynchronously.
createSourceSynchronous
Link copied to clipboard
fun createSourceSynchronous(params: SourceParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Source?
Blocking method to create a Source object.
handleNextActionForPayment
Link copied to clipboard
fun handleNextActionForPayment(activity: Activity, clientSecret: String, stripeAccountId: String? = this.stripeAccountId)
Handle the next_action for a previously confirmed PaymentIntent.
fun handleNextActionForPayment(fragment: Fragment, clientSecret: String, stripeAccountId: String? = this.stripeAccountId)
Handle the next_action for a previously confirmed PaymentIntent.
handleNextActionForSetupIntent
Link copied to clipboard
fun handleNextActionForSetupIntent(activity: Activity, clientSecret: String, stripeAccountId: String? = this.stripeAccountId)
Handle next_action for a previously confirmed SetupIntent.
fun handleNextActionForSetupIntent(fragment: Fragment, clientSecret: String, stripeAccountId: String? = this.stripeAccountId)
Handle next_action for a previously confirmed SetupIntent.
isAuthenticateSourceResult
Link copied to clipboard
fun isAuthenticateSourceResult(requestCode: Int, data: Intent?): Boolean
Should be called in onActivityResult() to determine if the result is for Source authentication
onAuthenticateSourceResult
Link copied to clipboard
fun onAuthenticateSourceResult(data: Intent, callback: ApiResultCallback<Source>)
The result of a call to authenticateSource.
onPaymentResult
Link copied to clipboard
fun onPaymentResult(requestCode: Int, data: Intent?, callback: ApiResultCallback<PaymentIntentResult>): Boolean
Should be called via Activity#onActivityResult(int, int, Intent)}} to handle the result of a PaymentIntent automatic confirmation (see confirmPayment) or manual confirmation (see handleNextActionForPayment})
onSetupResult
Link copied to clipboard
fun onSetupResult(requestCode: Int, data: Intent?, callback: ApiResultCallback<SetupIntentResult>): Boolean
Should be called via Activity#onActivityResult(int, int, Intent)}} to handle the result of a SetupIntent confirmation (see confirmSetupIntent).
retrievePaymentIntent
Link copied to clipboard
fun retrievePaymentIntent(clientSecret: String, stripeAccountId: String? = this.stripeAccountId, callback: ApiResultCallback<PaymentIntent>)
Retrieve a PaymentIntent asynchronously.
retrievePaymentIntentSynchronous
Link copied to clipboard
fun retrievePaymentIntentSynchronous(clientSecret: String, stripeAccountId: String? = this.stripeAccountId): PaymentIntent?
Blocking method to retrieve a PaymentIntent object.
retrieveSetupIntent
Link copied to clipboard
fun retrieveSetupIntent(clientSecret: String, stripeAccountId: String? = this.stripeAccountId, callback: ApiResultCallback<SetupIntent>)
Retrieve a SetupIntent asynchronously.
retrieveSetupIntentSynchronous
Link copied to clipboard
fun retrieveSetupIntentSynchronous(clientSecret: String, stripeAccountId: String? = this.stripeAccountId): SetupIntent?
Blocking method to retrieve a SetupIntent object.
retrieveSource
Link copied to clipboard
fun retrieveSource(@Size(min = 1.toLong()sourceId: String, @Size(min = 1.toLong()clientSecret: String, stripeAccountId: String? = this.stripeAccountId, callback: ApiResultCallback<Source>)
Retrieve a Source asynchronously.
retrieveSourceSynchronous
Link copied to clipboard
fun retrieveSourceSynchronous(@Size(min = 1.toLong()sourceId: String, @Size(min = 1.toLong()clientSecret: String, stripeAccountId: String? = this.stripeAccountId): Source?
Retrieve an existing Source from the Stripe API.

Extensions

confirmPaymentIntent
Link copied to clipboard
suspend fun Stripe.confirmPaymentIntent(confirmPaymentIntentParams: ConfirmPaymentIntentParams, idempotencyKey: String? = null): PaymentIntent
Suspend function to confirm a PaymentIntent object.
confirmSetupIntent
Link copied to clipboard
suspend fun Stripe.confirmSetupIntent(confirmSetupIntentParams: ConfirmSetupIntentParams, idempotencyKey: String? = null): SetupIntent
Suspend function to confirm a SetupIntent object.
createAccountToken
Link copied to clipboard
suspend fun Stripe.createAccountToken(accountParams: AccountParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Token
Create a Token from a coroutine.
createBankAccountToken
Link copied to clipboard
suspend fun Stripe.createBankAccountToken(bankAccountTokenParams: BankAccountTokenParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Token
Create a bank account token from a coroutine.
createCardToken
Link copied to clipboard
suspend fun Stripe.createCardToken(cardParams: CardParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Token
Create a Card token from a coroutine.
createCvcUpdateToken
Link copied to clipboard
suspend fun Stripe.createCvcUpdateToken(@Size(min = 3.toLong(), max = 4.toLong()cvc: String, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Token
Create a CVC update token from a coroutine.
createFile
Link copied to clipboard
suspend fun Stripe.createFile(fileParams: StripeFileParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): StripeFile
Create a StripeFile from a coroutine.
createPaymentMethod
Link copied to clipboard
suspend fun Stripe.createPaymentMethod(paymentMethodCreateParams: PaymentMethodCreateParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): PaymentMethod
Create a PaymentMethod from a coroutine.
createPersonToken
Link copied to clipboard
suspend fun Stripe.createPersonToken(params: PersonTokenParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Token
Creates a single-use token that represents the details for a person.
createPiiToken
Link copied to clipboard
suspend fun Stripe.createPiiToken(personalId: String, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Token
Create a PII token from a coroutine.
createSource
Link copied to clipboard
suspend fun Stripe.createSource(sourceParams: SourceParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Source
Create a Source from a coroutine.
retrievePaymentIntent
Link copied to clipboard
suspend fun Stripe.retrievePaymentIntent(clientSecret: String, stripeAccountId: String? = this.stripeAccountId): PaymentIntent
Retrieve a PaymentIntent from a coroutine.
retrieveSetupIntent
Link copied to clipboard
suspend fun Stripe.retrieveSetupIntent(clientSecret: String, stripeAccountId: String? = this.stripeAccountId): SetupIntent
Retrieve a SetupIntent asynchronously.
retrieveSource
Link copied to clipboard
suspend fun Stripe.retrieveSource(@Size(min = 1.toLong()sourceId: String, @Size(min = 1.toLong()clientSecret: String, stripeAccountId: String? = this.stripeAccountId): Source
Retrieve a Source from a coroutine.