Module: UU::Finman::FinancialTransaction::PaymentCopy

Extended by:
PaymentCopy
Included in:
PaymentCopy
Defined in:
lib/uu/finman/payment_copy.rb

Overview

Module of Payment copy

Constant Summary

PATH =

Service path

'uu/finman/financialtransaction/FinancialTransaction'

Instance Method Summary (collapse)

Instance Method Details

- (PaymentCopyAttributes) get_attributes(payment_copy_uri)

Obtains Payment copy attributes from service and returns them

Examples:

# Prepare Payment copy location which we want get attributes.
payment_uri = UU::OS::UESURI.new('ues:TERRITORY:PAYMENT_COPY');

# Get Payment
UU::Finman::FinancialTransaction::PaymentCopy.get_attributes(payment_uri);

Parameters:

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

    UESURI of the Payment

Returns:



33
34
35
36
37
38
39
40
41
# File 'lib/uu/finman/payment_copy.rb', line 33

def get_attributes(payment_copy_uri)
  svc = UU::OS::REST::RemoteClient.new(PaymentCopy)
  UU::OS::QoS::QoSHandler.auto_retry do
    attrs_string = svc.get('getAttributes', payment_copy_uri)
    attrs = JSON.parse(attrs_string, :symbolize_names => true)
    attrs = remove_invalid_keys(attrs)
    return UU::Finman::FinancialTransaction::PaymentCopyAttributes.new(attrs)
  end
end

- (UU::OS::UESURI) set_attributes(payment_copy_uri, payment_copy_set_attributes)

Sets attributes of Payment copy.

Examples:

# Prepare Payment copy location which we want set attributes.
payment_uri = UU::OS::UESURI.new('ues:TERRITORY:PAYMENT_COPY');

# Set Payment copy
UU::Finman::FinancialTransaction::PaymentCopy.set_attributes(payment_copy_uri,
  :name => "Payment copy set",
  :related_links => "[["ues:[TERRITORY_OID]:[FIN_TR_OID]:","label 1"],["ues:[TERRITORY_OID]:[FIN_TR_OID]:","label 2"]]");

Parameters:

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

    UESURI of modified Payment copy

  • payment_copy_set_attributes (PaymentCopySetAttributes)

    DTO containing modified attributes of the Payment copy

Returns:

  • (UU::OS::UESURI)

    UESURI of modified Payment copy



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/uu/finman/payment_copy.rb', line 59

def set_attributes(payment_copy_uri, payment_copy_set_attributes)
  svc = UU::OS::REST::RemoteClient.new(PaymentCopy)
  payment_copy_dto = UU::Finman::FinancialTransaction::PaymentCopySetAttributes.new(payment_copy_set_attributes)

  # adjust given payment dto to match expected format of financial transaction command
  payment_copy_dto = transform_modify_payment_to_transaction_dto(payment_copy_dto)
  payment_copy_dto = payment_copy_dto.to_json

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