class OffsitePayments::Integrations::Megakassa::Notification

Public Instance Methods

acknowledge(authcode = nil) click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 164
def acknowledge(authcode = nil)
  security_key == generate_signature
end
amount_client() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 128
def amount_client
  Money.new(gross_client_cents, currency)
end
amount_shop() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 116
def amount_shop
  Money.new(gross_shop_cents, currency)
end
client_email() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 148
def client_email
  params['client_email']
end
complete?() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 96
def complete?
  true
end
currency() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 132
def currency
  params['currency']
end
generate_signature() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 92
def generate_signature
  Digest::MD5.hexdigest(generate_signature_string)
end
generate_signature_string() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 88
def generate_signature_string
  "#{uid}:#{gross}:#{gross_shop}:#{gross_client}:#{currency}:#{order_id}:#{payment_method_id}:#{payment_method_title}:#{client_email}:#{secret}"
end
gross() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 104
def gross
  params['amount']
end
gross_client() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 120
def gross_client
  params['amount_client']
end
gross_client_cents() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 124
def gross_client_cents
  (gross_client.to_f * 100.0).round
end
gross_shop() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 108
def gross_shop
  params['amount_shop']
end
gross_shop_cents() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 112
def gross_shop_cents
  (gross_shop.to_f * 100.0).round
end
order_id() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 136
def order_id
  params['order_id']
end
payment_method_id() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 140
def payment_method_id
  params['payment_method_id']
end
payment_method_title() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 144
def payment_method_title
  params['payment_method_title']
end
secret() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 160
def secret
  @options[:secret]
end
security_key() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 152
def security_key
  params[OffsitePayments::Integrations::Megakassa.signature_parameter_name].to_s
end
status() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 156
def status
  'success'
end
success_response(*args) click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 168
def success_response(*args)
  'ok'
end
uid() click to toggle source
# File lib/offsite_payments/integrations/megakassa.rb, line 100
def uid
  params['uid']
end