Class: Giact::TransactionResult

Inherits:
Object
  • Object
show all
Defined in:
lib/giact/transaction_result.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(row = "") ⇒ TransactionResult

Returns a new instance of TransactionResult.



45
46
47
# File 'lib/giact/transaction_result.rb', line 45

def initialize(row="")
  @transaction_id,  @timestamp,  @error,  @pass,  @details,  @customer_id,  @order_id,  @name_on_check,  @address_line_1,  @address_line_2,  @address_line_3,  @name_of_bank,  @routing_number,  @account_number,  @check_number,  @amount,  @is_recurring,  @recurring_amount,  @recurring_frequency,  @recurring_start_date,  @is_installments,  @installments_count,  @installment_amount,  @installments_start_date,  @returned,  @returned_date,  @returned_reason,  @returned_reason_code,  @refunded,  @refund_date,  @refund_transaction_id,  @refund_customer_id,  @refund_order_id,  @payable_to,  @refund_address_line_1,  @refund_address_line_2,  @refund_address_line_3,  @original_amount,  @refund_amount,  @refund_check_number,  @refund_account_number = row.split("|")
end

Instance Attribute Details

#account_numberObject (readonly)

Returns the value of attribute account_number.



16
17
18
# File 'lib/giact/transaction_result.rb', line 16

def 
  @account_number
end

#address_line_1Object (readonly)

Returns the value of attribute address_line_1.



11
12
13
# File 'lib/giact/transaction_result.rb', line 11

def address_line_1
  @address_line_1
end

#address_line_2Object (readonly)

Returns the value of attribute address_line_2.



12
13
14
# File 'lib/giact/transaction_result.rb', line 12

def address_line_2
  @address_line_2
end

#address_line_3Object (readonly)

Returns the value of attribute address_line_3.



13
14
15
# File 'lib/giact/transaction_result.rb', line 13

def address_line_3
  @address_line_3
end

#amountObject (readonly)

Returns the value of attribute amount.



18
19
20
# File 'lib/giact/transaction_result.rb', line 18

def amount
  @amount
end

#check_numberObject (readonly)

Returns the value of attribute check_number.



17
18
19
# File 'lib/giact/transaction_result.rb', line 17

def check_number
  @check_number
end

#customer_idObject (readonly)

Returns the value of attribute customer_id.



8
9
10
# File 'lib/giact/transaction_result.rb', line 8

def customer_id
  @customer_id
end

#detailsObject (readonly)

Returns the value of attribute details.



7
8
9
# File 'lib/giact/transaction_result.rb', line 7

def details
  @details
end

#errorObject (readonly)

Returns the value of attribute error.



5
6
7
# File 'lib/giact/transaction_result.rb', line 5

def error
  @error
end

#installment_amountObject (readonly)

Returns the value of attribute installment_amount.



25
26
27
# File 'lib/giact/transaction_result.rb', line 25

def installment_amount
  @installment_amount
end

#installments_countObject (readonly)

Returns the value of attribute installments_count.



24
25
26
# File 'lib/giact/transaction_result.rb', line 24

def installments_count
  @installments_count
end

#installments_start_dateObject (readonly)

Returns the value of attribute installments_start_date.



26
27
28
# File 'lib/giact/transaction_result.rb', line 26

def installments_start_date
  @installments_start_date
end

#is_installmentsObject (readonly)

Returns the value of attribute is_installments.



23
24
25
# File 'lib/giact/transaction_result.rb', line 23

def is_installments
  @is_installments
end

#is_recurringObject (readonly)

Returns the value of attribute is_recurring.



19
20
21
# File 'lib/giact/transaction_result.rb', line 19

def is_recurring
  @is_recurring
end

#name_of_bankObject (readonly)

Returns the value of attribute name_of_bank.



14
15
16
# File 'lib/giact/transaction_result.rb', line 14

def name_of_bank
  @name_of_bank
end

#name_on_checkObject (readonly)

Returns the value of attribute name_on_check.



10
11
12
# File 'lib/giact/transaction_result.rb', line 10

def name_on_check
  @name_on_check
end

#order_idObject (readonly)

Returns the value of attribute order_id.



9
10
11
# File 'lib/giact/transaction_result.rb', line 9

def order_id
  @order_id
end

#original_amountObject (readonly)

Returns the value of attribute original_amount.



40
41
42
# File 'lib/giact/transaction_result.rb', line 40

def original_amount
  @original_amount
end

#passObject (readonly)

Returns the value of attribute pass.



6
7
8
# File 'lib/giact/transaction_result.rb', line 6

def pass
  @pass
end

#payable_toObject (readonly)

Returns the value of attribute payable_to.



36
37
38
# File 'lib/giact/transaction_result.rb', line 36

def payable_to
  @payable_to
end

#recurring_amountObject (readonly)

Returns the value of attribute recurring_amount.



20
21
22
# File 'lib/giact/transaction_result.rb', line 20

def recurring_amount
  @recurring_amount
end

#recurring_frequencyObject (readonly)

Returns the value of attribute recurring_frequency.



21
22
23
# File 'lib/giact/transaction_result.rb', line 21

def recurring_frequency
  @recurring_frequency
end

#recurring_start_dateObject (readonly)

Returns the value of attribute recurring_start_date.



22
23
24
# File 'lib/giact/transaction_result.rb', line 22

def recurring_start_date
  @recurring_start_date
end

#refund_account_numberObject (readonly)

Returns the value of attribute refund_account_number.



43
44
45
# File 'lib/giact/transaction_result.rb', line 43

def 
  @refund_account_number
end

#refund_address_line_1Object (readonly)

Returns the value of attribute refund_address_line_1.



37
38
39
# File 'lib/giact/transaction_result.rb', line 37

def refund_address_line_1
  @refund_address_line_1
end

#refund_address_line_2Object (readonly)

Returns the value of attribute refund_address_line_2.



38
39
40
# File 'lib/giact/transaction_result.rb', line 38

def refund_address_line_2
  @refund_address_line_2
end

#refund_address_line_3Object (readonly)

Returns the value of attribute refund_address_line_3.



39
40
41
# File 'lib/giact/transaction_result.rb', line 39

def refund_address_line_3
  @refund_address_line_3
end

#refund_amountObject (readonly)

Returns the value of attribute refund_amount.



41
42
43
# File 'lib/giact/transaction_result.rb', line 41

def refund_amount
  @refund_amount
end

#refund_check_numberObject (readonly)

Returns the value of attribute refund_check_number.



42
43
44
# File 'lib/giact/transaction_result.rb', line 42

def refund_check_number
  @refund_check_number
end

#refund_customer_idObject (readonly)

Returns the value of attribute refund_customer_id.



34
35
36
# File 'lib/giact/transaction_result.rb', line 34

def refund_customer_id
  @refund_customer_id
end

#refund_dateObject (readonly)

Returns the value of attribute refund_date.



32
33
34
# File 'lib/giact/transaction_result.rb', line 32

def refund_date
  @refund_date
end

#refund_order_idObject (readonly)

Returns the value of attribute refund_order_id.



35
36
37
# File 'lib/giact/transaction_result.rb', line 35

def refund_order_id
  @refund_order_id
end

#refund_transaction_idObject (readonly)

Returns the value of attribute refund_transaction_id.



33
34
35
# File 'lib/giact/transaction_result.rb', line 33

def refund_transaction_id
  @refund_transaction_id
end

#refundedObject (readonly)

Returns the value of attribute refunded.



31
32
33
# File 'lib/giact/transaction_result.rb', line 31

def refunded
  @refunded
end

#returnedObject (readonly)

Returns the value of attribute returned.



27
28
29
# File 'lib/giact/transaction_result.rb', line 27

def returned
  @returned
end

#returned_dateObject (readonly)

Returns the value of attribute returned_date.



28
29
30
# File 'lib/giact/transaction_result.rb', line 28

def returned_date
  @returned_date
end

#returned_reasonObject (readonly)

Returns the value of attribute returned_reason.



29
30
31
# File 'lib/giact/transaction_result.rb', line 29

def returned_reason
  @returned_reason
end

#returned_reason_codeObject (readonly)

Returns the value of attribute returned_reason_code.



30
31
32
# File 'lib/giact/transaction_result.rb', line 30

def returned_reason_code
  @returned_reason_code
end

#routing_numberObject (readonly)

Returns the value of attribute routing_number.



15
16
17
# File 'lib/giact/transaction_result.rb', line 15

def routing_number
  @routing_number
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



4
5
6
# File 'lib/giact/transaction_result.rb', line 4

def timestamp
  @timestamp
end

#transaction_idObject (readonly)

Returns the value of attribute transaction_id.



3
4
5
# File 'lib/giact/transaction_result.rb', line 3

def transaction_id
  @transaction_id
end

Class Method Details

.from_response(response) ⇒ Object



109
110
111
# File 'lib/giact/transaction_result.rb', line 109

def self.from_response(response)
  response.split(/\n/).map{|line| Giact::TransactionResult.new(line)}
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


101
102
103
# File 'lib/giact/transaction_result.rb', line 101

def error?
  @error.to_s.downcase == "true"
end

#is_recurring?Boolean

Returns:

  • (Boolean)


93
94
95
# File 'lib/giact/transaction_result.rb', line 93

def is_recurring?
  @is_recurring.to_s.downcase == "true"
end

#pass?Boolean

Returns:

  • (Boolean)


105
106
107
# File 'lib/giact/transaction_result.rb', line 105

def pass?
  @pass.to_s.downcase == "true"
end

#refund_routing_numberObject



81
82
83
# File 'lib/giact/transaction_result.rb', line 81

def refund_routing_number
  @refund_routing_number.to_i
end