workspace extends ../common/finance-common-model.dsl { name "Payment system" description "Payment system is responsible for processing payments, chargebacks, refunds, and etc." model { !extend paymentSystem { !docs docs paymentProviderDb = container "Payment provider database" { description "Stores payment provider related data" technology "MySQL" tags "Google Cloud Platform - Compute Engine" "Database" "MySQL" } paymentRouterDb = container "Payment router database" { description "Stores payment routing data" technology "MySQL" tags "Google Cloud Platform - Compute Engine" "Database" "MySQL" } paymentKV = container "PaymentKV" { description "Payment provider key-value storage" technology "Aerospike" tags "Google Cloud Platform - Compute Engine" "Database" "Aerospike" } } # PaymentRouter getPaymentMethodCampaigns = paymentRouter -> paymentRouterDb "Get payment method campaigns" "SQL" resolveAudiencesRl = paymentRouter -> audienceSystem "Resolve audiences" "HTTPS" getMethodSavedDataRl = paymentRouter -> paymentProvider "Get method savedData" "HTTPS" getOfferPricePointsRl = paymentRouter -> personalOffers "Get offer price points" "HTTPS" getTicketsRL = paymentRouter -> paymentProvider "Calculate taxes and create tickets" "HTTPS" paymentRouter -> offerManagementSystem "Get missing offers" "HTTPS" # PaymentProvider paymentProvider -> paymentProviderDb "Reads/stored saved payment method data" getDataByTicketRl = paymentProvider -> paymentKV "Get data by ticket" "Aerospike client" "Cache" storeDataByTicketRl = paymentProvider -> paymentKV "Store data by ticket" "Aerospike client" "Cache" deleteTicketRl = paymentProvider -> paymentKV "Delete ticket" "Aerospike client" "Cache" paymentProvider -> personalOffers "Validate request" "HTTPS" paymentProvider -> paymentProviderDb "Store purchase data" "SQL" paymentProvider -> finance "Process balances" "Kafka" paymentProvider -> externalPaymentSystem "Process purchase" "HTTPS" externalPaymentSystem -> paymentProvider "Process purchase callback" "HTTPS" } views { systemLandscape "SystemLandscape" "Payment system landscape" { include * animation { liveOps offerRecommendationSystem audienceSystem offerManagementSystem financeSystem user paymentSystem mainKafkaCluster } autoLayout } systemcontext paymentSystem "paymentSystemContext" { include * autoLayout } container paymentSystem "paymentSystemcontainer" { include * autoLayout } dynamic paymentSystem "get-personal-offers-flow" { title "Get personal offers flow" description "Describes steps to get personal offers" user -> personalOffers user -> paymentRouter getOfferPricePointsRl } dynamic paymentSystem "get-payment-methods-flow" { autoLayout title "Get payment methods flow" description "Describes steps to resolve available payment methods for user" user -> personalOffers user -> paymentRouter getPaymentMethodCampaigns resolveAudiencesRl getMethodSavedDataRl getOfferPricePointsRl paymentRouter -> offerManagementSystem getTicketsRL storeDataByTicketRl } dynamic paymentSystem "purchase-request" { user -> paymentProvider getDataByTicketRl paymentProvider -> personalOffers paymentProvider -> externalPaymentSystem externalPaymentSystem -> paymentProvider paymentProvider -> financeSystem deleteTicketRl autoLayout description "Make purchase request" } } }