Class: OffsitePayments::Integrations::A1agregator::Notification

Inherits:
Notification
  • Object
show all
Defined in:
lib/offsite_payments/integrations/a1agregator.rb

Instance Attribute Summary

Attributes inherited from Notification

#params, #raw

Instance Method Summary collapse

Methods inherited from Notification

#amount, #empty!, #gross_cents, #iso_currency, #status, #valid_sender?

Constructor Details

#initialize(*args) ⇒ Notification


48
49
50
51
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 48

def initialize(*args)
  super
  guess_notification_type
end

Instance Method Details

#acknowledge(authcode = nil) ⇒ Object


189
190
191
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 189

def acknowledge(authcode = nil)
  security_key == signature
end

#additional_notification?Boolean


185
186
187
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 185

def additional_notification?
  @notification_type == :additional
end

#commandObject


141
142
143
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 141

def command
  params['command']
end

#commentObject


76
77
78
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 76

def comment
  params['comment']
end

#complete?Boolean

Simple notification request params: tid name comment partner_id service_id order_id type partner_income system_income


64
65
66
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 64

def complete?
  true
end

#currencyObject


172
173
174
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 172

def currency
  'RUB'
end

#inclome_totalObject

Additional notification request params: tid name comment partner_id service_id order_id type cost income_total income partner_income system_income command phone_number email resultStr date_created version check


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

def inclome_total
  params['income_total']
end

#incomeObject


129
130
131
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 129

def income
  params['income']
end

#item_idObject


88
89
90
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 88

def item_id
  params['order_id']
end

#partner_idObject


80
81
82
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 80

def partner_id
  params['partner_id']
end

#partner_incomeObject


96
97
98
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 96

def partner_income
  params['partner_income']
end

#payer_emailObject


149
150
151
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 149

def payer_email
  params['email']
end

#phone_numberObject


145
146
147
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 145

def phone_number
  params['phone_number']
end

#received_atObject


157
158
159
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 157

def received_at
  params['date_created']
end

#result_stringObject


153
154
155
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 153

def result_string
  params['resultStr']
end

#security_keyObject


165
166
167
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 165

def security_key
  params[A1agregator.signature_parameter_name].to_s.downcase
end

#service_idObject


84
85
86
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 84

def service_id
  params['service_id']
end

#simple_notification?Boolean


181
182
183
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 181

def simple_notification?
  @notification_type == :simple
end

#system_incomeObject Also known as: gross


100
101
102
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 100

def system_income
  params['system_income']
end

#test?Boolean

Was this a test transaction?


177
178
179
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 177

def test?
  params['test'] == '1'
end

#titleObject


72
73
74
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 72

def title
  params['name']
end

#transaction_idObject


68
69
70
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 68

def transaction_id
  params['tid']
end

#typeObject


92
93
94
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 92

def type
  params['type']
end

#versionObject


161
162
163
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 161

def version
  params['version']
end