Class: OffsitePayments::Integrations::Citrus::Helper
- Defined in:
- lib/offsite_payments/integrations/citrus.rb
Constant Summary collapse
- SANDBOX_URL =
'https://sandbox.citruspay.com/'.freeze
- STAGING_URL =
'https://stg.citruspay.com/'.freeze
- PRODUCTION_URL =
'https://www.citruspay.com/'.freeze
Instance Attribute Summary
Attributes inherited from Helper
Instance Method Summary collapse
- #credential_based_url ⇒ Object
- #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, inherited, mapping, #raw_html_fields, #shipping_address, #test?
Methods included from MoneyCompatibility
Constructor Details
#initialize(order, account, options = {}) ⇒ Helper
Returns a new instance of Helper.
52 53 54 55 56 57 |
# File 'lib/offsite_payments/integrations/citrus.rb', line 52 def initialize(order, account, = {}) super add_field 'paymentMode', 'NET_BANKING' add_field 'reqtime', (Time.now.to_i * 1000).to_s @secret_key = [:credential2] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class OffsitePayments::Helper
Instance Method Details
#credential_based_url ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/offsite_payments/integrations/citrus.rb', line 38 def credential_based_url pmt_url = @fields['pmt_url'] case OffsitePayments.mode when :production PRODUCTION_URL + pmt_url when :test SANDBOX_URL + pmt_url when :staging STAGING_URL + pmt_url else raise StandardError, "Integration mode set to an invalid value: #{mode}" end end |
#form_fields ⇒ Object
59 60 61 |
# File 'lib/offsite_payments/integrations/citrus.rb', line 59 def form_fields @fields.merge(mappings[:checksum] => generate_checksum) end |