Class: Stripe::V2::Core::AccountTokenService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::V2::Core::AccountTokenService
- Defined in:
- lib/stripe/services/v2/core/account_token_service.rb
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Object
Create an account token with a publishable key and pass it to the Accounts v2 API to create or update an account without its data touching your server.
-
#retrieve(id, params = {}, opts = {}) ⇒ Object
Retrieves an Account Token.
Methods inherited from StripeService
#initialize, #request, #request_stream
Constructor Details
This class inherits a constructor from Stripe::StripeService
Instance Method Details
#create(params = {}, opts = {}) ⇒ Object
Create an account token with a publishable key and pass it to the Accounts v2 API to create or update an account without its data touching your server. Learn more about account tokens. In live mode, you can only create account tokens with your application's publishable key. In test mode, you can create account tokens with your secret key or publishable key.
** raises RateLimitError
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/stripe/services/v2/core/account_token_service.rb', line 15 def create(params = {}, opts = {}) unless params.is_a?(Stripe::RequestParams) params = ::Stripe::V2::Core::AccountTokenCreateParams.coerce_params(params) end request( method: :post, path: "/v2/core/account_tokens", params: params, opts: opts, base_address: :api ) end |
#retrieve(id, params = {}, opts = {}) ⇒ Object
Retrieves an Account Token.
** raises RateLimitError
32 33 34 35 36 37 38 39 40 |
# File 'lib/stripe/services/v2/core/account_token_service.rb', line 32 def retrieve(id, params = {}, opts = {}) request( method: :get, path: format("/v2/core/account_tokens/%<id>s", { id: CGI.escape(id) }), params: params, opts: opts, base_address: :api ) end |