Package-level declarations

Types

Link copied to clipboard
interface AnalyticsEvent
Link copied to clipboard

Only common analytics field keys should be declared within this object.

Link copied to clipboard
data class AnalyticsRequest(val params: Map<String, *>, val headers: Map<String, String>) : StripeRequest

Analytics request sent to q.stripe.com, which is a legacy analytics service used mostly by Payment SDK, analytics are saved in a shared DB table with payment-specific schema.

Link copied to clipboard
Link copied to clipboard
open class AnalyticsRequestFactory(packageManager: PackageManager?, packageInfo: PackageInfo?, packageName: String, publishableKeyProvider: Provider<String>, networkTypeProvider: Provider<String?>, pluginTypeProvider: Provider<String?> = PLUGIN_TYPE_PROVIDER)
Link copied to clipboard
@Serializable
data class AnalyticsRequestV2 : StripeRequest

Analytics request sent to r.stripe.com, which is the preferred service for analytics. This is a POST request with MimeType.Form ContentType.

Link copied to clipboard
Link copied to clipboard
class AnalyticsRequestV2Factory(context: Context, clientId: String, origin: String, pluginType: String = PluginDetector.pluginType ?: PLUGIN_NATIVE)

Factory to generate AnalyticsRequestV2, can be optionally configured to add the following standard SDK specific parameters. os_version - Android version sdk_platform - always "android" sdk_version - current SDK version device_type - MANUFACTURER, brand and model app_name - the host application name app_version - the host app version plugin_type - whether SDK is integrated natively or through other wrappers(e.g react native) platform_info - information about current platform

Link copied to clipboard
Link copied to clipboard

A class representing a Stripe API or Analytics request.

Link copied to clipboard

Factory to create StripeConnection, which encapsulates an HttpURLConnection, triggers the request and parses the response with different body type as StripeResponse.

Link copied to clipboard
Link copied to clipboard
class DefaultAnalyticsRequestV2Executor @Inject constructor(application: Application, networkClient: StripeNetworkClient, logger: Logger, storage: AnalyticsRequestV2Storage, isWorkManagerAvailable: IsWorkManagerAvailable) : AnalyticsRequestV2Executor
Link copied to clipboard
class DefaultStripeNetworkClient @JvmOverloads constructor(workContext: CoroutineContext = Dispatchers.IO, connectionFactory: ConnectionFactory = ConnectionFactory.Default, retryDelaySupplier: RetryDelaySupplier = ExponentialBackoffRetryDelaySupplier(), maxRetries: Int = DEFAULT_MAX_RETRIES, logger: Logger = Logger.noop()) : StripeNetworkClient
Link copied to clipboard
Link copied to clipboard
open class FileUploadRequest(fileParams: StripeFileParams, options: ApiRequest.Options, appInfo: AppInfo? = null, boundary: String = createBoundary()) : StripeRequest

A StripeRequest for uploading a file using MimeType.MultipartForm.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Factory for HTTP request query strings, converts a Map of into a query string like "?p1=v1&p2=v2"

Link copied to clipboard
Link copied to clipboard
data class RequestId(val value: String)

The identifier for a Stripe API request.

Link copied to clipboard
Link copied to clipboard
class StripeClientUserAgentHeaderFactory(systemPropertySupplier: (String) -> String = DEFAULT_SYSTEM_PROPERTY_SUPPLIER)
Link copied to clipboard

A wrapper for accessing a HttpURLConnection. Implements Closeable to simplify closing related resources.

Link copied to clipboard

HTTP client to execute different types of StripeRequest and return StripeResponse.

Link copied to clipboard
abstract class StripeRequest

A class representing a request to a Stripe-owned service.

Link copied to clipboard
data class StripeResponse<ResponseBody>(val code: Int, val body: ResponseBody?, val headers: Map<String, List<String>> = emptyMap())

Represents a response from the Stripe servers. Upon receiving the HTTP response, its body is parsed into ResponseBody, such as a String or a File.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val HTTP_TOO_MANY_REQUESTS: Int = 429

If the SDK receives a "Too Many Requests" (429) status code from Stripe, it will automatically retry the request using exponential backoff.

Functions

Link copied to clipboard
suspend fun <Response : StripeModel> executeRequestWithModelJsonParser(stripeNetworkClient: StripeNetworkClient, stripeErrorJsonParser: StripeErrorJsonParser, request: StripeRequest, responseJsonParser: ModelJsonParser<Response>): Response
Link copied to clipboard
Link copied to clipboard
fun JsonElement.toMap(): Map<String, *>

Convert a JsonElement to a Map so it's compatible with QueryStringFactory. Note that this only supports JsonObjects currently. Other types will result in an InvalidSerializationException.

fun JsonObject.toMap(): Map<String, *>

Convert a JsonObject to a Map so it's compatible with QueryStringFactory.

Link copied to clipboard
fun JsonArray.toPrimitives(): List<*>

Convert all elements of an array to their equivalent kotlin primitives.

fun JsonElement.toPrimitives(): Any?

Recursively convert a JsonElement to its equivalent primitive kotlin values.