Class: SecureTrading::Requests::Settlement

Inherits:
SecureTrading::Request show all
Defined in:
lib/secure_trading/requests/settlement.rb

Instance Attribute Summary collapse

Attributes inherited from SecureTrading::Request

#connection, #response

Instance Method Summary collapse

Methods inherited from SecureTrading::Request

#error_message, #initialize, #process, #sanitized_xml_request, #xml_request

Constructor Details

This class inherits a constructor from SecureTrading::Request

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



5
6
7
# File 'lib/secure_trading/requests/settlement.rb', line 5

def amount
  @amount
end

#dateObject

Returns the value of attribute date.



5
6
7
# File 'lib/secure_trading/requests/settlement.rb', line 5

def date
  @date
end

#statusObject

Returns the value of attribute status.



5
6
7
# File 'lib/secure_trading/requests/settlement.rb', line 5

def status
  @status
end

#transaction_referenceObject

Returns the value of attribute transaction_reference.



5
6
7
# File 'lib/secure_trading/requests/settlement.rb', line 5

def transaction_reference
  @transaction_reference
end

Instance Method Details

#request_typeObject



7
8
9
# File 'lib/secure_trading/requests/settlement.rb', line 7

def request_type
  'SETTLEMENT'
end

#to_hashObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/secure_trading/requests/settlement.rb', line 11

def to_hash
  {
    'Operation' => {
      'SiteReference' => self.connection.site_reference, 
      'TransactionReference' => self.transaction_reference,
      'SettleDate' => self.date || 'NEXT',
      'SettleStatus' => self.status.to_i,
      'SettleAmount' => self.amount
    },
  }
end