Class: OffsitePayments::Integrations::LiqpayV3::Helper
- Inherits:
-
Helper
- Object
- Helper
- OffsitePayments::Integrations::LiqpayV3::Helper
- Defined in:
- lib/offsite_payments/integrations/liqpay_v3.rb
Instance Method Summary collapse
- #form_fields ⇒ Object
-
#initialize(order, account, options = {}) ⇒ Helper
constructor
A new instance of Helper.
Constructor Details
#initialize(order, account, options = {}) ⇒ Helper
Returns a new instance of Helper.
34 35 36 37 38 39 |
# File 'lib/offsite_payments/integrations/liqpay_v3.rb', line 34 def initialize(order, account, = {}) @secret = .delete(:credential2) super add_field 'version', '3' end |
Instance Method Details
#form_fields ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/offsite_payments/integrations/liqpay_v3.rb', line 51 def form_fields form_data = liqpay.cnb_form_data( version: @fields['version'], amount: @fields['amount'], currency: @fields['currency']&.upcase, description: @fields['description'], email: @fields['email'], sandbox: OffsitePayments.mode == :test ? '1' : '0', action: @fields['action'], order_id: @fields['order_id']&.to_s, server_url: @fields['server_url'], result_url: @fields['result_url'], ) { 'data' => form_data.data, 'signature' => form_data.signature } end |