Class: Payment::Base
- Inherits:
-
Object
- Object
- Payment::Base
- Defined in:
- lib/payment/base.rb
Direct Known Subclasses
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_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#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.
-
#method ⇒ Object
Returns the value of attribute method.
-
#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.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#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.
-
#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.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
Set the variables and get default variables from the :prefs file.
-
#submit ⇒ Object
:nodoc:.
Constructor Details
#initialize(options = {}) ⇒ Base
Set the variables and get default variables from the :prefs file. This method will be overriden by each gateway to set sensible defaults for each gateway.
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/payment/base.rb', line 16 def initialize( = {}) #:nodoc: # set some sensible defaults @type = 'normal authorization' # get defaults from a preference file prefs = File.([:prefs] || "~/.payment.yml") YAML.load(File.open(prefs)).each {|pref, value| instance_variable_set("@#{pref}", value) } if File.exists?(prefs) # include all provided data .each { |pref, value| instance_variable_set("@#{pref}", value) } @required = Array.new end |
Instance Attribute Details
#account_number ⇒ Object
Returns the value of attribute account_number.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def account_number @account_number end |
#action ⇒ Object
Returns the value of attribute action.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def action @action end |
#address ⇒ Object
Returns the value of attribute address.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def address @address end |
#amount ⇒ Object
Returns the value of attribute amount.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def amount @amount end |
#authorization ⇒ Object (readonly)
Returns the value of attribute authorization.
7 8 9 |
# File 'lib/payment/base.rb', line 7 def @authorization end |
#bank_name ⇒ Object
Returns the value of attribute bank_name.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def bank_name @bank_name end |
#card_number ⇒ Object
Returns the value of attribute card_number.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def card_number @card_number end |
#city ⇒ Object
Returns the value of attribute city.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def country @country end |
#customer_id ⇒ Object
Returns the value of attribute customer_id.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def customer_id @customer_id end |
#description ⇒ Object
Returns the value of attribute description.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def description @description end |
#email ⇒ Object
Returns the value of attribute email.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def email @email end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
7 8 9 |
# File 'lib/payment/base.rb', line 7 def error_code @error_code end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
7 8 9 |
# File 'lib/payment/base.rb', line 7 def @error_message end |
#expiration ⇒ Object
Returns the value of attribute expiration.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def expiration @expiration end |
#fax ⇒ Object
Returns the value of attribute fax.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def fax @fax end |
#invoice_number ⇒ Object
Returns the value of attribute invoice_number.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def invoice_number @invoice_number end |
#login ⇒ Object
Returns the value of attribute login.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def login @login end |
#method ⇒ Object
Returns the value of attribute method.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def method @method end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def name @name end |
#password ⇒ Object
Returns the value of attribute password.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def password @password end |
#phone ⇒ Object
Returns the value of attribute phone.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def phone @phone end |
#require_avs ⇒ Object
Returns the value of attribute require_avs.
9 10 11 |
# File 'lib/payment/base.rb', line 9 def require_avs @require_avs end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
7 8 9 |
# File 'lib/payment/base.rb', line 7 def response @response end |
#result_code ⇒ Object (readonly)
Returns the value of attribute result_code.
7 8 9 |
# File 'lib/payment/base.rb', line 7 def result_code @result_code end |
#routing_code ⇒ Object
Returns the value of attribute routing_code.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def routing_code @routing_code end |
#state ⇒ Object
Returns the value of attribute state.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def state @state end |
#test_transaction ⇒ Object
Returns the value of attribute test_transaction.
9 10 11 |
# File 'lib/payment/base.rb', line 9 def test_transaction @test_transaction end |
#transaction_type ⇒ Object (readonly)
Returns the value of attribute transaction_type.
7 8 9 |
# File 'lib/payment/base.rb', line 7 def transaction_type @transaction_type end |
#type ⇒ Object
Returns the value of attribute type.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
8 9 10 |
# File 'lib/payment/base.rb', line 8 def url @url end |
#zip ⇒ Object
Returns the value of attribute zip.
10 11 12 |
# File 'lib/payment/base.rb', line 10 def zip @zip end |
Class Method Details
.plain ⇒ Object
56 |
# File 'lib/payment/base.rb', line 56 def @response.plain; @response_plain; end |
Instance Method Details
#submit ⇒ Object
:nodoc:
30 31 32 |
# File 'lib/payment/base.rb', line 30 def submit #:nodoc: raise PaymentError, "No gateway specified" end |