Class: OffsitePayments::Integrations::Coinbase::Return

Inherits:
Return
  • Object
show all
Defined in:
lib/offsite_payments/integrations/coinbase.rb

Instance Attribute Summary

Attributes inherited from Return

#notification, #params

Instance Method Summary collapse

Methods inherited from Return

#cancelled?, #message, #success?

Constructor Details

#initialize(query_string, options = {}) ⇒ Return


125
126
127
128
# File 'lib/offsite_payments/integrations/coinbase.rb', line 125

def initialize(query_string, options = {})
  super
  @notification = Notification.new(@params.to_json, options)
end

Instance Method Details

#parse(query_string) ⇒ Object


130
131
132
133
134
135
136
137
138
# File 'lib/offsite_payments/integrations/coinbase.rb', line 130

def parse(query_string)
  parsed_hash = Rack::Utils.parse_nested_query(query_string)

  if native_cents = parsed_hash['order'] && parsed_hash['order']['total_native'] && parsed_hash['order']['total_native']['cents']
    parsed_hash['order']['total_native']['cents'] = native_cents.to_i
  end

  parsed_hash
end