Class/Module Index [+]

Quicksearch

ActiveMerchant::Billing::SagePayGateway

Public Class Methods

new(options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/sage_pay.rb, line 51
def initialize(options = {})
  requires!(options, :login)
  @options = options
  super
end

Public Instance Methods

authorize(money, credit_card, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/sage_pay.rb, line 75
def authorize(money, credit_card, options = {})
  requires!(options, :order_id)
  
  post = {}
  
  add_amount(post, money, options)
  add_invoice(post, options)
  add_credit_card(post, credit_card)
  add_address(post, options)
  add_customer_data(post, options)

  commit(:authorization, post)
end
capture(money, identification, options = {}) click to toggle source

You can only capture a transaction once, even if you didn’t capture the full amount the first time.

# File lib/active_merchant/billing/gateways/sage_pay.rb, line 90
def capture(money, identification, options = {})
  post = {}
  
  add_reference(post, identification)
  add_release_amount(post, money, options)
  
  commit(:capture, post)
end
credit(money, identification, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/sage_pay.rb, line 121
def credit(money, identification, options = {})
  deprecated CREDIT_DEPRECATION_MESSAGE
  refund(money, identification, options)
end
purchase(money, credit_card, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/sage_pay.rb, line 61
def purchase(money, credit_card, options = {})
  requires!(options, :order_id)
  
  post = {}
  
  add_amount(post, money, options)
  add_invoice(post, options)
  add_credit_card(post, credit_card)
  add_address(post, options)
  add_customer_data(post, options)

  commit(:purchase, post)
end
refund(money, identification, options = {}) click to toggle source

Refunding requires a new order_id to passed in, as well as a description

# File lib/active_merchant/billing/gateways/sage_pay.rb, line 109
def refund(money, identification, options = {})
  requires!(options, :order_id, :description)
  
  post = {}
  
  add_credit_reference(post, identification)
  add_amount(post, money, options)
  add_invoice(post, options)
  
  commit(:credit, post)
end
test?() click to toggle source
# File lib/active_merchant/billing/gateways/sage_pay.rb, line 57
def test?
  @options[:test] || super
end
void(identification, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/sage_pay.rb, line 99
def void(identification, options = {})
  post = {}
  
  add_reference(post, identification)
  action = abort_or_void_from(identification)

  commit(action, post)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.