Class: ActiveMerchant::Billing::Integrations::BitPay::Helper
- Defined in:
- lib/active_merchant/billing/integrations/bit_pay/helper.rb
Instance Attribute Summary
Attributes inherited from Helper
Instance Method Summary collapse
- #form_method ⇒ Object
- #generate_invoice_id ⇒ 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, #form_fields, mapping, #raw_html_fields, #shipping_address, #test?
Constructor Details
#initialize(order_id, account, options) ⇒ Helper
Returns a new instance of Helper.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/active_merchant/billing/integrations/bit_pay/helper.rb', line 6 def initialize(order_id, account, ) super @account = account add_field('orderID', order_id) add_field('posData', [:authcode]) add_field('currency', [:currency]) add_field('fullNotifications', 'true') add_field('transactionSpeed', [:transactionSpeed] || "high") add_field('address1', [:address1]) generate_invoice_id end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveMerchant::Billing::Integrations::Helper
Instance Method Details
#form_method ⇒ Object
46 47 48 |
# File 'lib/active_merchant/billing/integrations/bit_pay/helper.rb', line 46 def form_method "GET" end |
#generate_invoice_id ⇒ Object
40 41 42 43 44 |
# File 'lib/active_merchant/billing/integrations/bit_pay/helper.rb', line 40 def generate_invoice_id invoice_data = ssl_post(BitPay.invoicing_url) add_field('id', JSON.parse(invoice_data.body)['id']) end |