Skip to content

Commit

Permalink
Merge branch 'feature/receive-wac-token-from-frontend' of https://git…
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslinhares committed Jan 24, 2024
2 parents 07d355f + f1a3fdf commit de3ab62
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions marketplace/core/types/channels/whatsapp_cloud/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ def create(self, request, *args, **kwargs):
if response.status_code != status.HTTP_200_OK:
raise ValidationError(response.json())

phone_number_request = PhoneNumbersRequest(user_auth)
phone_number = phone_number_request.get_phone_number(phone_number_id)
print('PHONE NUMBER', phone_number)

url = f"{base_url}/{phone_number_id}/register"
pin = get_random_string(6, string.digits)
data = dict(messaging_product="whatsapp", pin=pin)
Expand All @@ -168,10 +172,6 @@ def create(self, request, *args, **kwargs):
if response.status_code != status.HTTP_200_OK:
raise ValidationError(response.json())

phone_number_request = PhoneNumbersRequest(user_auth)
phone_number = phone_number_request.get_phone_number(phone_number_id)
print('PHONE NUMBER', phone_number)

config = dict(
wa_number=phone_number.get("display_phone_number"),
wa_verified_name=phone_number.get("verified_name"),
Expand Down

0 comments on commit de3ab62

Please sign in to comment.