Initial Commit
Co-authored-by: Subin <subinthattaparambil@gmail.com> Co-authored-by: Manoj <manojmj92@gmail.com> Co-authored-by: Nithin <webofnithin@gmail.com>
This commit is contained in:
commit
2a34255e0b
537 changed files with 27318 additions and 0 deletions
27
app/controllers/api/v1/webhooks_controller.rb
Normal file
27
app/controllers/api/v1/webhooks_controller.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
class Api::V1::WebhooksController < ApplicationController
|
||||
skip_before_action :authenticate_user!, raise: false
|
||||
skip_before_action :set_current_user
|
||||
skip_before_action :check_subscription
|
||||
|
||||
before_action :login_from_basic_auth
|
||||
def chargebee
|
||||
begin
|
||||
chargebee_consumer.consume
|
||||
head :ok
|
||||
rescue => e
|
||||
Raven.capture_exception(e)
|
||||
head :ok
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def login_from_basic_auth
|
||||
authenticate_or_request_with_http_basic do |username, password|
|
||||
username == '' && password == ''
|
||||
end
|
||||
end
|
||||
|
||||
def chargebee_consumer
|
||||
@consumer ||= ::Webhooks::Chargebee.new(params)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue