GalleryExamplesDraw your repo

Examples / Class diagrams

Payment provider classes

A class design that hides several payment providers behind one interface, with a factory picking the provider and a shared result type.

Payment provider classes: class diagram of PaymentProvider, StripeProvider, PayPalProvider, ProviderFactory, PaymentService and 2 more▶ Play the story
Open in Plotix A copy you can edit, or ask the agent to change.
Plotix's agent drew it from this request

Draw a class diagram of a payments module in TypeScript that hides providers behind one interface: a PaymentProvider interface with charge, refund and webhook methods, StripeProvider and PayPalProvider implementing it, a ProviderFactory, a PaymentService using the interface, and Money and PaymentResult value types.

What's in it
Payment provider classes: class diagram of PaymentProvider, StripeProvider, PayPalProvider, ProviderFactory, PaymentService and 2 more

How the parts connect

More on class diagrams.

Related examples

OAuth login with PKCE: sequence diagram of Browser, React SPA, Authorization server and App API
OAuth login with PKCESequence · How a single-page app signs a user in with OAuth 2.0 authorization code and PKCE, from th…
Stripe checkout and webhook: flow diagram of Shopper starts checkout, Create Checkout Session, Redirect shopper to Stripe, Payment succeeds?, Card declined or error and 5 more
Stripe checkout and webhookFlow · The steps from a cart to a paid order with Stripe Checkout, including the webhook that co…
Serverless API on AWS: deployment diagram of CloudFront, API Gateway, Lambda functions, Cognito user pool, CloudWatch Logs and 4 more
Serverless API on AWSDeployment · Where a serverless web API runs on AWS: CloudFront and S3 for the site, API Gateway and L…