Module: Moiper

Defined in:
lib/moiper.rb,
lib/moiper/payment.rb,
lib/moiper/railtie.rb,
lib/moiper/request.rb,
lib/moiper/version.rb,
lib/moiper/response.rb,
lib/moiper/notification.rb,
lib/moiper/notification_controller_helper.rb

Defined Under Namespace

Modules: NotificationControllerHelper Classes: Notification, Payment, Railtie, Request, Response

Constant Summary collapse

API_ENTRYPOINTS =

The available Moip entrypoints

{
  :sandbox    => "https://desenvolvedor.moip.com.br/sandbox/",
  :production => "https://www.moip.com.br/"
}
VERSION =
"0.1.2"

Configurable options collapse

Class Method Summary collapse

Class Attribute Details

.keyString

Returns Moip’s API key.

Returns:

  • (String)

    Moip’s API key



24
25
26
# File 'lib/moiper.rb', line 24

def key
  @key
end

.sandboxBoolean

Define if requests should be made against Moip’s sandbox environment. This is specially usefull when running on development or test mode. Default is false

Examples:

Moiper.sandbox = true

Returns:

  • (Boolean)

    current sandbox state

See Also:



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

def sandbox
  @sandbox
end

.tokenString

Returns Moip’s API token.

Returns:

  • (String)

    Moip’s API token



21
22
23
# File 'lib/moiper.rb', line 21

def token
  @token
end

Class Method Details

.api_entrypointString

Returns the Moip API entrypoint based on the current environment.

Returns:

  • (String)

    the Moip API entrypoint based on the current environment



61
62
63
# File 'lib/moiper.rb', line 61

def api_entrypoint
  sandbox? ? API_ENTRYPOINTS[:sandbox] : API_ENTRYPOINTS[:production]
end

.configure {|config| ... } ⇒ void

This method returns an undefined value.

Configure Moiper’s options

Examples:

Moiper.configure do |config|
  config.sandbox = true
end

Yield Parameters:



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

def configure(&block)
  yield self
end

.sandbox?Boolean

Inform if in sandbox mode

Returns:

  • (Boolean)


56
57
58
# File 'lib/moiper.rb', line 56

def sandbox?
  sandbox == true
end