class OffsitePayments::Integrations::Platron::Notification

Public Class Methods

new(*args) click to toggle source
Calls superclass method OffsitePayments::Notification::new
# File lib/offsite_payments/integrations/platron.rb, line 49
def initialize(*args)
  super
  @signature = params.delete('pg_sig')
end

Public Instance Methods

acknowledge(authcode = nil) click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 134
def acknowledge(authcode = nil)
  signature == Platron.generate_signature(params, path, secret)
end
amount() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 122
def amount
  Money.from_amount(BigDecimal(params['pg_amount']), currency)
end
captured() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 82
def captured
  params['pg_captured']
end
card_brand() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 78
def card_brand
  params['pg_card_brand']
end
complete?() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 54
def complete?
  params['pg_result']
end
currency() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 66
def currency
  params['pg_ps_currency']
end
failure_code() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 90
def failure_code
  params['pg_failure_code']
end
failure_description() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 94
def failure_description
  params['pg_failure_description']
end
net_amount() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 110
def net_amount
  params['pg_net_amount']
end
order_id() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 58
def order_id
  params['pg_order_id']
end
overpayment() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 86
def overpayment
  params['pg_overpayment']
end
path() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 130
def path
  @options[:path]
end
payment_date() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 98
def payment_date
  params['pg_payment_date']
end
payment_system() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 70
def payment_system
  params['pg_payment_system']
end
platron_payment_id() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 62
def platron_payment_id
  params['pg_payment_id']
end
ps_amount() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 114
def ps_amount
  params['pg_ps_amount']
end
ps_full_amount() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 118
def ps_full_amount
  params['pg_ps_full_amount']
end
salt() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 102
def salt
  params['pg_salt']
end
secret() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 126
def secret
  @options[:secret]
end
signature() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 106
def signature
  @signature
end
success_response(path,secret) click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 138
def success_response(path,secret)
  salt = rand(36**15).to_s(36)
  xml = ""
  doc = Builder::XmlMarkup.new(:target => xml)
  sign = Platron.generate_signature({:pg_status => 'ok', :pg_salt => salt}, path, secret)
  doc.response do
    doc.pg_status 'ok'
    doc.pg_salt salt
    doc.pg_sig sign
  end
  xml
end
user_phone() click to toggle source
# File lib/offsite_payments/integrations/platron.rb, line 74
def user_phone
  params['pg_user_phone']
end