Class: OffsitePayments::Integrations::BitPay::Helper
- Defined in:
- lib/offsite_payments/integrations/bit_pay.rb
Instance Attribute Summary
Attributes inherited from Helper
Instance Method Summary collapse
- #form_fields ⇒ Object
- #form_method ⇒ Object
-
#initialize(order_id, account, options) ⇒ Helper
constructor
A new instance of Helper.
Methods inherited from Helper
#add_field, #add_fields, #add_raw_html_field, #billing_address, inherited, mapping, #raw_html_fields, #shipping_address, #test?
Constructor Details
#initialize(order_id, account, options) ⇒ Helper
Returns a new instance of Helper.
23 24 25 26 27 28 29 30 |
# File 'lib/offsite_payments/integrations/bit_pay.rb', line 23 def initialize(order_id, account, ) super @account = account add_field('posData', {'orderId' => order_id}.to_json) add_field('fullNotifications', true) add_field('transactionSpeed', 'high') end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class OffsitePayments::Helper
Instance Method Details
#form_fields ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/offsite_payments/integrations/bit_pay.rb', line 55 def form_fields invoice = create_invoice raise ActionViewHelperError, "Invalid response while retrieving BitPay Invoice ID. Please try again." unless invoice {"id" => invoice['id']} end |
#form_method ⇒ Object
51 52 53 |
# File 'lib/offsite_payments/integrations/bit_pay.rb', line 51 def form_method "GET" end |