Class: OffsitePayments::Integrations::BitPay::Helper

Inherits:
Helper
  • Object
show all
Defined in:
lib/offsite_payments/integrations/bit_pay.rb

Instance Attribute Summary

Attributes inherited from Helper

#fields

Instance Method Summary collapse

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

#to_cents

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, , options)
  super
  @account = 

  add_field('posData', {'orderId' => order_id}.to_json)
  add_field('fullNotifications', true)
  add_field('transactionSpeed', 'high')
  add_field('token', )
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class OffsitePayments::Helper

Instance Method Details

#form_fieldsObject



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_methodObject



65
66
67
# File 'lib/offsite_payments/integrations/bit_pay.rb', line 65

def form_method
  "GET"
end