more cleaning and added the url in API endpoint
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Failing after 1m59s
Build and deploy the backend to staging / Deploy to staging (pull_request) Has been skipped
Run linting on the backend code / Build (pull_request) Successful in 46s
Run testing on the backend code / Build (pull_request) Failing after 2m46s
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Failing after 1m59s
Build and deploy the backend to staging / Deploy to staging (pull_request) Has been skipped
Run linting on the backend code / Build (pull_request) Successful in 46s
Run testing on the backend code / Build (pull_request) Failing after 2m46s
This commit is contained in:
@@ -231,7 +231,12 @@ class PaypalClient:
|
|||||||
return access_token
|
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.
|
Creates a new PayPal order.
|
||||||
|
|
||||||
@@ -263,10 +268,9 @@ class PaypalClient:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
# TODO: add these to anydev website
|
|
||||||
'application_context': {
|
'application_context': {
|
||||||
'return_url': 'https://anydev.info',
|
'return_url': return_url_success,
|
||||||
'cancel_url': 'https://anydev.info'
|
'cancel_url': return_url_failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ logger = logging.getLogger(__name__)
|
|||||||
def create_order(
|
def create_order(
|
||||||
user_id: str,
|
user_id: str,
|
||||||
basket: list,
|
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.
|
Creates a new PayPal order.
|
||||||
@@ -45,7 +47,7 @@ def create_order(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Process the order and return the details
|
# 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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
"""Collection of tests to ensure correct implementation and track progress."""
|
"""Collection of tests to ensure correct implementation and track progress."""
|
||||||
import os
|
|
||||||
import time
|
import time
|
||||||
import yaml
|
|
||||||
from fastapi.testclient import TestClient
|
from fastapi.testclient import TestClient
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from .test_utils import load_trip_landmarks, log_trip_details
|
from .test_utils import load_trip_landmarks, log_trip_details
|
||||||
from ..supabase.supabase import SupabaseClient
|
from ..supabase.supabase import SupabaseClient
|
||||||
from ..structs.preferences import Preferences, Preference
|
from ..structs.preferences import Preferences, Preference
|
||||||
from ..constants import PARAMETERS_DIR
|
|
||||||
from ..main import app
|
from ..main import app
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
"""Helper methods for testing."""
|
"""Helper methods for testing."""
|
||||||
import time
|
|
||||||
import logging
|
import logging
|
||||||
from functools import wraps
|
|
||||||
from fastapi import HTTPException
|
from fastapi import HTTPException
|
||||||
|
|
||||||
from ..cache import client as cache_client
|
from ..cache import client as cache_client
|
||||||
from ..structs.landmark import Landmark
|
from ..structs.landmark import Landmark
|
||||||
from ..structs.preferences import Preferences, Preference
|
|
||||||
|
|
||||||
|
|
||||||
def landmarks_to_osmid(landmarks: list[Landmark]) -> list[int] :
|
def landmarks_to_osmid(landmarks: list[Landmark]) -> list[int] :
|
||||||
|
|||||||
Reference in New Issue
Block a user