Class: CheckoutSdk::Accounts::AccountsClient
- Inherits:
-
Client
- Object
- Client
- CheckoutSdk::Accounts::AccountsClient
show all
- Defined in:
- lib/checkout_sdk/accounts/accounts_client.rb
Instance Attribute Summary collapse
Attributes inherited from Client
#api_client, #authorization_type, #configuration
Instance Method Summary
collapse
-
#add_payment_instrument(entity_id, payment_instrument) ⇒ Object
-
#create_entity(entity_request) ⇒ Object
-
#create_payment_instrument(entity_id, payment_instrument) ⇒ Object
deprecated
Deprecated.
-
#get_entity(entity_id) ⇒ Object
-
#initialize(api_client, files_client, configuration) ⇒ AccountsClient
constructor
A new instance of AccountsClient.
-
#query_payment_instruments(entity_id, payment_instruments_query = nil) ⇒ Object
-
#retrieve_payment_instrument_details(entity_id, payment_instrument_id) ⇒ Object
-
#retrieve_payout_schedule(entity_id) ⇒ Object
-
#update_entity(entity_id, entity_request) ⇒ Object
-
#update_payment_instrument(entity_id, instrument_id, update_payment_instrument) ⇒ Object
-
#update_payout_schedule(entity_id, currency, update_schedule) ⇒ Object
-
#upload_file(file_request) ⇒ Object
Constructor Details
#initialize(api_client, files_client, configuration) ⇒ AccountsClient
Returns a new instance of AccountsClient.
19
20
21
22
|
# File 'lib/checkout_sdk/accounts/accounts_client.rb', line 19
def initialize(api_client, files_client, configuration)
super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH)
@files_client = files_client
end
|
Instance Attribute Details
#files_client ⇒ Object
Returns the value of attribute files_client.
6
7
8
|
# File 'lib/checkout_sdk/accounts/accounts_client.rb', line 6
def files_client
@files_client
end
|
Instance Method Details
#add_payment_instrument(entity_id, payment_instrument) ⇒ Object
50
51
52
53
|
# File 'lib/checkout_sdk/accounts/accounts_client.rb', line 50
def add_payment_instrument(entity_id, payment_instrument)
api_client.invoke_post(build_path(ACCOUNTS, ENTITIES, entity_id, PAYMENT_INSTRUMENTS), sdk_authorization,
payment_instrument)
end
|
#create_entity(entity_request) ⇒ Object
25
26
27
|
# File 'lib/checkout_sdk/accounts/accounts_client.rb', line 25
def create_entity(entity_request)
api_client.invoke_post(build_path(ACCOUNTS, ENTITIES), sdk_authorization, entity_request)
end
|
#create_payment_instrument(entity_id, payment_instrument) ⇒ Object
43
44
45
46
|
# File 'lib/checkout_sdk/accounts/accounts_client.rb', line 43
def create_payment_instrument(entity_id, payment_instrument)
api_client.invoke_post(build_path(ACCOUNTS, ENTITIES, entity_id, INSTRUMENT), sdk_authorization,
payment_instrument)
end
|
#get_entity(entity_id) ⇒ Object
30
31
32
|
# File 'lib/checkout_sdk/accounts/accounts_client.rb', line 30
def get_entity(entity_id)
api_client.invoke_get(build_path(ACCOUNTS, ENTITIES, entity_id), sdk_authorization)
end
|
#query_payment_instruments(entity_id, payment_instruments_query = nil) ⇒ Object
57
58
59
60
61
|
# File 'lib/checkout_sdk/accounts/accounts_client.rb', line 57
def query_payment_instruments(entity_id, payment_instruments_query = nil)
api_client.invoke_get(build_path(ACCOUNTS, ENTITIES, entity_id, PAYMENT_INSTRUMENTS),
sdk_authorization,
payment_instruments_query)
end
|
#retrieve_payment_instrument_details(entity_id, payment_instrument_id) ⇒ Object
65
66
67
68
|
# File 'lib/checkout_sdk/accounts/accounts_client.rb', line 65
def retrieve_payment_instrument_details(entity_id, payment_instrument_id)
api_client.invoke_get(build_path(ACCOUNTS, ENTITIES, entity_id, PAYMENT_INSTRUMENTS, payment_instrument_id),
sdk_authorization)
end
|
#retrieve_payout_schedule(entity_id) ⇒ Object
88
89
90
|
# File 'lib/checkout_sdk/accounts/accounts_client.rb', line 88
def retrieve_payout_schedule(entity_id)
api_client.invoke_get(build_path(ACCOUNTS, ENTITIES, entity_id, PAYOUT_SCHEDULE), sdk_authorization)
end
|
#update_entity(entity_id, entity_request) ⇒ Object
36
37
38
|
# File 'lib/checkout_sdk/accounts/accounts_client.rb', line 36
def update_entity(entity_id, entity_request)
api_client.invoke_put(build_path(ACCOUNTS, ENTITIES, entity_id), sdk_authorization, entity_request)
end
|
#update_payment_instrument(entity_id, instrument_id, update_payment_instrument) ⇒ Object
73
74
75
76
77
|
# File 'lib/checkout_sdk/accounts/accounts_client.rb', line 73
def update_payment_instrument(entity_id, instrument_id, update_payment_instrument)
api_client.invoke_patch(build_path(ACCOUNTS, ENTITIES, entity_id, PAYMENT_INSTRUMENTS, instrument_id),
sdk_authorization,
update_payment_instrument)
end
|
#update_payout_schedule(entity_id, currency, update_schedule) ⇒ Object
82
83
84
85
|
# File 'lib/checkout_sdk/accounts/accounts_client.rb', line 82
def update_payout_schedule(entity_id, currency, update_schedule)
api_client.invoke_put(build_path(ACCOUNTS, ENTITIES, entity_id, PAYOUT_SCHEDULE), sdk_authorization,
{ currency => update_schedule })
end
|
#upload_file(file_request) ⇒ Object
93
94
95
|
# File 'lib/checkout_sdk/accounts/accounts_client.rb', line 93
def upload_file(file_request)
files_client.submit_file(FILES, sdk_authorization, file_request)
end
|