createSourceSynchronous

fun createSourceSynchronous(params: SourceParams, idempotencyKey: String? = null, stripeAccountId: String? = this.stripeAccountId): Source

Blocking method to create a Source object. Do not call this on the UI thread or your app will crash.

See Create a source. POST /v1/sources

Return

a Source, or null if a problem occurred

Parameters

params

a set of SourceParams with which to create the source

idempotencyKey

optional, see Idempotent Requests

stripeAccountId

Optional, the Connect account to associate with this request. By default, will use the Connect account that was used to instantiate the Stripe object, if specified.

Throws

AuthenticationException

failure to properly authenticate yourself (check your key)

InvalidRequestException

your request has invalid parameters

APIConnectionException

failure to connect to Stripe's API

APIException

any other type of problem (for instance, a temporary issue with Stripe's servers