Class: Bambora::Client
- Inherits:
-
Object
- Object
- Bambora::Client
- Defined in:
- lib/bambora/client.rb,
lib/bambora/client/version.rb
Overview
The Client class is used to initialize Resource objects that can make requests to the Bambora API.
Defined Under Namespace
Classes: Error
Constant Summary collapse
- VERSION =
'0.7.0'
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#merchant_id ⇒ Object
readonly
Returns the value of attribute merchant_id.
-
#scripts_api_base_url ⇒ Object
readonly
Returns the value of attribute scripts_api_base_url.
-
#sub_merchant_id ⇒ Object
readonly
Returns the value of attribute sub_merchant_id.
Instance Method Summary collapse
-
#bank_profiles(api_key:) ⇒ Bambora::Bank::PaymentProfileResource
Retrieve a client to make requests to the Bank Payment Profiles endpoints.
- #batch_payments(api_key:) ⇒ Object
-
#batch_reports(api_key:) ⇒ Bambora::Bank::BatchReportResource
Retrieve a client to make requests to the batch report endpoint.
-
#initialize(options = {}) {|_self| ... } ⇒ Client
constructor
Initialze a new Bambora::Client.
-
#payments(api_key:) ⇒ Bambora::V1::PaymentResource
Retrieve a client to make requests to the Payments endpoints.
-
#profiles(api_key:) ⇒ Bambora::V1::ProfileResource
Retrieve a client to make requests to the Profiles endpoints.
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ Client
Initialze a new Bambora::Client.
71 72 73 74 75 76 77 |
# File 'lib/bambora/client.rb', line 71 def initialize( = {}) .each do |key, value| instance_variable_set("@#{key}", value) end yield(self) if block_given? end |
Instance Attribute Details
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
55 56 57 |
# File 'lib/bambora/client.rb', line 55 def base_url @base_url end |
#merchant_id ⇒ Object (readonly)
Returns the value of attribute merchant_id.
55 56 57 |
# File 'lib/bambora/client.rb', line 55 def merchant_id @merchant_id end |
#scripts_api_base_url ⇒ Object (readonly)
Returns the value of attribute scripts_api_base_url.
55 56 57 |
# File 'lib/bambora/client.rb', line 55 def scripts_api_base_url @scripts_api_base_url end |
#sub_merchant_id ⇒ Object (readonly)
Returns the value of attribute sub_merchant_id.
55 56 57 |
# File 'lib/bambora/client.rb', line 55 def sub_merchant_id @sub_merchant_id end |
Instance Method Details
#bank_profiles(api_key:) ⇒ Bambora::Bank::PaymentProfileResource
Retrieve a client to make requests to the Bank Payment Profiles endpoints.
145 146 147 |
# File 'lib/bambora/client.rb', line 145 def bank_profiles(api_key:) @bank_profiles ||= Bambora::Bank::PaymentProfileResource.new(client: www_form_client, api_key: api_key) end |
#batch_payments(api_key:) ⇒ Object
175 176 177 178 179 180 |
# File 'lib/bambora/client.rb', line 175 def batch_payments(api_key:) @batch_payments ||= Bambora::V1::BatchPaymentResource.new( client: batch_payment_file_upload_client, api_key: api_key, ) end |
#batch_reports(api_key:) ⇒ Bambora::Bank::BatchReportResource
Retrieve a client to make requests to the batch report endpoint.
168 169 170 171 172 173 |
# File 'lib/bambora/client.rb', line 168 def batch_reports(api_key:) @batch_reports = Bambora::Bank::BatchReportResource.new( client: xml_client, api_key: api_key, ) end |
#payments(api_key:) ⇒ Bambora::V1::PaymentResource
Retrieve a client to make requests to the Payments endpoints.
113 114 115 |
# File 'lib/bambora/client.rb', line 113 def payments(api_key:) @payments ||= Bambora::V1::PaymentResource.new(client: json_client, api_key: api_key) end |
#profiles(api_key:) ⇒ Bambora::V1::ProfileResource
Retrieve a client to make requests to the Profiles endpoints.
88 89 90 |
# File 'lib/bambora/client.rb', line 88 def profiles(api_key:) @profiles ||= Bambora::V1::ProfileResource.new(client: json_client, api_key: api_key) end |