Class: OffsitePayments::Integrations::HiTrust::Helper
- Defined in:
- lib/offsite_payments/integrations/hi_trust.rb
Instance Attribute Summary
Attributes inherited from Helper
Instance Method Summary collapse
- #amount=(money) ⇒ Object
-
#initialize(order, account, options = {}) ⇒ Helper
constructor
Transaction types * Auth * AuthRe * Capture * CaptureRe * Refund * RefundRe * Query.
Methods inherited from Helper
#add_field, #add_fields, #add_raw_html_field, #billing_address, #form_fields, #form_method, inherited, mapping, #raw_html_fields, #shipping_address, #test?
Constructor Details
#initialize(order, account, options = {}) ⇒ Helper
Transaction types
-
Auth
-
AuthRe
-
Capture
-
CaptureRe
-
Refund
-
RefundRe
-
Query
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/offsite_payments/integrations/hi_trust.rb', line 28 def initialize(order, account, = {}) super # Perform an authorization by default add_field('Type', 'Auth') # Capture the payment right away add_field('depositflag', '1') # Disable auto query - who knows what it does? add_field('queryflag', '1') add_field('orderdesc', 'Store purchase') end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class OffsitePayments::Helper
Instance Method Details
#amount=(money) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/offsite_payments/integrations/hi_trust.rb', line 45 def amount=(money) cents = money.respond_to?(:cents) ? money.cents : money raise ArgumentError, "amount must be a Money object or an integer" if money.is_a?(String) raise ActionViewHelperError, "amount must be greater than $0.00" if cents.to_i <= 0 add_field(mappings[:amount], cents) end |