Class: Bambora::V1::ProfileResource
- Inherits:
-
Object
- Object
- Bambora::V1::ProfileResource
- Defined in:
- lib/bambora/v1/profile_resource.rb
Overview
For making requests to the /profiles endpoint
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#sub_path ⇒ Object
readonly
Returns the value of attribute sub_path.
Instance Method Summary collapse
-
#create(payment_profile_data) ⇒ Hash
Create a Bambora payment profile.
-
#delete(customer_code:) ⇒ Hash
Delete a Bambora payment profile given a customer code.
-
#get(customer_code:) ⇒ Hash
Get a Bambora payment profile given a customer code.
-
#initialize(client:, api_key:) ⇒ ProfileResource
constructor
Instantiate an interface to make requests against Bambora’s Profiles API.
-
#update(customer_code:, payment_profile_data:) ⇒ Hash
Make a PUT Request.
Constructor Details
#initialize(client:, api_key:) ⇒ ProfileResource
Instantiate an interface to make requests against Bambora’s Profiles API.
21 22 23 24 25 |
# File 'lib/bambora/v1/profile_resource.rb', line 21 def initialize(client:, api_key:) @client = client @api_key = api_key @sub_path = '/v1/profiles' end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
8 9 10 |
# File 'lib/bambora/v1/profile_resource.rb', line 8 def api_key @api_key end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/bambora/v1/profile_resource.rb', line 8 def client @client end |
#sub_path ⇒ Object (readonly)
Returns the value of attribute sub_path.
8 9 10 |
# File 'lib/bambora/v1/profile_resource.rb', line 8 def sub_path @sub_path end |
Instance Method Details
#create(payment_profile_data) ⇒ Hash
Create a Bambora payment profile.
57 58 59 |
# File 'lib/bambora/v1/profile_resource.rb', line 57 def create(payment_profile_data) client.post(path: sub_path, body: payment_profile_data, api_key: api_key) end |
#delete(customer_code:) ⇒ Hash
Delete a Bambora payment profile given a customer code.
166 167 168 |
# File 'lib/bambora/v1/profile_resource.rb', line 166 def delete(customer_code:) client.delete(path: "#{@sub_path}/#{customer_code}", api_key: api_key) end |
#get(customer_code:) ⇒ Hash
Get a Bambora payment profile given a customer code.
99 100 101 |
# File 'lib/bambora/v1/profile_resource.rb', line 99 def get(customer_code:) client.get(path: "#{sub_path}/#{customer_code}", api_key: api_key) end |
#update(customer_code:, payment_profile_data:) ⇒ Hash
Make a PUT Request.
143 144 145 |
# File 'lib/bambora/v1/profile_resource.rb', line 143 def update(customer_code:, payment_profile_data:) client.put(path: "#{@sub_path}/#{customer_code}", body: payment_profile_data, api_key: api_key) end |