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
-
.key ⇒ String
Moip’s API key.
-
.sandbox ⇒ Boolean
Define if requests should be made against Moip’s sandbox environment.
-
.token ⇒ String
Moip’s API token.
Class Method Summary collapse
-
.api_entrypoint ⇒ String
The Moip API entrypoint based on the current environment.
-
.configure {|config| ... } ⇒ void
Configure Moiper’s options.
-
.sandbox? ⇒ Boolean
Inform if in sandbox mode.
Class Attribute Details
.key ⇒ String
Returns Moip’s API key.
24 25 26 |
# File 'lib/moiper.rb', line 24 def key @key end |
.sandbox ⇒ Boolean
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
37 38 39 |
# File 'lib/moiper.rb', line 37 def sandbox @sandbox end |
.token ⇒ String
Returns Moip’s API token.
21 22 23 |
# File 'lib/moiper.rb', line 21 def token @token end |
Class Method Details
.api_entrypoint ⇒ String
Returns 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
51 52 53 |
# File 'lib/moiper.rb', line 51 def configure(&block) yield self end |
.sandbox? ⇒ Boolean
Inform if in sandbox mode
56 57 58 |
# File 'lib/moiper.rb', line 56 def sandbox? sandbox == true end |