Module: UU::Fairpay2::Account::ClientAccount
- Extended by:
- ClientAccount
- Included in:
- ClientAccount
- Defined in:
- lib/uu/fairpay2/client_account.rb
Overview
Module of Client Account This service allows managing Client Account.
Constant Summary
- PATH =
Service path
'uu/fairpay2/account/ClientAccount'
Instance Method Summary (collapse)
-
- (UU::OS::UESURI) create(location_uri, client_account = nil)
Creates a new Client Account.
-
- (UU::FairPay2::Account::ClientAccountAttributes) get_attributes(client_account_uri)
Obtains Client Account attributes from REST service and returns them.
-
- (UU::OS::UESURI) set_attributes(client_account_uri, client_account_set_attributes = nil)
Sets attributes of Client Account.
Instance Method Details
- (UU::OS::UESURI) create(location_uri, client_account = nil)
Creates a new Client Account. The command creates a new Client Account in a
specified location with passed DTO parameters.
Required
attributes:
name, meta_artifact_uri, company_uri, account_number, account_currency, registered_account
67 68 69 70 71 72 73 74 75 |
# File 'lib/uu/fairpay2/client_account.rb', line 67 def create(location_uri, client_account = nil) svc = UU::OS::REST::RemoteClient.new(ClientAccount) client_account_create = UU::Fairpay2::Account::ClientAccountCreate.new(client_account).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('create', location_uri, client_account_create) return UU::OS::UESURI.new(res) end end |
- (UU::FairPay2::Account::ClientAccountAttributes) get_attributes(client_account_uri)
Obtains Client Account attributes from REST service and returns them
90 91 92 93 94 95 96 |
# File 'lib/uu/fairpay2/client_account.rb', line 90 def get_attributes(client_account_uri) svc = UU::OS::REST::RemoteClient.new(ClientAccount) UU::OS::QoS::QoSHandler.auto_retry do attrs = svc.get('getAttributes', client_account_uri) return UU::Fairpay2::Account::ClientAccountAttributes.new(attrs) end end |
- (UU::OS::UESURI) set_attributes(client_account_uri, client_account_set_attributes = nil)
Sets attributes of Client Account.
125 126 127 128 129 130 131 132 133 |
# File 'lib/uu/fairpay2/client_account.rb', line 125 def set_attributes(client_account_uri, client_account_set_attributes = nil) svc = UU::OS::REST::RemoteClient.new(ClientAccount) ca_attrs = UU::Fairpay2::Account::ClientAccountSetAttributes.new(client_account_set_attributes).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', client_account_uri, ca_attrs) return UU::OS::UESURI.new(res) end end |