Module: PurchaseKit

Defined in:
lib/purchasekit.rb,
lib/purchasekit/error.rb,
lib/purchasekit/engine.rb,
lib/purchasekit/events.rb,
lib/purchasekit/product.rb,
lib/purchasekit/version.rb,
lib/purchasekit/api_client.rb,
lib/purchasekit/pay/webhook.rb,
lib/purchasekit/pay/webhooks.rb,
lib/purchasekit/product/demo.rb,
lib/purchasekit/configuration.rb,
lib/purchasekit/product/remote.rb,
lib/purchasekit/purchase/intent.rb,
lib/purchasekit/pay/webhooks/base.rb,
lib/purchasekit/webhook_signature.rb,
lib/purchasekit/purchase/intent/demo.rb,
lib/purchasekit/purchase/intent/remote.rb,
app/helpers/purchase_kit/paywall_helper.rb,
app/controllers/purchase_kit/webhooks_controller.rb,
app/controllers/purchase_kit/purchases_controller.rb,
lib/purchasekit/pay/webhooks/subscription_created.rb,
lib/purchasekit/pay/webhooks/subscription_expired.rb,
lib/purchasekit/pay/webhooks/subscription_updated.rb,
lib/purchasekit/pay/webhooks/subscription_canceled.rb,
app/controllers/purchase_kit/application_controller.rb,
app/controllers/purchase_kit/purchase/completions_controller.rb

Defined Under Namespace

Modules: Events, Pay, PaywallHelper, Purchase Classes: ApiClient, ApplicationController, Configuration, Engine, Error, NotFoundError, PaywallBuilder, Product, PurchasesController, SignatureVerificationError, SubscriptionRequiredError, WebhookSignature, WebhooksController

Constant Summary collapse

VERSION =
"0.7.1"

Class Method Summary collapse

Class Method Details

.configObject



33
34
35
# File 'lib/purchasekit.rb', line 33

def config
  @config ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields:



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

def configure
  yield(config)
end

.pay_enabled?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/purchasekit.rb', line 45

def pay_enabled?
  defined?(::Pay) && defined?(::Pay::VERSION)
end

.queue_pay_webhook(event) ⇒ Object



49
50
51
52
# File 'lib/purchasekit.rb', line 49

def queue_pay_webhook(event)
  return unless defined?(PurchaseKit::Pay::Webhook)
  PurchaseKit::Pay::Webhook.queue(event)
end

.reset_config!Object



41
42
43
# File 'lib/purchasekit.rb', line 41

def reset_config!
  @config = Configuration.new
end