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 23, 2024
2 parents 41024d8 + 26afe4a commit 2609b88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion marketplace/core/types/channels/whatsapp_cloud/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def create(self, request, *args, **kwargs):
waba_currency = "USD"

base_url = settings.WHATSAPP_API_URL
weni_token_headers = {"Authorization": f"Bearer {settings.WHATSAPP_SYSTEM_USER_ACCESS_TOKEN}"}

url = f"{base_url}/oauth/access_token"
params = dict(
Expand Down Expand Up @@ -140,7 +141,8 @@ def create(self, request, *args, **kwargs):
url = f"{base_url}/{settings.WHATSAPP_CLOUD_EXTENDED_CREDIT_ID}/whatsapp_credit_sharing_and_attach"
params = dict(waba_id=waba_id, waba_currency=waba_currency)
print(url, params)
response = requests.post(url, params=params, headers=headers)

response = requests.post(url, params=params, headers=weni_token_headers)
print(response.json())

if response.status_code != status.HTTP_200_OK:
Expand Down

0 comments on commit 2609b88

Please sign in to comment.