Class: SecureTrading::Requests::Authorisation

Inherits:
SecureTrading::Request show all
Defined in:
lib/secure_trading/requests/authorisation.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/authorisation.rb', line 5

def amount
  @amount
end

#currencyObject

Returns the value of attribute currency.



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

def currency
  @currency
end

#customerObject

Returns the value of attribute customer.



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

def customer
  @customer
end

#orderObject

Returns the value of attribute order.



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

def order
  @order
end

#payment_methodObject

Returns the value of attribute payment_method.



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

def payment_method
  @payment_method
end

#settlement_dayObject

Returns the value of attribute settlement_day.



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

def settlement_day
  @settlement_day
end

Instance Method Details

#request_typeObject



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

def request_type
  'AUTH'
end

#to_hashObject



11
12
13
14
15
16
17
18
# File 'lib/secure_trading/requests/authorisation.rb', line 11

def to_hash
  {
    'Operation' => {'SiteReference' => self.connection.site_reference, 'Amount' => self.amount, 'Currency' => self.currency || 'GBP', 'SettlementDay' => self.settlement_day || 1 },
    'CustomerInfo' => customer,
    'PaymentMethod' => {'CreditCard' => payment_method },
    'Order' => order
  }
end