Individual Video Purchases & Subscriptions
This service connects language, currency, Korean and international payment gateways, and viewing access in one backend flow so existing offline customers and online users can buy and subscribe to content in the same video center. By reusing the order, payment, and access models and payment gateway/Outbox patterns validated in a preceding platform, I deployed the video center's payment and subscription backend to production within 3 weeks of receiving the requirements document.
- Company
- Korea Institute of Psychological Education
- Service
- Video Center
- Period
- June–July 2026 · 3 weeks
- Role
- Backend Engineer
- Responsibility
- User/Admin API · DB · Async/Batch · AWS Ops
- Team
- BE 1 · FE 2 · Designer 1 · PM/Ops 1
- NestJS
- TypeScript
- PostgreSQL
- Prisma
- BullMQ
- Redis
- Outbox
- AWS
- NICEPAY · Payletter (PG)
- Claude · Codex
Project Overview
I brought existing offline and online customers into one video center service
The core challenge was connecting an offline-centered customer base and a separate online usage flow into one video content service.
With foreign users also making up part of the customer base, this transition required a service structure designed for a global audience from the outset, beyond simply adding payments for users in Korea.
By reusing the order, payment, and access models and payment gateway/Outbox patterns validated in a preceding platform, I deployed the video center's payment and subscription backend to production within 3 weeks of receiving the requirements document.
I owned the backend end to end, building the flow from video discovery to viewing through individual purchases or monthly subscriptions. Detailed responsibilities and the constraints that needed to be addressed first are summarized below under Ownership / Constraints, with implementation evidence organized by phase in the Implementation Timeline.
Ownership
My direct responsibilities
- Refined product, pricing, and subscription policies with product planning and operations, and shared payment and subscription contracts with the frontend through Swagger/OpenAPI
- Designed models for video and subscription products, localized display and pricing currencies, individual-video entitlements, and viewing access
- Implemented order, billing, payment, and access use cases for individual purchases and monthly subscriptions
- Implemented NICEPAY and Payletter integration, initial payments, renewals, retries, plan changes, end-of-period cancellation, and resumption
- Established recovery paths for internal failures after payment gateway approval without charging again, and configured the PostgreSQL, Redis, and AWS operating environment
Constraints
Constraints to address first
- Because one video was the content unit, reusing the existing course/section hierarchy would have made products, purchases, and viewing access unnecessarily complex.
- Users in Korea and abroad shared the service, so localized display, pricing currencies, product codes, access rights, and payment state could not be mixed into one model.
- Individual purchases and monthly subscriptions differed in purchase history, billing history, and the criteria for granting and ending access, so they could not be merged into one flow.
- NICEPAY and Payletter differed in approval and callback behavior, but the service needed to handle them with the same internal payment states and processing criteria.
- Duplicate billing and internal finalization failures after payment gateway approval needed recoverable states that did not require charging users again.
Implementation Timeline
The implementation sequence for extending existing customers into online video purchases and subscriptions
Considering offline customers, existing online users, and international users together, I divided the work into video models, language and currency display, individual purchases, initial subscriptions, renewal recovery, and change/cancellation policies. Select a phase to see the problem identified at that stage and how it led to the architecture and verification criteria.
Video Products & Access Policies
Project Infrastructure
I separated shared infrastructure into API, Worker, database, Redis, and external payment gateway boundaries
I separately documented the execution boundaries and deployment checkpoints needed to operate payments and subscriptions.
Rendering the diagram.
- I separated the API from renewal and Outbox Workers, assigning order, billing, payment, and access state to PostgreSQL and asynchronous execution and retries to Redis and BullMQ.
- GitHub Actions creates deployment artifacts, with S3, CodeDeploy, and PM2 updating API and Worker processes.
- External gateway calls run outside database transactions, while internal state finalization uses short transactions and Worker reprocessing boundaries.
- After deployment, readiness and the core paths for individual purchases, initial subscriptions, and renewal Workers served as verification criteria.
Outcome
Verifiable outcomes
- Separated video access policies from individual-video entitlements so the server determines viewing eligibility at request time
- Connected NICEPAY and Payletter individual payments and initial subscriptions through shared order, payment, and subscription models
- Implemented the subscription lifecycle spanning initial payments, renewals, plan changes, end-of-period cancellation, and resumption
- Protected against duplicate charges for the same billing cycle through row locks, cycle claims, and uniqueness constraints
- Implemented activation and renewal reprocessing paths that recover from internal finalization failures after gateway approval without another gateway call
Limitations
Limitations and unimplemented scope
- Full refunds for individual purchases are implemented, but concurrent refund claims and automatic recovery from internal finalization failure after successful gateway cancellation need additional hardening.
- Partial refunds and subscription refunds were outside the implementation scope.
- The policy model contains a structure for calculating price differences, but it was not applied in the final product policy.
- Uncertain states such as lost Payletter webhooks or gateway approval request timeouts require provider retransmission or manual verification. An automatic reconciliation layer remains a separate improvement candidate.
- I do not report gateway-specific operational success rates or throughput as quantitative outcomes because publicly shareable operational evidence is unavailable.