Module: PayPal::Recurring

Defined in:
lib/paypal/recurring.rb,
lib/paypal/recurring/base.rb,
lib/paypal/recurring/utils.rb,
lib/paypal/recurring/request.rb,
lib/paypal/recurring/version.rb,
lib/paypal/recurring/response.rb,
lib/paypal/recurring/notification.rb,
lib/paypal/recurring/response/base.rb,
lib/paypal/recurring/response/refund.rb,
lib/paypal/recurring/response/details.rb,
lib/paypal/recurring/response/payment.rb,
lib/paypal/recurring/response/profile.rb,
lib/paypal/recurring/response/checkout.rb,
lib/paypal/recurring/response/manage_profile.rb

Defined Under Namespace

Modules: Response, Utils, Version Classes: Base, Notification, Request

Constant Summary collapse

ENDPOINTS =
{
   :sandbox => {
     :api  => "https://api-3t.sandbox.paypal.com/nvp",
     :site => "https://www.sandbox.paypal.com/cgi-bin/webscr"
   },
   :production => {
     :api  => "https://api-3t.paypal.com/nvp",
     :site => "https://www.paypal.com/cgi-bin/webscr"
   }
}

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.emailObject

The seller e-mail. Will be used to verify IPN.



55
56
57
# File 'lib/paypal/recurring.rb', line 55

def email
  @email
end

.passwordObject

Set PayPal’s API password.



42
43
44
# File 'lib/paypal/recurring.rb', line 42

def password
  @password
end

.sandboxObject

Define if requests should be made to PayPal’s sandbox environment. This is specially useful when running on development or test mode.

PayPal::Recurring.sandbox = true


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

def sandbox
  @sandbox
end

.seller_idObject

Set seller id. Will be used to verify IPN.



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

def seller_id
  @seller_id
end

.signatureObject

Set PayPal’s API signature.



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

def signature
  @signature
end

.usernameObject

Set PayPal’s API username.



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

def username
  @username
end

Class Method Details

.api_endpointObject

Return API endpoint based on current environment.



94
95
96
# File 'lib/paypal/recurring.rb', line 94

def self.api_endpoint
  endpoints[:api]
end

.api_versionObject

Return PayPal’s API version.



100
101
102
# File 'lib/paypal/recurring.rb', line 100

def self.api_version
  "72.0"
end

.configure {|PayPal::Recurring| ... } ⇒ Object

Configure PayPal::Recurring options.

PayPal::Recurring.configure do |config|
  config.sandbox = true
end

Yields:



70
71
72
# File 'lib/paypal/recurring.rb', line 70

def self.configure(&block)
  yield PayPal::Recurring
end

.endpointsObject

Return URL endpoints for current environment.



88
89
90
# File 'lib/paypal/recurring.rb', line 88

def self.endpoints
  ENDPOINTS[environment]
end

.environmentObject

Return a name for current environment mode (sandbox or production).



82
83
84
# File 'lib/paypal/recurring.rb', line 82

def self.environment
  sandbox? ? :sandbox : :production
end

.new(options = {}) ⇒ Object

Just a shortcut for PayPal::Recurring::Base.new.



60
61
62
# File 'lib/paypal/recurring.rb', line 60

def self.new(options = {})
  Base.new(options)
end

.sandbox?Boolean

Detect if sandbox mode is enabled.

Returns:

  • (Boolean)


76
77
78
# File 'lib/paypal/recurring.rb', line 76

def self.sandbox?
  sandbox == true
end

.site_endpointObject

Return site endpoint based on current environment.



106
107
108
# File 'lib/paypal/recurring.rb', line 106

def self.site_endpoint
  endpoints[:site]
end