feat: Support for Whatsapp Cloud API (#4938)

Ability to configure Whatsapp Cloud API Inboxes

fixes: #4712
This commit is contained in:
Sojan Jose
2022-07-06 21:45:03 +02:00
committed by GitHub
parent 4375a7646e
commit a6c609f43d
27 changed files with 999 additions and 229 deletions

View File

@@ -36,11 +36,17 @@ FactoryBot.define do
transient do
sync_templates { true }
validate_provider_config { true }
end
before(:create) do |channel_whatsapp, options|
# since factory already has the required message templates, we just need to bypass it getting updated
channel_whatsapp.define_singleton_method(:sync_templates) { return } unless options.sync_templates
channel_whatsapp.define_singleton_method(:validate_provider_config) { return } unless options.validate_provider_config
if channel_whatsapp.provider == 'whatsapp_cloud'
channel_whatsapp.provider_config = { 'api_key' => 'test_key', 'phone_number_id' => '123456789', 'business_account_id' => '123456789',
'webhook_verify_token': 'test_token' }
end
end
after(:create) do |channel_whatsapp|