Class: MethodRuby::Resources::Simulate::Accounts::Transactions
- Inherits:
-
Object
- Object
- MethodRuby::Resources::Simulate::Accounts::Transactions
- Defined in:
- lib/method_ruby/resources/simulate/accounts/transactions.rb
Overview
Sandbox account simulation
Instance Method Summary collapse
-
#create(account_id, amount:, method_version:, merchant_name: nil, type: nil, request_options: {}) ⇒ MethodRuby::Models::Simulate::Accounts::TransactionCreateResponse
Some parameter documentations has been truncated, see Models::Simulate::Accounts::TransactionCreateParams for more details.
-
#initialize(client:) ⇒ Transactions
constructor
private
A new instance of Transactions.
Constructor Details
#initialize(client:) ⇒ Transactions
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 Transactions.
53 54 55 |
# File 'lib/method_ruby/resources/simulate/accounts/transactions.rb', line 53 def initialize(client:) @client = client end |
Instance Method Details
#create(account_id, amount:, method_version:, merchant_name: nil, type: nil, request_options: {}) ⇒ MethodRuby::Models::Simulate::Accounts::TransactionCreateResponse
Some parameter documentations has been truncated, see Models::Simulate::Accounts::TransactionCreateParams for more details.
Creates a simulated transaction on an account in the sandbox environment. Use this to test transaction-related flows during development.
**Development only** - This endpoint is only available in the sandbox environment.
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/method_ruby/resources/simulate/accounts/transactions.rb', line 36 def create(account_id, params) parsed, = MethodRuby::Simulate::Accounts::TransactionCreateParams.dump_request(params) header_params = {method_version: "method-version"} @client.request( method: :post, path: ["simulate/accounts/%1$s/transactions", account_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: MethodRuby::Models::Simulate::Accounts::TransactionCreateResponse, security: {secret_key: true}, options: ) end |