fix review changes
This commit is contained in:
@@ -10,8 +10,7 @@ class Whatsapp::EmbeddedController < ApplicationController
|
||||
render json: {
|
||||
status: 'ready',
|
||||
app_id: GlobalConfigService.load('WHATSAPP_APP_ID', ''),
|
||||
config_id: GlobalConfigService.load('WHATSAPP_CONFIGURATION_ID', ''),
|
||||
app_secret: GlobalConfigService.load('WHATSAPP_APP_SECRET', '')
|
||||
config_id: GlobalConfigService.load('WHATSAPP_CONFIGURATION_ID', '')
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ const formState = {
|
||||
};
|
||||
|
||||
const initialState = {
|
||||
name: '',
|
||||
url: '',
|
||||
assistantId: null,
|
||||
};
|
||||
|
||||
|
||||
@@ -97,11 +97,14 @@ class Whatsapp::EmbeddedSignupService
|
||||
end
|
||||
|
||||
def register_phone_number(phone_number_id, access_token)
|
||||
# Generate a random 6-digit PIN
|
||||
pin = SecureRandom.random_number(900_000) + 100_000
|
||||
|
||||
HTTParty.post(
|
||||
"https://graph.facebook.com/#{whatsapp_api_version}/#{phone_number_id}/register",
|
||||
{
|
||||
headers: { 'Authorization' => "Bearer #{access_token}", 'Content-Type' => 'application/json' },
|
||||
body: { messaging_product: 'whatsapp', pin: '212834' }.to_json
|
||||
body: { messaging_product: 'whatsapp', pin: pin.to_s }.to_json
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user