Class: ActiveMerchant::Billing::Integrations::Citrus::Helper
- Defined in:
- lib/active_merchant/billing/integrations/citrus/helper.rb
Instance Attribute Summary
Attributes inherited from Helper
Instance Method Summary collapse
- #form_fields ⇒ Object
- #generate_checksum ⇒ Object
-
#initialize(order, account, options = {}) ⇒ Helper
constructor
A new instance of Helper.
Methods inherited from Helper
#add_field, #add_fields, #add_raw_html_field, #billing_address, #form_method, mapping, #raw_html_fields, #shipping_address, #test?
Constructor Details
#initialize(order, account, options = {}) ⇒ Helper
Returns a new instance of Helper.
22 23 24 25 26 |
# File 'lib/active_merchant/billing/integrations/citrus/helper.rb', line 22 def initialize(order, account, = {}) super add_field 'paymentMode', 'NET_BANKING' add_field 'reqtime', (Time.now.to_i * 1000).to_s end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveMerchant::Billing::Integrations::Helper
Instance Method Details
#form_fields ⇒ Object
28 29 30 |
# File 'lib/active_merchant/billing/integrations/citrus/helper.rb', line 28 def form_fields @fields.merge(mappings[:checksum] => generate_checksum) end |
#generate_checksum ⇒ Object
32 33 34 35 |
# File 'lib/active_merchant/billing/integrations/citrus/helper.rb', line 32 def generate_checksum checksum_fields = @fields["pmt_url"] + @fields["orderAmount"].to_s + @fields["merchantTxnId"] + @fields["currency"] Citrus.checksum(@fields["secret_key"], checksum_fields ) end |