Module: SpreedlyCore

Defined in:
lib/spreedly_core.rb,
lib/spreedly_core/base.rb,
lib/spreedly_core/gateway.rb,
lib/spreedly_core/version.rb,
lib/spreedly_core/transactions.rb,
lib/spreedly_core/payment_method.rb,
lib/spreedly_core/test_extensions.rb

Defined Under Namespace

Modules: HasIpAddress, NullifiableTransaction, TestHelper Classes: AuthorizeTransaction, Base, CaptureTransaction, CreditTransaction, Error, Gateway, InvalidResponse, PaymentMethod, PurchaseTransaction, RedactTransaction, Response, RetainTransaction, TimeOutError, Transaction, VoidedTransaction

Constant Summary collapse

CARD_TYPES =

Hash of user friendly credit card name to SpreedlyCore API name

{
  "Visa" => "visa",
  "MasterCard" => "master",
  "American Express" => "american_express",
  "Discover" => "discover"
}
Version =
VERSION = "0.1.3"

Class Method Summary collapse

Class Method Details

.configure(*args) ⇒ Object

Configure SpreedlyCore with a particular account and default gateway If the first argume is a hash, ‘login’, ‘secret’, and ‘gateway_token’ keys are expected. Otherwise *args is expected to be login, secret, and gateway_token



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/spreedly_core.rb', line 33

def self.configure(*args)
  , secret, gateway_token, *rest = args
  if .is_a?(Hash)

    # convert symbols to strings
    .each{|k,v| [k.to_s] = v }

     = ['login']
    secret = ['secret']
    gateway_token = ['gateway_token']
  else
     = 
  end
  if .nil? || secret.nil? || gateway_token.nil?
    raise ArgumentError.new("You must provide a login, secret, and gateway_token")
  end
  Base.configure(, secret, gateway_token)
end

.loginObject

returns the configured SpreedlyCore login



53
# File 'lib/spreedly_core.rb', line 53

def self.; Base.; end