Skip to content

feat(connector): [Worldpayraft] enable UCS card flows, NTID MIT and PSync skip - #14348

Open
shuklatushar226 wants to merge 1 commit into
mainfrom
feat/worldpayraft-ucs-9b192d
Open

shuklatushar226 wants to merge 1 commit into
mainfrom
feat/worldpayraft-ucs-9b192d

Conversation

@shuklatushar226

Copy link
Copy Markdown
Contributor

Depends on juspay/hyperswitch-prism#2341

Why

Worldpayraft (Worldpay Native RAFT) Authorize, Capture, Void, Refund, SetupMandate (incl. $0 auth), RepeatPayment (connector mandate and NTID), external 3DS and payment webhooks are implemented in UCS (juspay/hyperswitch-prism#2341). Hyperswitch needs the changes below to route them correctly: without them it calls a UCS PSync that the connector cannot serve, it cannot use NTID-based MITs, and the NTID proxy path builds a direct connector request for a UCS-routed payment.

Change Gate fn / anchor (file:line) Why unreachable Flows unblocked
P-hs-04: Append worldpayraft to ucs_psync_disabled_connectors in all six files ("cashtocode, trustly, worldpayraft"). config/development.toml — ucs_psync_disabled_connectors (development.toml:1635; also config.example.toml:1509, deployments/env_specific.toml:479, integration_test.toml:1078, production.toml:1090, sandbox.toml:1097) without it an HS force_sync retrieve of a RequiresCapture payment and an unverified payment webhook call UCS PSync and fail with 501 (psync_gateway.rs:147-164, errors/utils.rs:232-238) PSync, Capture, IncomingWebhook
P-hs-05: Append worldpayraft to connector_list in all six files. config/development.toml — [network_transaction_id_supported_connectors] connector_list (development.toml:1370; docker_compose.toml:1262; config.example.toml:1466; deployments/integration_test.toml:326, production.toml:330, sandbox.toml:333) without it an HS MIT with recurring_details network_transaction_id_and_card_details fails routing with IncorrectPaymentMethodConfiguration (payments.rs:11639-11677) RepeatPayment
P-hs-06: Add the Cypress connector config: card 4111111111111111 exp 08/30 cvc 999 (credit) for No3DS auto/manual, capture (full/partial), void, refund (full/partial), zero-auth mandate and MIT-by-connector-mandate; Mastercard 5555555555554444 with NTID AB1CD2EF30118 and amount 4321 for MIT-by-NTID; card 40… cypress-tests/cypress/e2e/configs/Payment/Worldpayraft.js — new file + registration in cypress-tests/cypress/e2e/configs/Payment/Utils.js connector map no Cypress config -> no Worldpayraft spec can run (hs ls-tree cypress-tests/cypress/e2e/configs/Payment/) Authorize, Capture, Void, Refund, SetupMandate, RepeatPayment
P-hs-07: Build the flow-specific direct connector request only when gateway_context.execution_path.is_direct_gateway(); otherwise (None, should_continue_further) — the same guard call_connector_service has at payments.rs:5971-5983. The hunk already exists in hs-wt (payments.rs:7333-7346): keep it verbatim, … crates/router/src/core/payments.rs — proxy_for_call_connector_service: build_flow_specific_connector_request (hs base payments.rs:7333-7341) without it an HS MIT with recurring_details network_transaction_id_and_card_details (P-hs-05) returns 501 IR_00 'get_url method is not implemented' before UCS RepeatPayment

The Cypress config (Worldpayraft.js, Utils.js) adds worldpayraft to MANDATES_USING_NTID_PROXY and EXTERNAL_THREE_DS. 3DS-challenge, PSync-dependent and RSync steps are TRIGGER_SKIP, because Native RAFT has no 3DS or inquiry call.

Merge order

  1. feat(connector): [Worldpayraft] add 10 flows (Authorize, PSync, Capture, Void, Refund, ...) [ALPHA] hyperswitch-prism#2341 merged and UCS deployed.
  2. This PR.

Required human checks

  • Link an open juspay/hyperswitch issue to this PR — CI job "Verify PR contains one or more linked issues" fails without one; GRACE opens none
  • Review the payments.rs guard (P-hs-07): it mirrors the existing call_connector_service guard at payments.rs:5971-5983

Validation

Command Exit
hs-wt: cargo +nightly fmt --all && cargo check -p hyperswitch_connectors --features v1,frm,payouts (+ router --features v1) 0

Note

Alpha connector: there are no Worldpay RAFT credentials. The end-to-end runs below went HS → UCS → a documentation-derived mock of the RAFT API, not Worldpay.

E2E through this change (HS → UCS → mock), evidence in juspay/hyperswitch-prism#2341:

  • Authorize: SUCCESS (e2e/08) — mock__requests.jsonl.L808
  • PSync: E2E_BLOCKED (e2e/07)
  • Capture: SUCCESS (e2e/08) — mock__requests.jsonl.L811
  • Void: SUCCESS (e2e/08) — mock__requests.jsonl.L815
  • Refund: SUCCESS (e2e/08) — mock__requests.jsonl.L819, mock__requests.jsonl.L822
  • RSync: E2E_BLOCKED (e2e/07)
  • SetupMandate: SUCCESS (e2e/09) — mock__requests.jsonl.L997
  • RepeatPayment: SUCCESS (e2e/09) — mock__requests.jsonl.L1000, mock__requests.jsonl.L1002
  • IncomingWebhook: E2E_BLOCKED (e2e/07) — test__results__r4__checks__eventservice-handleevent-payment-succeeded
  • ThreeDS: SUCCESS (e2e/08) — mock__requests.jsonl.L990

🤖 Generated with Claude Code

https://claude.ai/code/session_012uc68Hoy1Bzj6am8h9ndTy

…Sync skip

GRACE run worldpayraft-9b192d

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012uc68Hoy1Bzj6am8h9ndTy
@shuklatushar226
shuklatushar226 requested review from a team as code owners September 22, 2026 00:24
@semanticdiff-com

semanticdiff-com Bot commented Sep 22, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/payments.rs  76% smaller
  config/config.example.toml Unsupported file format
  config/deployments/env_specific.toml Unsupported file format
  config/deployments/integration_test.toml Unsupported file format
  config/deployments/production.toml Unsupported file format
  config/deployments/sandbox.toml Unsupported file format
  config/development.toml Unsupported file format
  config/docker_compose.toml Unsupported file format
  cypress-tests/cypress/e2e/configs/Payment/Utils.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Worldpayraft.js  0% smaller

@XyneSpaces

Copy link
Copy Markdown
Contributor

Review finding (inline review-comment API was unavailable in this run, so this is recorded here with the exact added-line location):

  • [S1] cypress-tests/cypress/e2e/configs/Payment/Worldpayraft.js:361,372: adding worldpayraft to MANDATES_USING_NTID_PROXY causes the NTID-proxy spec to use the shared fixture defaults because no preceding CIT populates globalState.networkTransactionId. The new MIT cases therefore send the wrong card/NTID/amount for RAFT (the connector-specific scenario requires Mastercard 5555555555554444, NTID AB1CD2EF30118, amount 4321), and the manual-capture amount must remain consistent. Add connector-specific request overrides and align the capture amount.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants