Class: ActiveMerchant::Billing::SallieMaeGateway

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

Constant Summary collapse

URL =
'https://trans.salliemae.com/cgi-bin/process.cgi'

Constants inherited from Gateway

Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#card_brand, card_brand, inherited, supports?

Methods included from Utils

generate_unique_id

Methods included from CreditCardFormatting

#format

Methods included from RequiresParameters

#requires!

Methods included from PostsData

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

Constructor Details

#initialize(options = {}) ⇒ SallieMaeGateway

Returns a new instance of SallieMaeGateway.



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

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

Instance Method Details

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



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

def authorize(money, creditcard, options = {})
  post = PostData.new
  add_invoice(post, options)
  add_creditcard(post, creditcard)
  add_address(post, creditcard, options)
  add_customer_data(post, options)

  commit(:authonly, money, post)
end

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



48
49
50
51
52
# File 'lib/active_merchant/billing/gateways/sallie_mae.rb', line 48

def capture(money, authorization, options = {})
  post = PostData.new
  post[:postonly] = authorization
  commit(:capture, money, post)
end

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



38
39
40
41
42
43
44
45
46
# File 'lib/active_merchant/billing/gateways/sallie_mae.rb', line 38

def purchase(money, creditcard, options = {})
  post = PostData.new
  add_invoice(post, options)
  add_creditcard(post, creditcard)
  add_address(post, creditcard, options)
  add_customer_data(post, options)

  commit(:sale, money, post)
end

#test?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/active_merchant/billing/gateways/sallie_mae.rb', line 24

def test?
  @options[:login] == "TEST0"
end