Class: EWS::Transaction::Request
- Inherits:
-
Object
- Object
- EWS::Transaction::Request
- Includes:
- Validator
- Defined in:
- lib/ews/transaction/request.rb
Overview
The Request class allows you to build transaction requests for submission to the E-xact Web Service.
All requests will result in a financial transaction occurring, with the exception of the :transaction_details
request, which looks up the details of a pre-existing transaction.
The following fields are mandatory on all requests:
:gateway_id the gateway to which this request should be sent
:password your password for that gateway
:transaction_type the type of transaction you want to perform
Different transaction types will have their own additional requirements when it comes to mandatory and optional fields, and it is recommended that the E-xact Web Service Programming Reference Guide, v8.5 be consulted. This document is contained in the Webservice Plugin ZIP file: www.e-xact.com/wp-content/uploads/2007/06/E-xact_Payment_Webservice_Plug-In.zip
Please note that, if your chosen transaction requires it, credit card expiry dates must be entered in MMYY format.
Allowable transaction types
:purchase
:pre_auth
:pre_auth_completion
:forced_post
:refund
:pre_auth_only
:purchase_correction
:refund_correction
:void
:tagged_purchase
:tagged_pre_auth
:tagged_pre_auth_completion
:tagged_void
:tagged_refund
:tagged_online_debit_refund
:tagged_update
:referenced_void
:recurring_seed_pre_auth
:recurring_seed_purchase
:idebit_purchase
:idebit_refund
:secure_storage
:secure_storage_eft
:batch_query
:batch_close
:transaction_details
Constant Summary collapse
- @@transaction_codes =
{ :purchase => '00', :pre_auth => '01', :pre_auth_completion => '02', :forced_post => '03', :refund => '04', :pre_auth_only => '05', :purchase_correction => '11', :refund_correction => '12', :void => '13', :tagged_purchase => '30', :tagged_pre_auth => '31', :tagged_pre_auth_completion => '32', :tagged_void => '33', :tagged_refund => '34', :tagged_online_debit_refund => '35', :referenced_void => '36', :tagged_update => '37', :recurring_seed_pre_auth => '40', :recurring_seed_purchase => '41', :idebit_purchase => '50', :idebit_refund => '54', :secure_storage => '60', :secure_storage_eft => '61', :batch_query => '80', :batch_close => '81', :transaction_details => 'CR' }.freeze
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#authorization_num ⇒ Object
Returns the value of attribute authorization_num.
-
#cardholder_name ⇒ Object
Returns the value of attribute cardholder_name.
-
#cavv ⇒ Object
Returns the value of attribute cavv.
-
#cavv_algorithm ⇒ Object
Returns the value of attribute cavv_algorithm.
-
#cc_expiry ⇒ Object
Returns the value of attribute cc_expiry.
-
#cc_number ⇒ Object
Returns the value of attribute cc_number.
-
#cc_verification_str1 ⇒ Object
AVS - Address Verification,.
-
#cc_verification_str2 ⇒ Object
Returns the value of attribute cc_verification_str2.
-
#client_email ⇒ Object
Returns the value of attribute client_email.
-
#client_ip ⇒ Object
Returns the value of attribute client_ip.
-
#customer_ref ⇒ Object
Returns the value of attribute customer_ref.
-
#cvd_presence_ind ⇒ Object
Returns the value of attribute cvd_presence_ind.
-
#ecommerce_flag ⇒ Object
Returns the value of attribute ecommerce_flag.
-
#errors ⇒ Object
yeah, it’s ugly, but otherwise RDoc won’t pick them up.
-
#gateway_id ⇒ Object
Returns the value of attribute gateway_id.
-
#language ⇒ Object
Returns the value of attribute language.
-
#pan ⇒ Object
Returns the value of attribute pan.
-
#password ⇒ Object
Returns the value of attribute password.
-
#reference_3 ⇒ Object
Returns the value of attribute reference_3.
-
#reference_no ⇒ Object
Returns the value of attribute reference_no.
-
#secure_auth_required ⇒ Object
Returns the value of attribute secure_auth_required.
-
#secure_auth_result ⇒ Object
Returns the value of attribute secure_auth_result.
-
#surcharge_amount ⇒ Object
Returns the value of attribute surcharge_amount.
-
#tax1_amount ⇒ Object
Returns the value of attribute tax1_amount.
-
#tax1_number ⇒ Object
Returns the value of attribute tax1_number.
-
#tax2_amount ⇒ Object
Returns the value of attribute tax2_amount.
-
#tax2_number ⇒ Object
Returns the value of attribute tax2_number.
-
#track1 ⇒ Object
Returns the value of attribute track1.
-
#track2 ⇒ Object
Returns the value of attribute track2.
-
#transaction_tag ⇒ Object
Returns the value of attribute transaction_tag.
-
#transaction_type ⇒ Object
Returns the value of attribute transaction_type.
-
#user_name ⇒ Object
Returns the value of attribute user_name.
-
#xid ⇒ Object
Returns the value of attribute xid.
-
#zip_code ⇒ Object
Returns the value of attribute zip_code.
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ Request
constructor
Initialize a Request with a hash of values.
-
#is_find_transaction? ⇒ Boolean
Indicates whether or not this transaction is a
:transaction_details
transaction.
Methods included from Validator
Constructor Details
#initialize(hash = {}) ⇒ Request
Initialize a Request with a hash of values
76 77 78 79 |
# File 'lib/ews/transaction/request.rb', line 76 def initialize(hash = {}) hash.each {|k,v| self.send "#{k.to_s}=", v} @errors = {} end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
56 57 58 |
# File 'lib/ews/transaction/request.rb', line 56 def amount @amount end |
#authorization_num ⇒ Object
Returns the value of attribute authorization_num.
56 57 58 |
# File 'lib/ews/transaction/request.rb', line 56 def @authorization_num end |
#cardholder_name ⇒ Object
Returns the value of attribute cardholder_name.
56 57 58 |
# File 'lib/ews/transaction/request.rb', line 56 def cardholder_name @cardholder_name end |
#cavv ⇒ Object
Returns the value of attribute cavv.
73 74 75 |
# File 'lib/ews/transaction/request.rb', line 73 def cavv @cavv end |
#cavv_algorithm ⇒ Object
Returns the value of attribute cavv_algorithm.
73 74 75 |
# File 'lib/ews/transaction/request.rb', line 73 def cavv_algorithm @cavv_algorithm end |
#cc_expiry ⇒ Object
Returns the value of attribute cc_expiry.
56 57 58 |
# File 'lib/ews/transaction/request.rb', line 56 def cc_expiry @cc_expiry end |
#cc_number ⇒ Object
Returns the value of attribute cc_number.
56 57 58 |
# File 'lib/ews/transaction/request.rb', line 56 def cc_number @cc_number end |
#cc_verification_str1 ⇒ Object
AVS - Address Verification,
60 61 62 |
# File 'lib/ews/transaction/request.rb', line 60 def cc_verification_str1 @cc_verification_str1 end |
#cc_verification_str2 ⇒ Object
Returns the value of attribute cc_verification_str2.
57 58 59 |
# File 'lib/ews/transaction/request.rb', line 57 def cc_verification_str2 @cc_verification_str2 end |
#client_email ⇒ Object
Returns the value of attribute client_email.
73 74 75 |
# File 'lib/ews/transaction/request.rb', line 73 def client_email @client_email end |
#client_ip ⇒ Object
Returns the value of attribute client_ip.
73 74 75 |
# File 'lib/ews/transaction/request.rb', line 73 def client_ip @client_ip end |
#customer_ref ⇒ Object
Returns the value of attribute customer_ref.
73 74 75 |
# File 'lib/ews/transaction/request.rb', line 73 def customer_ref @customer_ref end |
#cvd_presence_ind ⇒ Object
Returns the value of attribute cvd_presence_ind.
57 58 59 |
# File 'lib/ews/transaction/request.rb', line 57 def cvd_presence_ind @cvd_presence_ind end |
#ecommerce_flag ⇒ Object
Returns the value of attribute ecommerce_flag.
73 74 75 |
# File 'lib/ews/transaction/request.rb', line 73 def ecommerce_flag @ecommerce_flag end |
#errors ⇒ Object
yeah, it’s ugly, but otherwise RDoc won’t pick them up
55 56 57 |
# File 'lib/ews/transaction/request.rb', line 55 def errors @errors end |
#gateway_id ⇒ Object
Returns the value of attribute gateway_id.
56 57 58 |
# File 'lib/ews/transaction/request.rb', line 56 def gateway_id @gateway_id end |
#language ⇒ Object
Returns the value of attribute language.
73 74 75 |
# File 'lib/ews/transaction/request.rb', line 73 def language @language end |
#pan ⇒ Object
Returns the value of attribute pan.
56 57 58 |
# File 'lib/ews/transaction/request.rb', line 56 def pan @pan end |
#password ⇒ Object
Returns the value of attribute password.
56 57 58 |
# File 'lib/ews/transaction/request.rb', line 56 def password @password end |
#reference_3 ⇒ Object
Returns the value of attribute reference_3.
73 74 75 |
# File 'lib/ews/transaction/request.rb', line 73 def reference_3 @reference_3 end |
#reference_no ⇒ Object
Returns the value of attribute reference_no.
73 74 75 |
# File 'lib/ews/transaction/request.rb', line 73 def reference_no @reference_no end |
#secure_auth_required ⇒ Object
Returns the value of attribute secure_auth_required.
57 58 59 |
# File 'lib/ews/transaction/request.rb', line 57 def secure_auth_required @secure_auth_required end |
#secure_auth_result ⇒ Object
Returns the value of attribute secure_auth_result.
57 58 59 |
# File 'lib/ews/transaction/request.rb', line 57 def secure_auth_result @secure_auth_result end |
#surcharge_amount ⇒ Object
Returns the value of attribute surcharge_amount.
56 57 58 |
# File 'lib/ews/transaction/request.rb', line 56 def surcharge_amount @surcharge_amount end |
#tax1_amount ⇒ Object
Returns the value of attribute tax1_amount.
57 58 59 |
# File 'lib/ews/transaction/request.rb', line 57 def tax1_amount @tax1_amount end |
#tax1_number ⇒ Object
Returns the value of attribute tax1_number.
57 58 59 |
# File 'lib/ews/transaction/request.rb', line 57 def tax1_number @tax1_number end |
#tax2_amount ⇒ Object
Returns the value of attribute tax2_amount.
57 58 59 |
# File 'lib/ews/transaction/request.rb', line 57 def tax2_amount @tax2_amount end |
#tax2_number ⇒ Object
Returns the value of attribute tax2_number.
57 58 59 |
# File 'lib/ews/transaction/request.rb', line 57 def tax2_number @tax2_number end |
#track1 ⇒ Object
Returns the value of attribute track1.
56 57 58 |
# File 'lib/ews/transaction/request.rb', line 56 def track1 @track1 end |
#track2 ⇒ Object
Returns the value of attribute track2.
56 57 58 |
# File 'lib/ews/transaction/request.rb', line 56 def track2 @track2 end |
#transaction_tag ⇒ Object
Returns the value of attribute transaction_tag.
56 57 58 |
# File 'lib/ews/transaction/request.rb', line 56 def transaction_tag @transaction_tag end |
#transaction_type ⇒ Object
Returns the value of attribute transaction_type.
56 57 58 |
# File 'lib/ews/transaction/request.rb', line 56 def transaction_type @transaction_type end |
#user_name ⇒ Object
Returns the value of attribute user_name.
57 58 59 |
# File 'lib/ews/transaction/request.rb', line 57 def user_name @user_name end |
#xid ⇒ Object
Returns the value of attribute xid.
73 74 75 |
# File 'lib/ews/transaction/request.rb', line 73 def xid @xid end |
#zip_code ⇒ Object
Returns the value of attribute zip_code.
73 74 75 |
# File 'lib/ews/transaction/request.rb', line 73 def zip_code @zip_code end |
Instance Method Details
#is_find_transaction? ⇒ Boolean
Indicates whether or not this transaction is a :transaction_details
transaction
96 97 98 |
# File 'lib/ews/transaction/request.rb', line 96 def is_find_transaction? self.transaction_type == "CR" end |