Class: RocketGate::Authorization

Inherits:
Object
  • Object
show all
Defined in:
lib/rocketgate/authorization.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#approved_amountObject

Returns the value of attribute approved_amount.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def approved_amount
  @approved_amount
end

#approved_currencyObject

Returns the value of attribute approved_currency.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def approved_currency
  @approved_currency
end

#auth_codeObject

Returns the value of attribute auth_code.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def auth_code
  @auth_code
end

#avs_responseObject

Returns the value of attribute avs_response.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def avs_response
  @avs_response
end

#card_countryObject

Returns the value of attribute card_country.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def card_country
  @card_country
end

#card_descriptionObject

Returns the value of attribute card_description.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def card_description
  @card_description
end

#card_expirationObject

Returns the value of attribute card_expiration.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def card_expiration
  @card_expiration
end

#card_hashObject

Returns the value of attribute card_hash.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def card_hash
  @card_hash
end

#card_last_fourObject

Returns the value of attribute card_last_four.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def card_last_four
  @card_last_four
end

#card_typeObject

Returns the value of attribute card_type.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def card_type
  @card_type
end

#customer_idObject

Returns the value of attribute customer_id.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def customer_id
  @customer_id
end

#cvv_responseObject

Returns the value of attribute cvv_response.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def cvv_response
  @cvv_response
end

#issuer_nameObject

Returns the value of attribute issuer_name.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def issuer_name
  @issuer_name
end

#issuer_networkObject

Returns the value of attribute issuer_network.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def issuer_network
  @issuer_network
end

#issuer_phoneObject

Returns the value of attribute issuer_phone.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def issuer_phone
  @issuer_phone
end

#issuer_urlObject

Returns the value of attribute issuer_url.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def issuer_url
  @issuer_url
end

#reason_codeObject

Returns the value of attribute reason_code.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def reason_code
  @reason_code
end

#reference_idObject

Returns the value of attribute reference_id.



3
4
5
# File 'lib/rocketgate/authorization.rb', line 3

def reference_id
  @reference_id
end

Instance Method Details

#avs_ok?Boolean

Returns:

  • (Boolean)


9
10
11
12
13
14
15
# File 'lib/rocketgate/authorization.rb', line 9

def avs_ok?
  if RocketGate.configuration.require_avs
    RocketGate::ResponseCode::AVS_SUCCESSES.include?(avs_response)
  else
    true
  end
end

#cvv_ok?Boolean

Returns:

  • (Boolean)


17
18
19
20
21
22
23
# File 'lib/rocketgate/authorization.rb', line 17

def cvv_ok?
  if RocketGate.configuration.require_cvv
    RocketGate::ResponseCode::CVV_SUCCESSES.include?(cvv_response)
  else
    true
  end
end

#declined?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/rocketgate/authorization.rb', line 25

def declined?
  !success?
end

#success?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/rocketgate/authorization.rb', line 29

def success?
  avs_ok? && cvv_ok? && reason_code == :success
end