Module: ActiveMerchant::Billing::Base
- Defined in:
- lib/active_merchant/billing/base.rb
Class Method Summary collapse
-
.gateway(name) ⇒ Object
Return the matching gateway for the provider * bogus: BogusGateway - Does nothing (for testing) * moneris: MonerisGateway * authorize_net: AuthorizeNetGateway * trust_commerce: TrustCommerceGateway.
-
.integration(name) ⇒ Object
Return the matching integration module You can then get the notification from the module * bogus: Bogus - Does nothing (for testing) * chronopay: Chronopay * paypal: Paypal.
- .integration_mode ⇒ Object
-
.integration_mode=(mode) ⇒ Object
Set ActiveMerchant integrations in test mode.
- .mode=(mode) ⇒ Object
-
.test? ⇒ Boolean
A check to see if we're in test mode.
Class Method Details
.gateway(name) ⇒ Object
Return the matching gateway for the provider
-
bogus: BogusGateway - Does nothing (for testing)
-
moneris: MonerisGateway
-
authorize_net: AuthorizeNetGateway
-
trust_commerce: TrustCommerceGateway
ActiveMerchant::Billing::Base.gateway('moneris').new
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/active_merchant/billing/base.rb', line 41 def self.gateway(name) name_str = name.to_s.strip.downcase raise(ArgumentError, 'A gateway provider must be specified') if name_str.blank? begin Billing.const_get("#{name_str}_gateway".camelize) rescue raise ArgumentError, "The specified gateway is not valid (#{name_str})" end end |
.integration(name) ⇒ Object
Return the matching integration module You can then get the notification from the module
-
bogus: Bogus - Does nothing (for testing)
-
chronopay: Chronopay
-
paypal: Paypal
chronopay = ActiveMerchant::Billing::Base.integration('chronopay') notification = chronopay.notification(raw_post)
62 63 64 |
# File 'lib/active_merchant/billing/base.rb', line 62 def self.integration(name) Billing::Integrations.const_get("#{name.to_s.downcase}".camelize) end |
.integration_mode ⇒ Object
17 18 19 20 |
# File 'lib/active_merchant/billing/base.rb', line 17 def self.integration_mode ActiveMerchant.deprecated(OFFSITE_PAYMENT_EXTRACTION_MESSAGE) @@integration_mode end |
.integration_mode=(mode) ⇒ Object
Set ActiveMerchant integrations in test mode.
ActiveMerchant::Billing::Base.integration_mode = :test
12 13 14 15 |
# File 'lib/active_merchant/billing/base.rb', line 12 def self.integration_mode=(mode) ActiveMerchant.deprecated(OFFSITE_PAYMENT_EXTRACTION_MESSAGE) @@integration_mode = mode end |
.mode=(mode) ⇒ Object
26 27 28 29 30 |
# File 'lib/active_merchant/billing/base.rb', line 26 def self.mode=(mode) @@mode = mode self.gateway_mode = mode @@integration_mode = mode end |
.test? ⇒ Boolean
A check to see if we're in test mode
67 68 69 |
# File 'lib/active_merchant/billing/base.rb', line 67 def self.test? self.gateway_mode == :test end |