Module: Paypal

Defined in:
lib/paypal.rb,
lib/paypal/ipn.rb,
lib/paypal/base.rb,
lib/paypal/util.rb,
lib/paypal/exception.rb,
lib/paypal/nvp/request.rb,
lib/paypal/nvp/response.rb,
lib/paypal/payment/request.rb,
lib/paypal/express/request.rb,
lib/paypal/express/response.rb,
lib/paypal/payment/response.rb,
lib/paypal/payment/recurring.rb,
lib/paypal/exception/api_error.rb,
lib/paypal/payment/request/item.rb,
lib/paypal/exception/http_error.rb,
lib/paypal/payment/common/amount.rb,
lib/paypal/payment/response/info.rb,
lib/paypal/payment/response/item.rb,
lib/paypal/payment/response/payer.rb,
lib/paypal/payment/response/refund.rb,
lib/paypal/payment/response/ship_to.rb,
lib/paypal/payment/recurring/billing.rb,
lib/paypal/payment/recurring/summary.rb,
lib/paypal/payment/response/reference.rb,
lib/paypal/payment/recurring/activation.rb

Defined Under Namespace

Modules: Express, IPN, NVP, Payment, Util Classes: Base, Exception

Constant Summary

API_VERSION =
'88.0'
ENDPOINT =
{
  :production => 'https://www.paypal.com/cgi-bin/webscr',
  :sandbox => 'https://www.sandbox.paypal.com/cgi-bin/webscr'
}
{
  :production => 'https://www.paypal.com/incontext',
  :sandbox => 'https://www.sandbox.paypal.com/incontext'
}
@@logger =
Logger.new(STDERR)

Class Method Summary collapse

Class Method Details

.endpointObject



19
20
21
22
23
24
25
# File 'lib/paypal.rb', line 19

def self.endpoint
  if sandbox?
    Paypal::ENDPOINT[:sandbox]
  else
    Paypal::ENDPOINT[:production]
  end
end

.log(message, mode = :info) ⇒ Object



34
35
36
# File 'lib/paypal.rb', line 34

def self.log(message, mode = :info)
  self.logger.send mode, message
end

.loggerObject



37
38
39
# File 'lib/paypal.rb', line 37

def self.logger
  @@logger
end

.logger=(logger) ⇒ Object



40
41
42
# File 'lib/paypal.rb', line 40

def self.logger=(logger)
  @@logger = logger
end


26
27
28
29
30
31
32
# File 'lib/paypal.rb', line 26

def self.popup_endpoint
  if sandbox?
    Paypal::POPUP_ENDPOINT[:sandbox]
  else
    Paypal::POPUP_ENDPOINT[:production]
  end
end

.sandbox!Object



49
50
51
# File 'lib/paypal.rb', line 49

def self.sandbox!
  self.sandbox = true
end

.sandbox=(boolean) ⇒ Object



52
53
54
# File 'lib/paypal.rb', line 52

def self.sandbox=(boolean)
  @@sandbox = boolean
end

.sandbox?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/paypal.rb', line 46

def self.sandbox?
  @@sandbox
end