Class: ActiveMerchant::Billing::SoEasyPayGateway

Inherits:
Gateway
  • Object
show all
Defined in:
lib/active_merchant/billing/gateways/so_easy_pay.rb

Constant Summary

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#add_field_to_post_if_present, #add_fields_to_post_if_present, #card_brand, card_brand, #generate_unique_id, inherited, #scrub, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?

Methods included from CreditCardFormatting

#expdate, #format

Methods included from PostsData

included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request

Constructor Details

#initialize(options = {}) ⇒ SoEasyPayGateway

Returns a new instance of SoEasyPayGateway.



17
18
19
20
# File 'lib/active_merchant/billing/gateways/so_easy_pay.rb', line 17

def initialize(options = {})
  requires!(options, :login, :password)
  super
end

Instance Method Details

#authorize(money, payment_source, options = {}) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/active_merchant/billing/gateways/so_easy_pay.rb', line 22

def authorize(money, payment_source, options = {})
  if payment_source.respond_to?(:number)
    commit('AuthorizeTransaction', do_authorization(money, payment_source, options), options)
  else
    commit('ReauthorizeTransaction', do_reauthorization(money, payment_source, options), options)
  end
end

#capture(money, authorization, options = {}) ⇒ Object



38
39
40
# File 'lib/active_merchant/billing/gateways/so_easy_pay.rb', line 38

def capture(money, authorization, options = {})
  commit('CaptureTransaction', do_capture(money, authorization, options), options)
end

#purchase(money, payment_source, options = {}) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/active_merchant/billing/gateways/so_easy_pay.rb', line 30

def purchase(money, payment_source, options = {})
  if payment_source.respond_to?(:number)
    commit('SaleTransaction', do_sale(money, payment_source, options), options)
  else
    commit('RebillTransaction', do_rebill(money, payment_source, options), options)
  end
end

#refund(money, authorization, options = {}) ⇒ Object



42
43
44
# File 'lib/active_merchant/billing/gateways/so_easy_pay.rb', line 42

def refund(money, authorization, options = {})
  commit('RefundTransaction', do_refund(money, authorization, options), options)
end

#void(authorization, options = {}) ⇒ Object



46
47
48
# File 'lib/active_merchant/billing/gateways/so_easy_pay.rb', line 46

def void(authorization, options = {})
  commit('CancelTransaction', do_void(authorization, options), options)
end