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)

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

Examples:

# Prepare Folder or Organization Unit URI, where we want to create Client Account.
location_uri = UU::OS::UESURI.new('ues:TERRITORY:FOLDER_OR_ORG_UNIT');

# Create Client Account
UU::Fairpay2::Account::ClientAccount.create(location_uri,
  :name => "Name",
  :meta_artifact_uri => UU::OS::UESURI.new('ues:TERRITORY:META_ARTIFACT_CLIENT_ACCOUNT'),
  :account_number => "12345/666",
  :account_currency => "CZK",
  :company_uri => UU::OS::UESURI.new('ues:TERRITORY:ARTIFACT_COMPANY'),
  :registered_account => "true");

Parameters:

  • location_uri (UU::OS::UESURI)

    UESURI of the folder/org. unit/meta model where client account will be created.

  • client_account (UU::Fairpay2::Account::ClientAccountCreate) (defaults to: nil)

    containing attributes of the new Client Account.

Options Hash (client_account):

  • :name (String)

    Name of created client account. Cannot be null nor empty string nor longer than 250 characters and can contain only allowed characters.

  • :meta_artifact_uri (String, UU::OS::UESURI)

    UESURI of meta artifact of created Client Account. Required attribute, cannot be null and must be valid UESURI.

  • :company_uri (String, UU::OS::UESURI)

    URI of Company. Required attribute, cannot be null and must be valid UESURI.

  • :account_number (String)

    Account number for created client account. Required attribute, cannot be null, empty, whitespace only or longer than 250 characters.

  • :account_currency (String)

    Account currency for created client account. Required attribute, cannot be null, empty, whitespace only or longer than 250 characters.

  • :code (String)

    Code of created client account. The code must be unique in target territory. It cannot be empty string nor longer than 250 characters and can contain only allowed characters.

  • :description (String)

    Description of created client account. Must not be empty string, must not contain whitespace characters only and must not be longer than 4000 characters.

  • :competent_role_uri (String, UU::OS::UESURI)

    UESURI of the role competent for created client account. Must be valid UESURI.

  • :security_level (String, UU::OS::Artifact::SecurityLevel)

    Security level.

  • :dry_run (TrueClass, FalseClass)

    Specifies whether this is only a test run to verify that the object can be created. The default value is false.

  • :registered_account (TrueClass, FalseClass)

    Registered Account. Required attribute, must be valid true/false value.

  • :bank_orders_owner_uri (String, UU::OS::UESURI)

    UESURI of role competent for created Bank Orders. Must be valid UESURI.

  • :bank_orders_folder_uri (String, UU::OS::UESURI)

    UESURI of folder, where created Bank Orders. Must be valid UESURI.

  • :max_referenced_bank_orders_number (Fixnum)

    Maximal number of referenced Bank Orders. Cannot invalid Fixnum.

  • :max_num_payments_in_bo_art (Fixnum)

    Maximal number of payments which can contain one Bank Orders artifact. Cannot invalid Fixnum.

  • :exp_paydate_days_in_future_for_bo (Fixnum)

    Maximal expected Days in future for bank orders. Cannot invalid Fixnum.

  • :debit_tellers_manager_uri (String, UU::OS::UESURI)

    UESURI of Debit Teller’s Manager role. Must be valid UESURI.

  • :debit_teller_uri (String, UU::OS::UESURI)

    UESURI of Debit Teller role. Must be valid UESURI.

  • :outgoing_payment_checkers_manager_uri (String, UU::OS::UESURI)

    UESURI of Outgoing Payment Checker’s Manager role. Must be valid UESURI.

  • :outgoing_payment_checker_uri (String, UU::OS::UESURI)

    UESURI of Outgoing Payment Checker role. Must be valid UESURI.

  • :incoming_payment_checkers_manager_uri (String, UU::OS::UESURI)

    UESURI of Incoming Payment Checker’s Manager role. Must be valid UESURI.

  • :incoming_payment_checker_uri (String, UU::OS::UESURI)

    UESURI of Incoming Payment Checker role. Must be valid UESURI.

Returns:

  • (UU::OS::UESURI)

    UESURI of the new Client Account. In case of setting dry_run parameter to true, UU::OS::UESURI::NIL_URI is returned instead.



67
68
69
70
71
72
73
74
75
# File 'lib/uu/fairpay2/client_account.rb', line 67

def create(location_uri,  = nil)
  svc = UU::OS::REST::RemoteClient.new(ClientAccount)
   = UU::Fairpay2::Account::ClientAccountCreate.new().to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('create', location_uri, )
    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

Examples:

# Prepare Client Account URI, where we want to get attributes.
 = UU::OS::UESURI.new('ues:TERRITORY:CLIENT_ACCOUNT');

# Get Client Account attributes
UU::Fairpay2::Account::ClientAccount.get_attributes();

Parameters:

  • client_account_uri (String, UU::OS::UESURI)

    UESURI of Client Account.

Returns:

  • (UU::FairPay2::Account::ClientAccountAttributes)

    Client Account attributes



90
91
92
93
94
95
96
# File 'lib/uu/fairpay2/client_account.rb', line 90

def get_attributes()
  svc = UU::OS::REST::RemoteClient.new(ClientAccount)
  UU::OS::QoS::QoSHandler.auto_retry do
    attrs = svc.get('getAttributes', )
    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.

Examples:

# Prepare Client Account URI, where we want to set attributes.
 = UU::OS::UESURI.new('ues:TERRITORY:CLIENT_ACCOUNT');

# Set Client Account attributes
UU::Fairpay2::Account::ClientAccount.set_attributes(,
  :name => "Name");

Parameters:

  • client_account_uri (String, UU::OS::UESURI)

    UESURI of modified Client Account.

  • client_account_set_attributes (UU::Fairpay2::Account::ClientAccountSetAttributes) (defaults to: nil)

    DTO containing modified attributes of the Client Account.

  • client_account (Hash)

    a customizable set of options

Returns:

  • (UU::OS::UESURI)

    UESURI of modified Client Account



125
126
127
128
129
130
131
132
133
# File 'lib/uu/fairpay2/client_account.rb', line 125

def set_attributes(,  = nil)
  svc = UU::OS::REST::RemoteClient.new(ClientAccount)
  ca_attrs = UU::Fairpay2::Account::ClientAccountSetAttributes.new().to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('setAttributes', , ca_attrs)
    return UU::OS::UESURI.new(res)
  end
end