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.
- .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
33 34 35 |
# File 'lib/active_merchant/billing/base.rb', line 33 def self.gateway(name) Billing.const_get("#{name.to_s.downcase}_gateway".camelize) 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)
46 47 48 |
# File 'lib/active_merchant/billing/base.rb', line 46 def self.integration(name) Billing::Integrations.const_get("#{name.to_s.downcase}".camelize) end |
.mode=(mode) ⇒ Object
18 19 20 21 22 |
# File 'lib/active_merchant/billing/base.rb', line 18 def self.mode=(mode) @@mode = mode self.gateway_mode = mode self.integration_mode = mode end |
.test? ⇒ Boolean
A check to see if we're in test mode
51 52 53 |
# File 'lib/active_merchant/billing/base.rb', line 51 def self.test? self.gateway_mode == :test end |