Class/Module Index [+]

Quicksearch

ActiveMerchant::Billing::StripeGateway

Public Class Methods

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

Public Instance Methods

authorize(money, creditcard, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/stripe.rb, line 52
def authorize(money, creditcard, options = {})
  purchase(money, creditcard, options.merge(:uncaptured => true))
end
capture(money, identification, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/stripe.rb, line 56
def capture(money, identification, options = {})
  commit("charges/#{CGI.escape(identification)}/capture", {})
end
purchase(money, creditcard, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/stripe.rb, line 38
def purchase(money, creditcard, options = {})
  post = {}

  add_amount(post, money, options)
  add_creditcard(post, creditcard, options)
  add_customer(post, options)
  add_customer_data(post, options)
  add_flags(post, options)

  raise ArgumentError.new("Customer or Credit Card required.") if !post[:card] && !post[:customer]

  commit('charges', post)
end
refund(money, identification, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/stripe.rb, line 64
def refund(money, identification, options = {})
  post = {}

  post[:amount] = amount(money) if money

  commit("charges/#{CGI.escape(identification)}/refund", post)
end
store(creditcard, options={}) click to toggle source
# File lib/active_merchant/billing/gateways/stripe.rb, line 72
def store(creditcard, options={})
  post = {}
  add_creditcard(post, creditcard, options)
  add_customer_data(post, options)

  if options[:customer]
    commit("customers/#{CGI.escape(options[:customer])}", post)
  else
    commit('customers', post)
  end
end
void(identification, options={}) click to toggle source
# File lib/active_merchant/billing/gateways/stripe.rb, line 60
def void(identification, options={})
  commit("charges/#{CGI.escape(identification)}/refund", {})
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.