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

Returns a new instance of 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



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

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

#additional_notification?Boolean

Returns:

  • (Boolean)


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

def additional_notification?
  @notification_type == :additional
end

#commandObject



133
134
135
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 133

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

Returns:

  • (Boolean)


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

def complete?
  true
end

#currencyObject



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

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



117
118
119
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 117

def inclome_total
  params['income_total']
end

#incomeObject



121
122
123
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 121

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



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

def partner_income
  params['partner_income']
end

#payer_emailObject



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

def payer_email
  params['email']
end

#phone_numberObject



137
138
139
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 137

def phone_number
  params['phone_number']
end

#received_atObject



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

def received_at
  params['date_created']
end

#result_stringObject



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

def result_string
  params['resultStr']
end

#security_keyObject



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

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

Returns:

  • (Boolean)


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

def simple_notification?
  @notification_type == :simple
end

#system_incomeObject Also known as: gross



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

def system_income
  params['system_income']
end

#test?Boolean

Was this a test transaction?

Returns:

  • (Boolean)


169
170
171
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 169

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



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

def version
  params['version']
end