Module: Transbank::Onepay::Request

Includes:
Utils::JSONUtils, Utils::SignatureUtils
Included in:
RefundCreateRequest, TransactionCommitRequest, TransactionCreateRequest
Defined in:
lib/transbank/sdk/onepay/requests/request.rb

Overview

Base module with methods & attributes common to Requests

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::JSONUtils

included, #jsonify, #transform_hash_keys, #underscore

Methods included from Utils::SignatureUtils

#hmac_sha256, #signature_for, #to_data, #valid_signature?

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



6
7
8
# File 'lib/transbank/sdk/onepay/requests/request.rb', line 6

def api_key
  @api_key
end

#app_keyObject

Returns the value of attribute app_key.



7
8
9
# File 'lib/transbank/sdk/onepay/requests/request.rb', line 7

def app_key
  @app_key
end

Instance Method Details

#set_keys_from_options(options) ⇒ Object

Set the request’s @api_key overriding the one in the [Base] class



11
12
13
14
15
# File 'lib/transbank/sdk/onepay/requests/request.rb', line 11

def set_keys_from_options(options)
  transform_hash_keys(options)
  new_api_key = options.fetch(:api_key, nil)
  self.api_key = new_api_key unless new_api_key.nil?
end