Merge modifications for more separate backend functions #69

Open
kscheidecker wants to merge 39 commits from backend/micro-services-restructuring into main
4 changed files with 12 additions and 12 deletions
Showing only changes of commit d9724ff07d - Show all commits

View File

@@ -231,7 +231,12 @@ class PaypalClient:
return access_token
def order(self, order_request: OrderRequest):
def order(
self,
order_request: OrderRequest,
return_url_success: str,
return_url_failure: str
):
"""
Creates a new PayPal order.
@@ -263,10 +268,9 @@ class PaypalClient:
}
}
],
# TODO: add these to anydev website
'application_context': {
'return_url': 'https://anydev.info',
'cancel_url': 'https://anydev.info'
'return_url': return_url_success,
'cancel_url': return_url_failure
}
}

View File

@@ -23,7 +23,9 @@ logger = logging.getLogger(__name__)
def create_order(
user_id: str,
basket: list,
currency: Literal['CHF', 'EUR', 'USD']
currency: Literal['CHF', 'EUR', 'USD'],
return_url_success: str = 'https://anydev.info',
return_url_failure: str = 'https://anydev.info'
):
"""
Creates a new PayPal order.
@@ -45,7 +47,7 @@ def create_order(
)
# Process the order and return the details
return paypal_client.order(order_request = order)
return paypal_client.order(order_request=order, return_url_success=return_url_success, return_url_failure=return_url_failure)

View File

@@ -1,14 +1,11 @@
"""Collection of tests to ensure correct implementation and track progress."""
import os
import time
import yaml
from fastapi.testclient import TestClient
import pytest
from .test_utils import load_trip_landmarks, log_trip_details
from ..supabase.supabase import SupabaseClient
from ..structs.preferences import Preferences, Preference
from ..constants import PARAMETERS_DIR
from ..main import app

View File

@@ -1,12 +1,9 @@
"""Helper methods for testing."""
import time
import logging
from functools import wraps
from fastapi import HTTPException
from ..cache import client as cache_client
from ..structs.landmark import Landmark
from ..structs.preferences import Preferences, Preference
def landmarks_to_osmid(landmarks: list[Landmark]) -> list[int] :