Ask something in the search bar to get a quick answer from our AI model

Subscriptions

Manage Recurring Payments Flexibly and Securely.

Definition

At Wipay, we deliver scalability and efficiency to merchants integrating our platform. Our subscription solution handles the entire lifecycle of recurring payments—from creation through termination—including payment management, retries, and error handling. It’s a comprehensive offering for subscription‑based business models or any merchant seeking to streamline their customers’ recurring payments.

Key Benefits

  • One‑Step Process: Create the subscription and automatically process the initial charge.

  • Payment Flexibility: Supports both returning customers with stored payment methods and brand‑new customers.

  • Guaranteed Security: Handles payment tokens safely without exposing sensitive data.

Main Use Cases

Subscription Creation

This workflow builds each recurring subscription from the ground up:

  1. Merchant Validation: Authenticate the merchant and verify their permissions.

  2. Subscription Setup: Configure billing cycle parameters.

  3. Payment Method Handling:

    • Existing Customers: Associate and verify the stored payment token.

    • New Customers: Provide a secure portal to register payment details.

  4. First Charge Execution: Process the initial payment.

  5. Activation: Enable the subscription for future billing cycles.

Scenarios & Security:

  • New Customer: Generate a secure link for payment registration.

  • Existing Customer: Immediately process payment with stored token.

  • Security Mechanisms: Tokenize sensitive data, validate merchant permissions, and audit every operation.


Initial Payment Management

This component ensures the first charge is handled correctly:

  • Success: Activates the subscription and triggers related workflows.

  • Failure: Runs a full rollback protocol to maintain system integrity.

  • Record‑Keeping: Logs every transaction in detail and updates payment tokens if required.

Flow:

  1. Attempt charge using the stored token.

  2. On success, activate subscription.

  3. On failure, cancel subscription and reverse any partial effects.


Scheduling Recurring Payments

Automates future charges based on the configured frequency:

  • Date Calculation: Computes each upcoming billing date, accounting for calendar nuances.

  • Charge Generation: Creates deferred‑execution records for pending payments.

  • Serverless Integration: Orchestrates execution via serverless functions.

  • Lifecycle Detection: Identifies when a subscription reaches its planned end and marks it complete.


Subscription Cancellation

Manages graceful termination of subscriptions:

  1. Update subscription status.

  2. Record cancellation reason (user‑initiated, payment failures, or system errors).

  3. Clean up any scheduled future charges.


Deferred Payment Result Handling

Processes outcomes of automatic recurring charges:

  1. Receive result (success, customer failure, or system error).

  2. Success: Schedule next billing cycle and log payment.

  3. Customer Failure:

    • Initiate retry flow with configurable intervals.

    • Cancel subscription if maximum retries are exceeded.

  4. System Error:

    • Cancel subscription for consistency.

    • Log error reason for audit.


Payment Error Handling

Handles customer‑facing payment rejections with a retry strategy:

  • Exponential Backoff Retries: Attempts a configurable number of retries at increasing intervals.

  • Auto‑Cancellation: Cancels subscription after exceeding retry limit.

Configuration Options:

  • Maximum retry attempts

  • Interval between retries

  • Final actions upon reaching limits


Subscription Activation

Coordinates marking a subscription as active:

  • Triggers: First successful payment, successful recurring charge, or manual reactivation.

  • State Updates: Transition to “active,” schedule next charge, and manage any new tokens.

  • Event Dispatch: Send notifications and enable subscriber benefits.


Security Considerations

  • All payment data is tokenized.

  • Merchant identity is validated on each operation.

  • Full audit trail for every action.

  • PCI‑DSS compliance through strict tokenization practices.


This documentation presents the core capabilities and workflows of our subscription microservice, giving a complete overview of how we manage recurring payment lifecycles.

Last updated