Class: Bambora::Bank::PaymentProfileResource
- Inherits:
-
Object
- Object
- Bambora::Bank::PaymentProfileResource
- Defined in:
- lib/bambora/bank/payment_profile_resource.rb
Overview
For making requests to the /scripts/payment_profile.asp endpoint
Constant Summary collapse
- DEFAULT_VERSION =
1.0
- DEFAULT_RESPONSE_FORMAT =
'QS'
- CREATE_OPERATION_TYPE =
'N'
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.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#create(profile_data) ⇒ Object
Create a Bank Payment Profile.
-
#initialize(client:, api_key:, version: DEFAULT_VERSION) ⇒ PaymentProfileResource
constructor
Instantiate an interface to make requests against Bambora’s Profiles API.
Constructor Details
#initialize(client:, api_key:, version: DEFAULT_VERSION) ⇒ PaymentProfileResource
Instantiate an interface to make requests against Bambora’s Profiles API.
30 31 32 33 34 35 |
# File 'lib/bambora/bank/payment_profile_resource.rb', line 30 def initialize(client:, api_key:, version: DEFAULT_VERSION) @client = client @api_key = api_key @version = version @sub_path = '/scripts/payment_profile.asp' end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
14 15 16 |
# File 'lib/bambora/bank/payment_profile_resource.rb', line 14 def api_key @api_key end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
14 15 16 |
# File 'lib/bambora/bank/payment_profile_resource.rb', line 14 def client @client end |
#sub_path ⇒ Object (readonly)
Returns the value of attribute sub_path.
14 15 16 |
# File 'lib/bambora/bank/payment_profile_resource.rb', line 14 def sub_path @sub_path end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
14 15 16 |
# File 'lib/bambora/bank/payment_profile_resource.rb', line 14 def version @version end |
Instance Method Details
#create(profile_data) ⇒ Object
Create a Bank Payment Profile
payment_profile_resource.create(data)
@params profile_data [Hash] with values as noted in the example.
61 62 63 |
# File 'lib/bambora/bank/payment_profile_resource.rb', line 61 def create(profile_data) client.post(path: sub_path, body: payment_profile_body(profile_data)) end |