Class: ActiveMerchant::Billing::Integrations::A1agregator::Notification

Inherits:
Notification
  • Object
show all
Defined in:
lib/active_merchant/billing/integrations/a1agregator/notification.rb

Instance Attribute Summary

Attributes inherited from Notification

#params, #raw

Instance Method Summary collapse

Methods inherited from Notification

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

Constructor Details

#initialize(*args) ⇒ Notification

Returns a new instance of Notification.



16
17
18
19
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 16

def initialize(*args)
  super
  guess_notification_type
end

Instance Method Details

#acknowledgeObject



157
158
159
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 157

def acknowledge
  security_key == signature
end

#additional_notification?Boolean

Returns:

  • (Boolean)


153
154
155
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 153

def additional_notification?
  @notification_type == :additional
end

#commandObject



109
110
111
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 109

def command
  params['command']
end

#commentObject



44
45
46
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 44

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)


32
33
34
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 32

def complete?
  true
end

#currencyObject



140
141
142
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 140

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



93
94
95
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 93

def inclome_total
  params['income_total']
end

#incomeObject



97
98
99
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 97

def income
  params['income']
end

#item_idObject



56
57
58
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 56

def item_id
  params['order_id']
end

#partner_idObject



48
49
50
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 48

def partner_id
  params['partner_id']
end

#partner_incomeObject



64
65
66
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 64

def partner_income
  params['partner_income']
end

#payer_emailObject



117
118
119
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 117

def payer_email
  params['email']
end

#phone_numberObject



113
114
115
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 113

def phone_number
  params['phone_number']
end

#received_atObject



125
126
127
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 125

def received_at
  params['date_created']
end

#result_stringObject



121
122
123
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 121

def result_string
  params['resultStr']
end

#security_keyObject



133
134
135
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 133

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

#service_idObject



52
53
54
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 52

def service_id
  params['service_id']
end

#simple_notification?Boolean

Returns:

  • (Boolean)


149
150
151
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 149

def simple_notification?
  @notification_type == :simple
end

#system_incomeObject Also known as: gross



68
69
70
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 68

def system_income
  params['system_income']
end

#test?Boolean

Was this a test transaction?

Returns:

  • (Boolean)


145
146
147
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 145

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

#titleObject



40
41
42
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 40

def title
  params['name']
end

#transaction_idObject



36
37
38
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 36

def transaction_id
  params['tid']
end

#typeObject



60
61
62
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 60

def type
  params['type']
end

#versionObject



129
130
131
# File 'lib/active_merchant/billing/integrations/a1agregator/notification.rb', line 129

def version
  params['version']
end