Module: MyMoip
- Defined in:
- lib/mymoip.rb,
lib/mymoip/payer.rb,
lib/mymoip/payment.rb,
lib/mymoip/request.rb,
lib/mymoip/version.rb,
lib/mymoip/purchase.rb,
lib/mymoip/formatter.rb,
lib/mymoip/bank_debit.rb,
lib/mymoip/commission.rb,
lib/mymoip/exceptions.rb,
lib/mymoip/validators.rb,
lib/mymoip/credit_card.rb,
lib/mymoip/instruction.rb,
lib/mymoip/json_parser.rb,
lib/mymoip/payment_slip.rb,
lib/mymoip/payment_methods.rb,
lib/mymoip/requests/payment_request.rb,
lib/mymoip/payments/bank_debit_payment.rb,
lib/mymoip/payments/credit_card_payment.rb,
lib/mymoip/requests/transparent_request.rb,
lib/mymoip/payments/payment_slip_payment.rb
Defined Under Namespace
Modules: Validators Classes: BankDebit, BankDebitPayment, Commission, CreditCard, CreditCardPayment, Error, Formatter, Instruction, InvalidBankDebit, InvalidComission, InvalidCreditCard, InvalidInstruction, InvalidPayer, InvalidPaymentSlip, JsonParser, Payer, Payment, PaymentMethods, PaymentRequest, PaymentSlip, PaymentSlipPayment, Purchase, Request, TransparentRequest
Constant Summary collapse
- VERSION =
'0.10.0'
Class Attribute Summary collapse
-
.default_referer_url ⇒ Object
Returns the value of attribute default_referer_url.
-
.environment ⇒ Object
Returns the value of attribute environment.
-
.logger ⇒ Object
Returns the value of attribute logger.
-
.production_key ⇒ Object
Returns the value of attribute production_key.
-
.production_token ⇒ Object
Returns the value of attribute production_token.
-
.sandbox_key ⇒ Object
Returns the value of attribute sandbox_key.
-
.sandbox_token ⇒ Object
Returns the value of attribute sandbox_token.
Class Method Summary collapse
- .api_url ⇒ Object
- .ensure_key_and_token_set! ⇒ Object
- .key ⇒ Object
- .key=(value) ⇒ Object
- .token ⇒ Object
- .token=(value) ⇒ Object
Class Attribute Details
.default_referer_url ⇒ Object
Returns the value of attribute default_referer_url.
9 10 11 |
# File 'lib/mymoip.rb', line 9 def default_referer_url @default_referer_url end |
.environment ⇒ Object
Returns the value of attribute environment.
9 10 11 |
# File 'lib/mymoip.rb', line 9 def environment @environment end |
.logger ⇒ Object
Returns the value of attribute logger.
9 10 11 |
# File 'lib/mymoip.rb', line 9 def logger @logger end |
.production_key ⇒ Object
Returns the value of attribute production_key.
9 10 11 |
# File 'lib/mymoip.rb', line 9 def production_key @production_key end |
.production_token ⇒ Object
Returns the value of attribute production_token.
9 10 11 |
# File 'lib/mymoip.rb', line 9 def production_token @production_token end |
.sandbox_key ⇒ Object
Returns the value of attribute sandbox_key.
9 10 11 |
# File 'lib/mymoip.rb', line 9 def sandbox_key @sandbox_key end |
.sandbox_token ⇒ Object
Returns the value of attribute sandbox_token.
9 10 11 |
# File 'lib/mymoip.rb', line 9 def sandbox_token @sandbox_token end |
Class Method Details
.api_url ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/mymoip.rb', line 13 def api_url if environment == "sandbox" "https://desenvolvedor.moip.com.br/sandbox" else "https://www.moip.com.br" end end |
.ensure_key_and_token_set! ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/mymoip.rb', line 39 def ensure_key_and_token_set! if MyMoip.key.blank? raise StandardError, "Invalid MyMoip.#{environment}_key set." elsif MyMoip.token.blank? raise StandardError, "Invalid MyMoip.#{environment}_token set." end end |
.key ⇒ Object
31 32 33 |
# File 'lib/mymoip.rb', line 31 def key send(:"#{environment}_key") end |
.key=(value) ⇒ Object
21 22 23 24 |
# File 'lib/mymoip.rb', line 21 def key=(value) warn "[DEPRECATION] `key=` is deprecated. Please use `sandbox_key` or `production_key` instead." @production_key = @sandbox_key = value end |
.token ⇒ Object
35 36 37 |
# File 'lib/mymoip.rb', line 35 def token send(:"#{environment}_token") end |
.token=(value) ⇒ Object
26 27 28 29 |
# File 'lib/mymoip.rb', line 26 def token=(value) warn "[DEPRECATION] `token=` is deprecated. Please use `sandbox_token` or `production_token` instead." @production_token = @sandbox_token = value end |