Class: Walletone::Form
- Inherits:
-
Object
- Object
- Walletone::Form
- Defined in:
- lib/walletone/form.rb
Instance Attribute Summary collapse
-
#payment ⇒ Object
readonly
Returns the value of attribute payment.
Instance Method Summary collapse
- #checkout_url ⇒ Object
- #hidden_fields_tags ⇒ Object
-
#initialize(payment) ⇒ Form
constructor
A new instance of Form.
-
#options ⇒ Object
Рекомендуемые опции.
Constructor Details
#initialize(payment) ⇒ Form
Returns a new instance of Form.
7 8 9 10 11 12 |
# File 'lib/walletone/form.rb', line 7 def initialize payment unless payment.is_a?( Walletone::Payment ) && payment.valid? && payment.signed? Walletone.raise_error ArgumentError.new("Must be valid and signed Payment #{payment}") end @payment = payment end |
Instance Attribute Details
#payment ⇒ Object (readonly)
Returns the value of attribute payment.
5 6 7 |
# File 'lib/walletone/form.rb', line 5 def payment @payment end |
Instance Method Details
#checkout_url ⇒ Object
14 15 16 |
# File 'lib/walletone/form.rb', line 14 def checkout_url Walletone.config.web_checkout_url end |
#hidden_fields_tags ⇒ Object
18 19 20 21 22 23 |
# File 'lib/walletone/form.rb', line 18 def payment.as_list.map do |field| key, value = field hidden_field_tag(key, value) end.join end |
#options ⇒ Object
Рекомендуемые опции
26 27 28 |
# File 'lib/walletone/form.rb', line 26 def { authenticity_token: false, enforce_utf8: false } end |