Class: Lithic::Resources::Accounts
- Inherits:
-
Object
- Object
- Lithic::Resources::Accounts
- Defined in:
- lib/lithic/resources/accounts.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Accounts
constructor
private
A new instance of Accounts.
-
#list(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::Account>
Some parameter documentations has been truncated, see Models::AccountListParams for more details.
-
#retrieve(account_token, request_options: {}) ⇒ Lithic::Models::Account
Get account configuration such as spend limits.
-
#retrieve_signals(account_token, request_options: {}) ⇒ Lithic::Models::SignalsResponse
Returns behavioral feature state derived from an account’s transaction history.
-
#retrieve_spend_limits(account_token, request_options: {}) ⇒ Lithic::Models::AccountSpendLimits
Get an Account’s available spend limits, which is based on the spend limit configured on the Account and the amount already spent over the spend limit’s duration.
-
#update(account_token, comment: nil, daily_spend_limit: nil, lifetime_spend_limit: nil, monthly_spend_limit: nil, state: nil, substatus: nil, verification_address: nil, request_options: {}) ⇒ Lithic::Models::Account
Some parameter documentations has been truncated, see Models::AccountUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Accounts
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Accounts.
156 157 158 |
# File 'lib/lithic/resources/accounts.rb', line 156 def initialize(client:) @client = client end |
Instance Method Details
#list(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::Account>
Some parameter documentations has been truncated, see Models::AccountListParams for more details.
List account configurations.
89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/lithic/resources/accounts.rb', line 89 def list(params = {}) parsed, = Lithic::AccountListParams.dump_request(params) query = Lithic::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v1/accounts", query: query.transform_keys(begin_: "begin", end_: "end"), page: Lithic::Internal::CursorPage, model: Lithic::Account, options: ) end |
#retrieve(account_token, request_options: {}) ⇒ Lithic::Models::Account
Get account configuration such as spend limits.
17 18 19 20 21 22 23 24 |
# File 'lib/lithic/resources/accounts.rb', line 17 def retrieve(account_token, params = {}) @client.request( method: :get, path: ["v1/accounts/%1$s", account_token], model: Lithic::Account, options: params[:request_options] ) end |
#retrieve_signals(account_token, request_options: {}) ⇒ Lithic::Models::SignalsResponse
Returns behavioral feature state derived from an account’s transaction history.
These signals expose the same data used by behavioral rule attributes (e.g. ‘AMOUNT_Z_SCORE` with `scope: ACCOUNT`, `IS_NEW_COUNTRY` with `scope: ACCOUNT`) and custom code `TRANSACTION_HISTORY_SIGNALS` features, allowing clients to inspect feature values before writing rules and debug rule behavior.
Note: 3DS fields are not available at the account scope and will be null.
120 121 122 123 124 125 126 127 |
# File 'lib/lithic/resources/accounts.rb', line 120 def retrieve_signals(account_token, params = {}) @client.request( method: :get, path: ["v1/accounts/%1$s/signals", account_token], model: Lithic::SignalsResponse, options: params[:request_options] ) end |
#retrieve_spend_limits(account_token, request_options: {}) ⇒ Lithic::Models::AccountSpendLimits
Get an Account’s available spend limits, which is based on the spend limit configured on the Account and the amount already spent over the spend limit’s duration. For example, if the Account has a daily spend limit of $1000 configured, and has spent $600 in the last 24 hours, the available spend limit returned would be $400.
144 145 146 147 148 149 150 151 |
# File 'lib/lithic/resources/accounts.rb', line 144 def retrieve_spend_limits(account_token, params = {}) @client.request( method: :get, path: ["v1/accounts/%1$s/spend_limits", account_token], model: Lithic::AccountSpendLimits, options: params[:request_options] ) end |
#update(account_token, comment: nil, daily_spend_limit: nil, lifetime_spend_limit: nil, monthly_spend_limit: nil, state: nil, substatus: nil, verification_address: nil, request_options: {}) ⇒ Lithic::Models::Account
Some parameter documentations has been truncated, see Models::AccountUpdateParams for more details.
Update account configuration such as state or spend limits. Can only be run on accounts that are part of the program managed by this API key. Accounts that are in the ‘PAUSED` state will not be able to transact or create new cards.
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/lithic/resources/accounts.rb', line 56 def update(account_token, params = {}) parsed, = Lithic::AccountUpdateParams.dump_request(params) @client.request( method: :patch, path: ["v1/accounts/%1$s", account_token], body: parsed, model: Lithic::Account, options: ) end |