Feature: Create conversations from Tweets (#470)
* Feature: Add tweets to conversations
This commit is contained in:
parent
3465ebefd1
commit
272c481464
29 changed files with 333 additions and 68 deletions
|
@ -13,7 +13,7 @@ class Api::V1::WebhooksController < ApplicationController
|
|||
end
|
||||
|
||||
def twitter_crc
|
||||
render json: { response_token: "sha256=#{$twitter.generate_crc(params[:crc_token])}" }
|
||||
render json: { response_token: "sha256=#{twitter_client.generate_crc(params[:crc_token])}" }
|
||||
end
|
||||
|
||||
def twitter_events
|
||||
|
@ -26,6 +26,12 @@ class Api::V1::WebhooksController < ApplicationController
|
|||
|
||||
private
|
||||
|
||||
def twitter_client
|
||||
Twitty::Facade.new do |config|
|
||||
config.consumer_secret = ENV.fetch('TWITTER_CONSUMER_SECRET', nil)
|
||||
end
|
||||
end
|
||||
|
||||
def login_from_basic_auth
|
||||
authenticate_or_request_with_http_basic do |username, password|
|
||||
username == ENV['CHARGEBEE_WEBHOOK_USERNAME'] && password == ENV['CHARGEBEE_WEBHOOK_PASSWORD']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue