Skip to main content
Version: Webel

[Payment Gateway Integration]

Author(s)

  • Arpita Dey
  • Dipak Mourya

Last Updated Date

[2025-02-26]


SRS References


Version History

VersionDateChangesAuthor
1.0025-02-26Initial draftArpita Dey,Dipak Mourya

Feature Overview

Objective:

1. Payment Initialization

  • The user provides payment details, including:
    • Customer ID
    • Total Amount
    • Invoice List (with Posted Invoice Number)
    • Whether the payment is for a Security Deposit or not.
  • The system prompts: "Do you want to proceed?"
  • If confirmed, a request is sent to api/payment/process-initiate/pg.
  • A Random Order Number is generated.

2. Database Entry (tblPaymentOrderMaster)

  • The system stores the payment details in tblPaymentOrderMaster, including:
    • Transaction ID
    • Transaction Date
    • Payment Order Number
    • Customer ID
    • Paid Amount
    • List of Invoice IDs
    • Current Status
    • Application Number
    • Initiation Time
    • Success Time
    • Failure Time
    • Current Status
    • Remarks
    • LogUser
    • LogDTS
  • The payment remains in a Initiated state initially.

3. Payment Encryption & Secure Redirection

  • If the transaction is submitted, the following values are encrypted:
    • Service ID
    • Department ID
    • Payment Order Number
    • Amount
    • Success URL
    • Cancel URL
  • The encrypted text is used to generate a secure payment request.
  • The system returns encrypted response and redirects the user to the Payment Gateway.

4. Payment Processing

  • The user is redirected to the Webel Payment Gateway.
  • The payment is processed by the gateway.
  • Upon completion, the system receives the payment response.

5. Payment Status Handling

  • The system validates the response using:
    • API Key
    • Payment Order Number
  • The payment result is categorized as:
    • Success: Updates payment status to "Completed".
    • Failure: Updates status accordingly.
  • The user is redirected based on the payment result.

6. Order Management

  • The system navigates back to the Payment Order Page.
  • Retrieves all payment orders from tblPaymentOrderMaster.
  • The user selects an order and chooses to:
    • Settle Order – Completes the payment settlement process.
    • Archive Order – Moves the order to an archived state for reference.
  • User can mark settled to a successfull payment order.
  • User can archieved or de-archieved any payment order.
  • Double Verification : user can re-verify an initiated or failed payment order.

Scope:
The feature facilitates secure online payments by processing transactions, updating statuses, and managing payment orders

Dependencies:
Webel Payment Gateway


Requirements

(List all the functional and non-functional requirements that the feature must meet.)

  1. API to initiate online payment processing.
  2. Database storage for payment details (tblPaymentOrderMaster).
  3. Random order number generation.
  4. Encryption mechanism for secure payment processing.
  5. Integration with a webel payment gateway.
  6. Handling of success and failure cases.
  7. Updating payment status based on gateway response.
  8. Redirecting users to appropriate screens after payment.
  9. Retrieves all payment orders from tblPaymentOrderMaster.
  10. Users navigate to the Payment Order Page to manage payment orders.
  11. User can settle or archieve Payment Orders.

Design Specifications

(Provide detailed design specifications, including UI/UX designs, API interfaces, and any other relevant architectural details.)

  • UI/UX Design:
    alt text alt text alt text

  • Data Models:
    (Detail the data structures, including database schemas or objects.)

    public record OnlinePaymentDetails
    {
    public required string CustId { get; init; }
    public required decimal TotalAmount { get; init; }
    public bool? IsSDPayment { get; init; }
    public string? ApplicationNumber { get; init; }
    public List<OnlinePaymentInvoiceDetails>? ListOfInvoice { get; init; }
    }

    public record OnlinePaymentInvoiceDetails
    {
    public Guid? InvoiceId { get; init; }
    public string? PostedInvoiceNumber { get; init; }
    }

    public record OnlinePaymentOrderDetails
    {
    public Guid? TransactionId { get; init; }
    public DateTime? TransactionDate { get; init; }
    public required string PaymentOrderNumber { get; init; }
    public required string CustomerId { get; init; }
    public required decimal TotalAmount { get; init; }
    public List<OnlinePaymentInvoiceDetails>? ListOfInvoice { get; init; }
    public bool? IsSDPayment { get; init; }
    public string? ApplicationNumber { get; init; }
    public OnlinePaymentStatus CurrentStatus { get; init; }
    public DateTime? InitiatedTime { get; init; }
    public DateTime? SuccessTime { get; init; }
    public DateTime? FailureTime { get; init; }
    public string? Remarks { get; init; }
    public string? LogUser { get; init; }
    public DateTime? LogDTS { get; init; }
    }

    public record PaymentGatewayDetails
    {
    public string? PaymentOrderNumber { get; set; }
    public decimal? TotalAmount { get; set; }
    public string? DepartmentId { get; set; }
    public string? ServiceId { get; set; }
    public string? AuthCode { get; set; }
    public string? Key1 { get; set; }
    public string? SuccessURL { get; set; }
    public string? FailureURL { get; set; }
    }

    public record OnlinePaymentResponse
    {
    public string? EncryptedRequest { get; set; }
    public string? AuthCode { get; set; }
    }

    public enum OnlinePaymentStatus { Initiated, Success, Failed }
    public enum BRSType
    {
    Settled,
    Unsettled,
    Archived,
    Any = -1
    }
  • API Interfaces:
    (Define the APIs required for this feature, including endpoints, methods, request/response formats.)

    EndpointMethodParametersResponseResponse Status Codes
    /process/initiate/pgPOSTOnlinePaymentDetailsOnlinePaymentResponse200, 204, 500
    /success/{apiKey}/{paymentOrderNumber}POSTapiKey,paymentOrderNumberRedirect200, 204, 500
    /cancel/{apiKey}/{paymentOrderNumber}POSTapiKey,paymentOrderNumberRedirect201, 204, 500
    /get/paymentorder{Custid}/{Type}/{StartDate}/{EndDate}/{PageNumber}/{RowsPerPage}GETCustid,Type,StartDate,EndDate,PageNumber,RowsPerPageOnlinePaymentOrderDetails200, 204, 500
    /paymentorder/settle/{paymentordernumber}PUTpaymentordernumber200, 204, 500
    /paymentorder/archieve/dearchieve/{paymentordernumber}PUTpaymentordernumber200, 204, 500
    /double-verify/paymentorder/{paymentordernumber}/{amount}Postpaymentordernumber,amount200, 204, 500
  • Third-Party Integrations:
    (List any third-party services or tools that need to be integrated.)

  • Workflow:
    (Describe the end-to-end workflow of the feature, detailing how different components interact, including the sequence of events, data flow, and the user journey.)

    alt text


Development Tasks & Estimates

(Break down the development process into smaller tasks and provide time estimates for each.)

NoTask NameEstimate (Hours)DependenciesNotes
1Payment Gateway Integration5 hoursAny notes here
2Online Payment Order Page4 hoursAny notes here
3Double Verification5 hoursAny notes here
4Workflow Testing2 hoursAny notes here
5Invoice Payment screen for customer login UI design5 hoursAny notes here
6API integration for getting auth code and encrypted text1.5 hoursAny notes here
7Creating Invisible form to access pwc gateway for the payment2 hoursAny notes here
8Create a success and error page for payment successful or denied3 hoursAny notes here
9Create a sucessfull payment page for all the records of rthe user to check3 hoursAny notes here
10Create a filter and doubleverification feature in it and api integration.3 hoursAny notes here
11Payment gateway testing for all invoice payment and selected invoice payment2 hoursAny notes here
12Total35.5 hoursAny notes here

Testing & Quality Assurance

(Outline the testing strategy and quality assurance measures for the feature.)

  • Unit Tests:
    (List the unit tests that will be written for this feature.)

  • Integration Tests:
    (Describe how integration testing will be conducted.)

  • Acceptance Criteria:
    (Define the criteria that must be met for the feature to be considered complete.)

  • Testing Tools:
    (List any tools that will be used for testing.)


Deployment Considerations

(Describe any deployment considerations, including environment configurations, feature toggles, or migration steps.)

  • Configuration Changes:
    (Detail any configuration changes required for this feature.)

  • Rollout Plan:
    (Outline the plan for rolling out the feature, including any phased releases.)


Risks & Mitigations


Review & Approval

  • Reviewer:
    Ayon Das

  • Approval Date:
    2025-02-27


Notes
(Add any additional notes or considerations related to the feature development here.)