Sha256: 653473345d2b1726346be4552fe9f6c77dd484a7bdfad24f113ee49a2ba167a6

Contents?: true

Size: 1 KB

Versions: 4

Compression:

Stored size: 1 KB

Contents

# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
  class TokenService < StripeService
    # Creates a single-use token that represents a bank account's details.
    # You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts.
    def create(params = {}, opts = {})
      request(method: :post, path: "/v1/tokens", params: params, opts: opts, base_address: :api)
    end

    # Retrieves the token with the given ID.
    def retrieve(token, params = {}, opts = {})
      request(
        method: :get,
        path: format("/v1/tokens/%<token>s", { token: CGI.escape(token) }),
        params: params,
        opts: opts,
        base_address: :api
      )
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
stripe-13.0.2 lib/stripe/services/token_service.rb
stripe-13.0.1 lib/stripe/services/token_service.rb
stripe-13.1.0.pre.beta.2 lib/stripe/services/token_service.rb
stripe-13.0.0 lib/stripe/services/token_service.rb