Class: Payment::AuthorizeNet
Constant Summary collapse
- API_VERSION =
version of the gateway’s API
'3.1'
Instance Attribute Summary collapse
-
#avs_code ⇒ Object
readonly
Returns the value of attribute avs_code.
-
#cavv_response ⇒ Object
readonly
Returns the value of attribute cavv_response.
-
#cvv2_response ⇒ Object
readonly
Returns the value of attribute cvv2_response.
-
#description ⇒ Object
Returns the value of attribute description.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#invoice_num ⇒ Object
Returns the value of attribute invoice_num.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#md5 ⇒ Object
readonly
Returns the value of attribute md5.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#server_response ⇒ Object
readonly
Returns the value of attribute server_response.
-
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
-
#transaction_key ⇒ Object
Returns the value of attribute transaction_key.
Attributes inherited from Base
#account_number, #action, #address, #amount, #authorization, #bank_name, #card_number, #city, #country, #customer_id, #email, #error_code, #error_message, #expiration, #fax, #invoice_number, #login, #method, #name, #password, #phone, #require_avs, #response, #result_code, #routing_code, #state, #test_transaction, #transaction_type, #type, #url, #zip
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ AuthorizeNet
constructor
:login => ‘username’, :password => ‘password’, :amount => ‘49.95’, :card_number => ‘4012888818888’, :expiration => ‘03/10’, :first_name => ‘John’, :last_name => ‘Doe’ ).
-
#submit ⇒ Object
Submit the order to be processed.
Methods inherited from Base
Constructor Details
#initialize(options = {}) ⇒ AuthorizeNet
:login => ‘username’,
:password => 'password',
:amount => '49.95',
:card_number => '4012888818888',
:expiration => '03/10',
:first_name => 'John',
:last_name => 'Doe'
)
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/payment/authorize_net.rb', line 30 def initialize( = {}) # set some sensible defaults @url = 'https://secure.authorize.net/gateway/transact.dll' @delim_data = 'TRUE' @relay_response = 'FALSE' @version = API_VERSION # include all provided data super end |
Instance Attribute Details
#avs_code ⇒ Object (readonly)
Returns the value of attribute avs_code.
13 14 15 |
# File 'lib/payment/authorize_net.rb', line 13 def avs_code @avs_code end |
#cavv_response ⇒ Object (readonly)
Returns the value of attribute cavv_response.
13 14 15 |
# File 'lib/payment/authorize_net.rb', line 13 def cavv_response @cavv_response end |
#cvv2_response ⇒ Object (readonly)
Returns the value of attribute cvv2_response.
13 14 15 |
# File 'lib/payment/authorize_net.rb', line 13 def cvv2_response @cvv2_response end |
#description ⇒ Object
Returns the value of attribute description.
14 15 16 |
# File 'lib/payment/authorize_net.rb', line 14 def description @description end |
#first_name ⇒ Object
Returns the value of attribute first_name.
14 15 16 |
# File 'lib/payment/authorize_net.rb', line 14 def first_name @first_name end |
#invoice_num ⇒ Object
Returns the value of attribute invoice_num.
14 15 16 |
# File 'lib/payment/authorize_net.rb', line 14 def invoice_num @invoice_num end |
#last_name ⇒ Object
Returns the value of attribute last_name.
14 15 16 |
# File 'lib/payment/authorize_net.rb', line 14 def last_name @last_name end |
#md5 ⇒ Object (readonly)
Returns the value of attribute md5.
13 14 15 |
# File 'lib/payment/authorize_net.rb', line 13 def md5 @md5 end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
13 14 15 |
# File 'lib/payment/authorize_net.rb', line 13 def order_number @order_number end |
#server_response ⇒ Object (readonly)
Returns the value of attribute server_response.
13 14 15 |
# File 'lib/payment/authorize_net.rb', line 13 def server_response @server_response end |
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
14 15 16 |
# File 'lib/payment/authorize_net.rb', line 14 def transaction_id @transaction_id end |
#transaction_key ⇒ Object
Returns the value of attribute transaction_key.
14 15 16 |
# File 'lib/payment/authorize_net.rb', line 14 def transaction_key @transaction_key end |
Instance Method Details
#submit ⇒ Object
Submit the order to be processed. If it is not fulfilled for any reason this method will raise an exception.
43 44 45 46 47 |
# File 'lib/payment/authorize_net.rb', line 43 def submit set_post_data get_response @url parse_response end |