Class: AurePay::Client
- Inherits:
-
Object
- Object
- AurePay::Client
- Defined in:
- lib/aurepay/client.rb
Overview
Facade principal da API AurePay.
Instance Attribute Summary collapse
-
#chargebacks ⇒ Object
readonly
Returns the value of attribute chargebacks.
-
#company ⇒ Object
readonly
Returns the value of attribute company.
-
#conversions ⇒ Object
readonly
Returns the value of attribute conversions.
-
#deposits ⇒ Object
readonly
Returns the value of attribute deposits.
-
#wallets ⇒ Object
readonly
Returns the value of attribute wallets.
-
#webhooks ⇒ Object
readonly
Returns the value of attribute webhooks.
-
#withdrawals ⇒ Object
readonly
Returns the value of attribute withdrawals.
Instance Method Summary collapse
-
#initialize(api_key:, api_secret:, base_url: 'https://api.aurepay.com.br/v1', max_retries: 2) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(api_key:, api_secret:, base_url: 'https://api.aurepay.com.br/v1', max_retries: 2) ⇒ Client
Returns a new instance of Client.
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/aurepay/client.rb', line 169 def initialize(api_key:, api_secret:, base_url: 'https://api.aurepay.com.br/v1', max_retries: 2) api_key = api_key.to_s.strip api_secret = api_secret.to_s.strip raise Error.new('api_key and api_secret are required.') if api_key.empty? || api_secret.empty? http = HttpTransport.new( api_key: api_key, api_secret: api_secret, base_url: base_url, max_retries: max_retries ) @deposits = CrudResource.new(http, '/deposits') @withdrawals = CrudResource.new(http, '/withdrawals') @webhooks = CrudResource.new(http, '/webhooks') @company = Company.new(http) @conversions = Conversions.new(http) @chargebacks = Chargebacks.new(http) @wallets = CrudResource.new(http, '/wallets') end |
Instance Attribute Details
#chargebacks ⇒ Object (readonly)
Returns the value of attribute chargebacks.
167 168 169 |
# File 'lib/aurepay/client.rb', line 167 def chargebacks @chargebacks end |
#company ⇒ Object (readonly)
Returns the value of attribute company.
167 168 169 |
# File 'lib/aurepay/client.rb', line 167 def company @company end |
#conversions ⇒ Object (readonly)
Returns the value of attribute conversions.
167 168 169 |
# File 'lib/aurepay/client.rb', line 167 def conversions @conversions end |
#deposits ⇒ Object (readonly)
Returns the value of attribute deposits.
167 168 169 |
# File 'lib/aurepay/client.rb', line 167 def deposits @deposits end |
#wallets ⇒ Object (readonly)
Returns the value of attribute wallets.
167 168 169 |
# File 'lib/aurepay/client.rb', line 167 def wallets @wallets end |
#webhooks ⇒ Object (readonly)
Returns the value of attribute webhooks.
167 168 169 |
# File 'lib/aurepay/client.rb', line 167 def webhooks @webhooks end |
#withdrawals ⇒ Object (readonly)
Returns the value of attribute withdrawals.
167 168 169 |
# File 'lib/aurepay/client.rb', line 167 def withdrawals @withdrawals end |