Module: Simpal

Defined in:
lib/simpal.rb,
lib/simpal/order.rb,
lib/simpal/client.rb,
lib/simpal/constants.rb,
lib/simpal/api/orders.rb,
lib/simpal/client_error.rb,
lib/simpal/paypal_object.rb,
lib/simpal/payment/refund.rb,
lib/simpal/payment/capture.rb,
lib/simpal/middleware/headers.rb,
lib/simpal/api/payments/refunds.rb,
lib/simpal/api/payments/captures.rb,
lib/simpal/payment/authorization.rb,
lib/simpal/middleware/authorization.rb,
lib/simpal/api/payments/authorizations.rb

Overview

A simple, lightweight wrapper around PayPal’s REST API.

Defined Under Namespace

Modules: API, Middleware, Order, Payment Classes: Client, ClientError, PayPalObject

Constant Summary collapse

VERSION =

Returns The gem’s semantic version number.

Returns:

  • (String)

    The gem’s semantic version number.

'1.1.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.clientSimpal::Client

Returns The default client to use when performing API requests.

Returns:

  • (Simpal::Client)

    The default client to use when performing API requests.



29
30
31
# File 'lib/simpal.rb', line 29

def client
  @client
end

Class Method Details

.client_for(client) ⇒ Simpal::Client

Returns the API client to use for a set of request parameters.

Parameters:

Returns:

Raises:



37
38
39
40
41
42
# File 'lib/simpal.rb', line 37

def client_for(client)
  client ||= self.client
  return client if client.is_a?(Simpal::Client)

  raise ClientError, 'API client is missing. Did you forget to set `Simpal.client`?'
end