class Stripe::SourcesApi

Defined in:

stripe/api/sources_api.cr

Constant Summary

GET_SOURCES_SOURCE_MAX_LENGTH_FOR_CLIENT_SECRET = 5000
GET_SOURCES_SOURCE_MAX_LENGTH_FOR_SOURCE = 5000
POST_SOURCES_MAX_LENGTH_FOR__TYPE = 5000
POST_SOURCES_MAX_LENGTH_FOR_CUSTOMER = 500
POST_SOURCES_MAX_LENGTH_FOR_FLOW = 5000
POST_SOURCES_MAX_LENGTH_FOR_ORIGINAL_SOURCE = 5000
POST_SOURCES_MAX_LENGTH_FOR_STATEMENT_DESCRIPTOR = 5000
POST_SOURCES_MAX_LENGTH_FOR_TOKEN = 5000
POST_SOURCES_MAX_LENGTH_FOR_USAGE = 5000
POST_SOURCES_SOURCE_MAX_LENGTH_FOR_SOURCE = 5000
POST_SOURCES_VALID_VALUES_FOR_FLOW = String.static_array("code_verification", "none", "receiver", "redirect")
POST_SOURCES_VALID_VALUES_FOR_USAGE = String.static_array("reusable", "single_use")

Constructors

Instance Method Summary

Constructor Detail

def self.new(api_client : Stripe::ApiClient = ApiClient.default) #

[View source]

Instance Method Detail

def api_client : ApiClient #

[View source]
def api_client=(api_client : ApiClient) #

[View source]
def build_api_request_for_get_sources_source(*, source : String | Nil = nil, expand : Array(Array(String)) | Nil = nil, client_secret : String | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_sources(*, amount : Int64 | Nil = nil, currency : String | Nil = nil, customer : String | Nil = nil, expand : Array(String) | Nil = nil, flow : String | Nil = nil, mandate : Stripe::MandateParams | Nil = nil, metadata : Hash(String, String) | Nil = nil, original_source : String | Nil = nil, owner : Stripe::Owner | Nil = nil, receiver : Stripe::ReceiverParams | Nil = nil, redirect : Stripe::RedirectParams | Nil = nil, source_order : Stripe::ShallowOrderSpecs | Nil = nil, statement_descriptor : String | Nil = nil, token : String | Nil = nil, _type : String | Nil = nil, usage : String | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_sources_source(*, source : String | Nil = nil, amount : Int64 | Nil = nil, expand : Array(String) | Nil = nil, mandate : Stripe::MandateParams | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, owner : Stripe::Owner | Nil = nil, source_order : Stripe::OrderParams | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def client_side_validation?(*args, **options) #

[View source]
def client_side_validation?(*args, **options, &) #

[View source]
def debugging?(*args, **options) #

[View source]
def debugging?(*args, **options, &) #

[View source]
def get_sources_source(*, source : String | Nil = nil, expand : Array(Array(String)) | Nil = nil, client_secret : String | Nil = nil) : Stripe::Source #

Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information.

@required @param source [String?] @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param client_secret [String?] The client secret of the source. Required if a publishable key is used to retrieve the source. @return [Stripe::Source]

[View source]
def get_sources_source(*, source : String | Nil = nil, expand : Array(Array(String)) | Nil = nil, client_secret : String | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information.</p> @required @param source [String?] @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param client_secret [String?] The client secret of the source. Required if a publishable key is used to retrieve the source. @return nil


[View source]
def get_sources_source_with_http_info(*, source : String | Nil = nil, expand : Array(Array(String)) | Nil = nil, client_secret : String | Nil = nil) : Tuple(Stripe::Source, Int32, Hash(String, Array(String) | String)) #

<p>Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information.</p> @required @param source [String?] @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param client_secret [String?] The client secret of the source. Required if a publishable key is used to retrieve the source. @return [Tuple(Stripe::Source, Integer, Hash)] Stripe::Source, response status code and response headers


[View source]
def post_sources(*, amount : Int64 | Nil = nil, currency : String | Nil = nil, customer : String | Nil = nil, expand : Array(String) | Nil = nil, flow : String | Nil = nil, mandate : Stripe::MandateParams | Nil = nil, metadata : Hash(String, String) | Nil = nil, original_source : String | Nil = nil, owner : Stripe::Owner | Nil = nil, receiver : Stripe::ReceiverParams | Nil = nil, redirect : Stripe::RedirectParams | Nil = nil, source_order : Stripe::ShallowOrderSpecs | Nil = nil, statement_descriptor : String | Nil = nil, token : String | Nil = nil, _type : String | Nil = nil, usage : String | Nil = nil) : Stripe::Source #

Creates a new source object.

@optional @param amount [Int32?] Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. Not supported for `receiver` type sources, where charge amount may not be specified until funds land. @optional @param currency [String?] Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. @optional @param customer [String?] The `Customer` to whom the original source is attached to. Must be set when the original source is not a `Source` (e.g., `Card`). @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param flow [String?] The authentication `flow` of the source to create. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. It is generally inferred unless a type supports multiple flows. @optional @param mandate [Stripe::MandateParams?] @optional @param metadata [Hash(String, String)?] @optional @param original_source [String?] The source to share. @optional @param owner [Stripe::Owner?] @optional @param receiver [Stripe::ReceiverParams?] @optional @param redirect [Stripe::RedirectParams?] @optional @param source_order [Stripe::ShallowOrderSpecs?] @optional @param statement_descriptor [String?] An arbitrary string to be displayed on your customer's statement. As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all. @optional @param token [String?] An optional token used to create the source. When passed, token properties will override source parameters. @optional @param _type [String?] The `type` of the source to create. Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide) @optional @param usage [String?] @return [Stripe::Source]

[View source]
def post_sources(*, amount : Int64 | Nil = nil, currency : String | Nil = nil, customer : String | Nil = nil, expand : Array(String) | Nil = nil, flow : String | Nil = nil, mandate : Stripe::MandateParams | Nil = nil, metadata : Hash(String, String) | Nil = nil, original_source : String | Nil = nil, owner : Stripe::Owner | Nil = nil, receiver : Stripe::ReceiverParams | Nil = nil, redirect : Stripe::RedirectParams | Nil = nil, source_order : Stripe::ShallowOrderSpecs | Nil = nil, statement_descriptor : String | Nil = nil, token : String | Nil = nil, _type : String | Nil = nil, usage : String | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Creates a new source object.</p> @optional @param amount [Int32?] Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources. Not supported for receiver type sources, where charge amount may not be specified until funds land. @optional @param currency [String?] Three-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready. @optional @param customer [String?] The Customer to whom the original source is attached to. Must be set when the original source is not a Source (e.g., Card). @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param flow [String?] The authentication flow of the source to create. flow is one of redirect, receiver, code_verification, none. It is generally inferred unless a type supports multiple flows. @optional @param mandate [Stripe::MandateParams?] @optional @param metadata [Hash(String, String)?] @optional @param original_source [String?] The source to share. @optional @param owner [Stripe::Owner?] @optional @param receiver [Stripe::ReceiverParams?] @optional @param redirect [Stripe::RedirectParams?] @optional @param source_order [Stripe::ShallowOrderSpecs?] @optional @param statement_descriptor [String?] An arbitrary string to be displayed on your customer's statement. As an example, if your website is RunClub and the item you're charging for is a race ticket, you may want to specify a statement_descriptor of RunClub 5K race ticket. While many payment types will display this information, some may not display it at all. @optional @param token [String?] An optional token used to create the source. When passed, token properties will override source parameters. @optional @param _type [String?] The type of the source to create. Required unless customer and original_source are specified (see the Cloning card Sources guide) @optional @param usage [String?] @return nil


[View source]
def post_sources_source(*, source : String | Nil = nil, amount : Int64 | Nil = nil, expand : Array(String) | Nil = nil, mandate : Stripe::MandateParams | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, owner : Stripe::Owner | Nil = nil, source_order : Stripe::OrderParams | Nil = nil) : Stripe::Source #

Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our payment method guides for more detail.

@required @param source [String?] @optional @param amount [Int32?] Amount associated with the source. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param mandate [Stripe::MandateParams?] @optional @param metadata [Stripe::PostAccountsRequestMetadata?] @optional @param owner [Stripe::Owner?] @optional @param source_order [Stripe::OrderParams?] @return [Stripe::Source]

[View source]
def post_sources_source(*, source : String | Nil = nil, amount : Int64 | Nil = nil, expand : Array(String) | Nil = nil, mandate : Stripe::MandateParams | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, owner : Stripe::Owner | Nil = nil, source_order : Stripe::OrderParams | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.</p> <p>This request accepts the <code>metadata</code> and <code>owner</code> as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our <a href=&quot;/docs/sources&quot;>payment method guides</a> for more detail.</p> @required @param source [String?] @optional @param amount [Int32?] Amount associated with the source. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param mandate [Stripe::MandateParams?] @optional @param metadata [Stripe::PostAccountsRequestMetadata?] @optional @param owner [Stripe::Owner?] @optional @param source_order [Stripe::OrderParams?] @return nil


[View source]
def post_sources_source_with_http_info(*, source : String | Nil = nil, amount : Int64 | Nil = nil, expand : Array(String) | Nil = nil, mandate : Stripe::MandateParams | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, owner : Stripe::Owner | Nil = nil, source_order : Stripe::OrderParams | Nil = nil) : Tuple(Stripe::Source, Int32, Hash(String, Array(String) | String)) #

<p>Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.</p> <p>This request accepts the <code>metadata</code> and <code>owner</code> as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our <a href=&quot;/docs/sources&quot;>payment method guides</a> for more detail.</p> @required @param source [String?] @optional @param amount [Int32?] Amount associated with the source. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param mandate [Stripe::MandateParams?] @optional @param metadata [Stripe::PostAccountsRequestMetadata?] @optional @param owner [Stripe::Owner?] @optional @param source_order [Stripe::OrderParams?] @return [Tuple(Stripe::Source, Integer, Hash)] Stripe::Source, response status code and response headers


[View source]
def post_sources_with_http_info(*, amount : Int64 | Nil = nil, currency : String | Nil = nil, customer : String | Nil = nil, expand : Array(String) | Nil = nil, flow : String | Nil = nil, mandate : Stripe::MandateParams | Nil = nil, metadata : Hash(String, String) | Nil = nil, original_source : String | Nil = nil, owner : Stripe::Owner | Nil = nil, receiver : Stripe::ReceiverParams | Nil = nil, redirect : Stripe::RedirectParams | Nil = nil, source_order : Stripe::ShallowOrderSpecs | Nil = nil, statement_descriptor : String | Nil = nil, token : String | Nil = nil, _type : String | Nil = nil, usage : String | Nil = nil) : Tuple(Stripe::Source, Int32, Hash(String, Array(String) | String)) #

<p>Creates a new source object.</p> @optional @param amount [Int32?] Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources. Not supported for receiver type sources, where charge amount may not be specified until funds land. @optional @param currency [String?] Three-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready. @optional @param customer [String?] The Customer to whom the original source is attached to. Must be set when the original source is not a Source (e.g., Card). @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param flow [String?] The authentication flow of the source to create. flow is one of redirect, receiver, code_verification, none. It is generally inferred unless a type supports multiple flows. @optional @param mandate [Stripe::MandateParams?] @optional @param metadata [Hash(String, String)?] @optional @param original_source [String?] The source to share. @optional @param owner [Stripe::Owner?] @optional @param receiver [Stripe::ReceiverParams?] @optional @param redirect [Stripe::RedirectParams?] @optional @param source_order [Stripe::ShallowOrderSpecs?] @optional @param statement_descriptor [String?] An arbitrary string to be displayed on your customer's statement. As an example, if your website is RunClub and the item you're charging for is a race ticket, you may want to specify a statement_descriptor of RunClub 5K race ticket. While many payment types will display this information, some may not display it at all. @optional @param token [String?] An optional token used to create the source. When passed, token properties will override source parameters. @optional @param _type [String?] The type of the source to create. Required unless customer and original_source are specified (see the Cloning card Sources guide) @optional @param usage [String?] @return [Tuple(Stripe::Source, Integer, Hash)] Stripe::Source, response status code and response headers


[View source]