Class: Payment::Base
- Inherits:
-
Object
- Object
- Payment::Base
- Defined in:
- lib/payment/base.rb
Direct Known Subclasses
Constant Summary collapse
- @@required =
[]
Instance Attribute Summary collapse
-
#account_number ⇒ Object
Returns the value of attribute account_number.
-
#action ⇒ Object
Returns the value of attribute action.
-
#address ⇒ Object
Returns the value of attribute address.
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#authorization ⇒ Object
readonly
Returns the value of attribute authorization.
-
#bank_name ⇒ Object
Returns the value of attribute bank_name.
-
#card_number ⇒ Object
Returns the value of attribute card_number.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#customer_id ⇒ Object
Returns the value of attribute customer_id.
-
#description ⇒ Object
Returns the value of attribute description.
-
#email ⇒ Object
Returns the value of attribute email.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#expiration ⇒ Object
Returns the value of attribute expiration.
-
#fax ⇒ Object
Returns the value of attribute fax.
-
#invoice_number ⇒ Object
Returns the value of attribute invoice_number.
-
#login ⇒ Object
Returns the value of attribute login.
-
#name ⇒ Object
Returns the value of attribute name.
-
#password ⇒ Object
Returns the value of attribute password.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#require_avs ⇒ Object
Returns the value of attribute require_avs.
-
#result_code ⇒ Object
readonly
Returns the value of attribute result_code.
-
#routing_code ⇒ Object
Returns the value of attribute routing_code.
-
#state ⇒ Object
Returns the value of attribute state.
-
#strict_ssl ⇒ Object
Returns the value of attribute strict_ssl.
-
#test_transaction ⇒ Object
Returns the value of attribute test_transaction.
-
#transaction_type ⇒ Object
readonly
Returns the value of attribute transaction_type.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
-
#zip ⇒ Object
Returns the value of attribute zip.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
- #submit ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
20 21 22 23 24 25 26 27 |
# File 'lib/payment/base.rb', line 20 def initialize( = {}) # set some sensible defaults @strict_ssl = true @action = 'credit' # include all provided data .each { |method, value| eval "@#{method} = '#{value}'" if methods.include? "#{method}=" } end |
Instance Attribute Details
#account_number ⇒ Object
Returns the value of attribute account_number.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def account_number @account_number end |
#action ⇒ Object
Returns the value of attribute action.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def action @action end |
#address ⇒ Object
Returns the value of attribute address.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def address @address end |
#amount ⇒ Object
Returns the value of attribute amount.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def amount @amount end |
#authorization ⇒ Object (readonly)
Returns the value of attribute authorization.
13 14 15 |
# File 'lib/payment/base.rb', line 13 def @authorization end |
#bank_name ⇒ Object
Returns the value of attribute bank_name.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def bank_name @bank_name end |
#card_number ⇒ Object
Returns the value of attribute card_number.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def card_number @card_number end |
#city ⇒ Object
Returns the value of attribute city.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def country @country end |
#customer_id ⇒ Object
Returns the value of attribute customer_id.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def customer_id @customer_id end |
#description ⇒ Object
Returns the value of attribute description.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def description @description end |
#email ⇒ Object
Returns the value of attribute email.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def email @email end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
13 14 15 |
# File 'lib/payment/base.rb', line 13 def @error_message end |
#expiration ⇒ Object
Returns the value of attribute expiration.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def expiration @expiration end |
#fax ⇒ Object
Returns the value of attribute fax.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def fax @fax end |
#invoice_number ⇒ Object
Returns the value of attribute invoice_number.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def invoice_number @invoice_number end |
#login ⇒ Object
Returns the value of attribute login.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def login @login end |
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def name @name end |
#password ⇒ Object
Returns the value of attribute password.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def password @password end |
#phone ⇒ Object
Returns the value of attribute phone.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def phone @phone end |
#require_avs ⇒ Object
Returns the value of attribute require_avs.
15 16 17 |
# File 'lib/payment/base.rb', line 15 def require_avs @require_avs end |
#result_code ⇒ Object (readonly)
Returns the value of attribute result_code.
13 14 15 |
# File 'lib/payment/base.rb', line 13 def result_code @result_code end |
#routing_code ⇒ Object
Returns the value of attribute routing_code.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def routing_code @routing_code end |
#state ⇒ Object
Returns the value of attribute state.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def state @state end |
#strict_ssl ⇒ Object
Returns the value of attribute strict_ssl.
15 16 17 |
# File 'lib/payment/base.rb', line 15 def strict_ssl @strict_ssl end |
#test_transaction ⇒ Object
Returns the value of attribute test_transaction.
15 16 17 |
# File 'lib/payment/base.rb', line 15 def test_transaction @test_transaction end |
#transaction_type ⇒ Object (readonly)
Returns the value of attribute transaction_type.
13 14 15 |
# File 'lib/payment/base.rb', line 13 def transaction_type @transaction_type end |
#type ⇒ Object
Returns the value of attribute type.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
14 15 16 |
# File 'lib/payment/base.rb', line 14 def url @url end |
#zip ⇒ Object
Returns the value of attribute zip.
16 17 18 |
# File 'lib/payment/base.rb', line 16 def zip @zip end |
Instance Method Details
#submit ⇒ Object
29 30 31 |
# File 'lib/payment/base.rb', line 29 def submit raise PaymentError, "No gateway specified" end |
#success? ⇒ Boolean
33 34 35 |
# File 'lib/payment/base.rb', line 33 def success? @is_success ? true : false end |