m2pfintech
Click to Pay

Lifecycle & Status

CTP status values, state transitions, database model, and async processing flow for Click to Pay operations.

Status Values

Click to Pay tracks status at three levels: entity (customer), kit (card), and request.

Entity & Kit Status

Both entities and kits share the same set of CTP status values:

StatusDescription
UNREGISTEREDNot enrolled in Click to Pay
REGISTRATION_IN_PROGRESSCTP enrollment request sent to Visa, awaiting confirmation
ACTIVESuccessfully registered and active on the Visa CTP network
REMOVAL_IN_PROGRESSCTP removal request sent to Visa, awaiting confirmation
REMOVEDSuccessfully removed from the Click to Pay network
DISABLEDDisabled on the CTP network

Request Trace Status

Each async CTP operation generates a request trace that tracks processing status:

StatusDescription
IN_PROGRESSRequest submitted to Visa SaaS, awaiting result
SUCCESSOperation completed successfully
FAILEDOperation failed — check error details

State Transitions

Entity Lifecycle

Kit Lifecycle

Request Trace Lifecycle


Database Model

The CTP module uses three database tables to track enrollment state:

ctp_customer

Tracks the entity-level CTP enrollment:

ColumnTypeDescription
pkeyBIGINT (PK)Auto-generated primary key
entity_idVARCHARM2P entity identifier
clickToPayCustomerIdVARCHARVisa CTP consumer ID (set on webhook callback)
ctp_entity_statusVARCHAR (Enum)Current CTP status — one of CTPEntityKitStatus values
business_entity_fkeyBIGINT (FK)Foreign key to business_entity table (OneToOne)

ctp_payment

Tracks card-level CTP enrollment, linked to ctp_customer:

ColumnTypeDescription
pkeyBIGINT (PK)Auto-generated primary key
clickToPayPaymentInstumentIdVARCHARVisa CTP payment instrument ID
ctp_kit_statusVARCHAR (Enum)Current CTP status for this card
ctcustomer_pkeyBIGINT (FK)Foreign key to ctp_customer (ManyToOne)
kit_pkeyBIGINT (FK)Foreign key to kit table (OneToOne)

ctp_requestIdTracking

Tracks the status of async CTP operations:

ColumnTypeDescription
pkeyBIGINT (PK)Auto-generated primary key
request_trace_IDVARCHARSaaS-provided request trace ID
entity_idVARCHARM2P entity identifier
kit_numberVARCHARKit number
eventVARCHAR (Enum)CTP event type
status_ctpVARCHAR (Enum)Request status — IN_PROGRESS, SUCCESS, or FAILED

Database Indexes

IndexTableColumn(s)
idx_ctp_customer_business_entity_fkeyctp_customerbusiness_entity_fkey
idx_ctp_payment_kitctp_paymentkit_pkey
idx_ctp_requestIdTrackingctp_requestIdTrackingrequest_trace_ID

Entity Relationships


Async Processing Flow

All CTP registration and removal operations follow an asynchronous processing model via a CTP SaaS intermediary layer that communicates with the Visa Token Service.

SaaS API Endpoints

The M2P platform communicates with the CTP SaaS layer using these internal endpoints:

SaaS EndpointHTTP MethodCTP Event
/addCustomerAndPaymentInstrumentPOSTCTP_REGISTER_ENTITY_AND_KIT
/addPaymentInstrumentPOSTCTP_ADD_KIT
/removeCustomerPOSTCTP_REMOVE_ENTITY
/removePaymentInstrumentPOSTCTP_REMOVE_KIT
/updateCustomerDataPUTCTP_UPDATE_ENTITY
/updatePaymentInstrumentPUTCTP_UPDATE_KIT
/getDataGETFetch entity details
/statusGETPoll request status

SaaS API requests include an X-TENANT-ID header for tenant identification.


Automatic CTP Updates

The platform automatically syncs CTP data when customer profiles are updated:

TriggerCTP ActionEvent
Customer name, email, or contact updatedSync to Visa via /updateCustomerDataCTP_UPDATE_ENTITY
Customer address updatedSync to Visa via /updatePaymentInstrumentCTP_UPDATE_KIT

These updates are triggered via Spring @TransactionalEventListener (AFTER_COMMIT), ensuring they only fire after the primary database transaction succeeds.


Notifications

All CTP operations generate notifications sent to the m2p.notification.all Message Queue queue:

Success Notification Payload

{
    "business": "ENBDTABBY",
    "transactionType": "CTP_REGISTER_ENTITY_AND_KIT",
    "serverNotifyData": {
        "entityId": "70752df2-...",
        "kitNo": "100000011561",
        "requestTraceId": "351562ba-...",
        "requestStatus": "SUCCESS",
        "transactionType": "CTP_REGISTER_ENTITY_AND_KIT",
        "ctpEntityStatus": "ACTIVE",
        "ctpKitStatus": "ACTIVE",
        "ctpEntityId": "86e9d8c0-...",
        "ctpKitId": "86e9d8c0-...",
        "tenant": "ENBDTABBY"
    }
}

Failure Notification Payload

{
    "business": "ENBDTABBY",
    "transactionType": "CTP_REGISTER_ENTITY_AND_KIT",
    "serverNotifyData": {
        "entityId": "70752df2-...",
        "requestTraceId": "351562ba-...",
        "requestStatus": "FAILED",
        "transactionType": "CTP_REGISTER_ENTITY_AND_KIT",
        "message": "CTP FAILURE: Request Rejected",
        "errorDetails": "...",
        "tenant": "ENBDTABBY"
    }
}

On this page