Class: OffsitePayments::Integrations::Newebpay::Helper
- Inherits:
-
Helper
- Object
- Helper
- OffsitePayments::Integrations::Newebpay::Helper
- Defined in:
- lib/offsite_payments/integrations/newebpay/helper.rb
Overview
The Helper to build payment form
Instance Method Summary collapse
-
#form_fields ⇒ Hash
Fields to build form.
-
#initialize(order, account, options = {}) ⇒ Helper
constructor
A new instance of Helper.
-
#params ⇒ String
The content of trade information.
-
#trade_info ⇒ String
The encrypted trade information.
-
#trade_sha ⇒ String
The checksum for trade info.
Constructor Details
#initialize(order, account, options = {}) ⇒ Helper
Returns a new instance of Helper.
13 14 15 16 17 18 19 |
# File 'lib/offsite_payments/integrations/newebpay/helper.rb', line 13 def initialize(order, account, = {}) super add_field('RespondType', 'JSON') add_field('TimeStamp', Time.now.to_i) add_field('Version', VERSION) add_field('ItemDesc', [:description]) end |
Instance Method Details
#form_fields ⇒ Hash
Fields to build form
57 58 59 |
# File 'lib/offsite_payments/integrations/newebpay/helper.rb', line 57 def form_fields fields.merge('TradeInfo' => trade_info, 'TradeSha' => trade_sha) end |
#params ⇒ String
The content of trade information
48 49 50 |
# File 'lib/offsite_payments/integrations/newebpay/helper.rb', line 48 def params URI.encode_www_form(fields) end |