Sophie Hautcoeur Neeman
Back to projects

Shopify Payment Gateway

Shopify Payment Gateway
PythonFastAPIReact 19TypeScriptDynamoDBViteDockerAWS ECSJenkinspytestJestCypress

Production Shopify payment integration bringing buy-now-pay-later financing into the native checkout: two apps sharing one codebase, real-time loan applications, a webhook-driven payment state machine, and full order synchronization.

Overview

A production Shopify payment integration that lets merchants offer buy-now-pay-later financing directly in the Shopify checkout. When a customer selects financing, the app bridges Shopify's Payments API with WeGetFinancing's lending platform, submitting a loan application in real time and redirecting the customer to complete it — transparently, without leaving the checkout flow. The system runs as two Shopify apps sharing a single codebase: a Payment App handling checkout financing and a Sync App keeping order and checkout state consistent across systems.

The problem

Shopify merchants needed third-party financing without breaking the native checkout experience. That meant integrating deeply with Shopify's Payments extension API and its strict latency and security requirements, routing customers through an external loan application without disrupting checkout, and keeping order and payment state accurate across both platforms — including refunds, cancellations and re-orders.

Architecture

  • Backend: async Python FastAPI with a layered architecture (routes → services → connectors → DynamoDB via PynamoDB). Dependency injection handles authentication, shop resolution and connector initialization at request level.
  • Frontend: React 19 + TypeScript merchant dashboard built with Vite, served as a single bundle for compatibility with Shopify's app embedding constraints.
  • Data: AWS DynamoDB with custom Global Secondary Indexes on cart token, customer name and order ID — O(1) lookups without a relational join layer.
  • Infrastructure: multi-stage Docker builds deployed to AWS ECS via Jenkins CI/CD across four environments (dev-sandbox, dev1, staging, production); static assets on S3.

Key technical challenges

  • Async webhook processing: Shopify requires webhook responses within 5 seconds, while a loan application can take much longer. The endpoint returns 200 immediately and dispatches the application as a background task, with payment state tracked in DynamoDB.
  • GDPR webhooks: implemented Shopify's three mandatory endpoints — customer data export, customer data redaction and shop data deletion on uninstall — including scan-based deletion by email across payment and checkout records.
  • Payment state machine: created → processing → processed → captured / refunded, driven by Shopify webhooks (order paid, fulfilled, refunded) with careful handling of out-of-order delivery.

Engineering practices

mypy strict mode on the backend and strict TypeScript on the frontend; Ruff and ESLint enforced via pre-commit hooks; pytest with parallel execution, Jest unit tests and Cypress E2E; dependency and security scanning blocking in CI; sprint-based versioning with automated version bumps and image tagging.

Scale

Around 14,000 lines of code across 150+ files, 20+ REST endpoints, 10+ webhook types, 8 DynamoDB models, 30+ test files, and 4 independent deployment environments.

Outcome

The integration runs in production serving live Shopify merchants, making point-of-sale financing a first-class checkout option. The dual-app architecture cleanly separates payment capture from order synchronization, so each can be deployed, scaled and maintained independently without shared failure modes.

Gallery

Sophie Hautcoeur Neeman — Full-Stack Engineer