Skip to content

Instantly share code, notes, and snippets.

@mojtabaahn
Created September 2, 2022 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mojtabaahn/cc6a4800cf096eeddefc2155469d7a8d to your computer and use it in GitHub Desktop.
Save mojtabaahn/cc6a4800cf096eeddefc2155469d7a8d to your computer and use it in GitHub Desktop.
Mocking SDKs in python [1]
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