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?
Methods included from MoneyCompatibility
Constructor Details
#initialize(order_id, account, options) ⇒ Helper
Returns a new instance of Helper.
36 37 38 39 40 41 42 43 44 |
# File 'lib/offsite_payments/integrations/bit_pay.rb', line 36 def initialize(order_id, account, ) super @account = account add_field('posData', {'orderId' => order_id}.to_json) add_field('fullNotifications', true) add_field('transactionSpeed', 'high') add_field('token', account) 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
69 70 71 72 73 74 75 |
# File 'lib/offsite_payments/integrations/bit_pay.rb', line 69 def form_fields invoice = create_invoice raise ActionViewHelperError, "Invalid response while retrieving BitPay Invoice ID. Please try again." unless invoice { "id" => extract_invoice_id(invoice) } end |
#form_method ⇒ Object
65 66 67 |
# File 'lib/offsite_payments/integrations/bit_pay.rb', line 65 def form_method "GET" end |