Class: OffsitePayments::Integrations::A1agregator::Status

Inherits:
Object
  • Object
show all
Includes:
ActiveMerchant::PostsData
Defined in:
lib/offsite_payments/integrations/a1agregator.rb

Constant Summary collapse

STATUS_TEST_URL =
'https://partner.a1pay.ru/a1lite/info/'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(login, password) ⇒ Status

Returns a new instance of Status.



222
223
224
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 222

def initialize(, password)
  @login, @password = , password
end

Instance Attribute Details

#loginObject

Returns the value of attribute login.



220
221
222
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 220

def 
  @login
end

#passwordObject

Returns the value of attribute password.



220
221
222
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 220

def password
  @password
end

Instance Method Details

#update(options = {}) ⇒ Object

agregator provides two methods: by tid - transaction id by order_id & service_id



229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 229

def update(options = {})
  data = PostData.new
  data[:user] = @login
  data[:pass] = @password
  if options[:tid]
    data[:tid] = options[:tid]
  else
    data[:ord_id] = options[:ord_id]
    data[:service_id] = options[:service_id]
  end

  ssl_post(STATUS_TEST_URL, data.to_post_data)
end