Skip to content

Commit

Permalink
[Community] log checkout url
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Jul 14, 2024
1 parent 267f8ad commit 63469b5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion octobot/community/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ async def _fetch_package_urls(self, mqtt_uuid: typing.Optional[str]) -> (list[st

async def fetch_checkout_url(self, payment_method, redirect_url):
try:
self.logger.debug(f"Fetching {payment_method} checkout url")
resp = await self.supabase_client.http_post(
constants.COMMUNITY_EXTENSIONS_CHECK_ENDPOINT,
json={
Expand All @@ -610,7 +611,13 @@ async def fetch_checkout_url(self, payment_method, redirect_url):
if not json_resp:
# valid error code but no content: user already has this product
return None
return json_resp["checkout_url"]
url = json_resp["checkout_url"]
self.logger.info(
f"Here is your {constants.OCTOBOT_EXTENSION_PACKAGE_1_NAME} checkout url {url} "
f"paste it into a web browser to proceed to payment if your browser did to automatically "
f"redirected to it."
)
return url
except Exception as err:
self.logger.exception(err, True, f"Error when fetching checkout url: {err}")
raise
Expand Down

0 comments on commit 63469b5

Please sign in to comment.