Class: ActiveMerchant::Billing::VancoGateway

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

Constant Summary

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#card_brand, card_brand, #generate_unique_id, inherited, non_fractional_currency?, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #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 = {}) ⇒ VancoGateway

Returns a new instance of VancoGateway.



18
19
20
21
# File 'lib/active_merchant/billing/gateways/vanco.rb', line 18

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

Instance Method Details

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



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

def purchase(money, payment_method, options={})
  MultiResponse.run do |r|
    r.process { commit() }
    r.process { commit(purchase_request(money, payment_method, r.params["response_sessionid"], options)) }
  end
end

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



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

def refund(money, authorization, options={})
  MultiResponse.run do |r|
    r.process { commit() }
    r.process { commit(refund_request(money, authorization, r.params["response_sessionid"])) }
  end
end

#scrub(transcript) ⇒ Object



41
42
43
44
45
46
# File 'lib/active_merchant/billing/gateways/vanco.rb', line 41

def scrub(transcript)
  transcript.
    gsub(%r((<Password>).+(</Password>))i, '\1[FILTERED]\2').
    gsub(%r((<CardCVV2>).+(</CardCVV2>))i, '\1[FILTERED]\2').
    gsub(%r((<AccountNumber>).+(</AccountNumber>))i, '\1[FILTERED]\2')
end

#supports_scrubbing?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/active_merchant/billing/gateways/vanco.rb', line 37

def supports_scrubbing?
  true
end