Created
September 2, 2022 06:38
-
-
Save mojtabaahn/cc6a4800cf096eeddefc2155469d7a8d to your computer and use it in GitHub Desktop.
Mocking SDKs in python [1]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from starlette.responses import RedirectResponse | |
from payment_sdk import payment_sdk | |
from basket import Basket | |
class PurchaseBasketController: | |
def __init__(self,basket : Basket): | |
self.__basket = basket | |
def __validate(self): | |
pass | |
def __lock(self): | |
pass | |
def handle(basket): | |
self.__validate() | |
self.__lock() | |
url = payment_sdk.get_gateway_url(basket.id) | |
return RedirectResponse(url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment