Skip to content

feat(connector): [Worldpayxml] add payout webhook impl for worldpay wpg#10346

Merged
likhinbopanna merged 1 commit intomainfrom
worldpay_xml_payout_webhook
Nov 20, 2025
Merged

feat(connector): [Worldpayxml] add payout webhook impl for worldpay wpg#10346
likhinbopanna merged 1 commit intomainfrom
worldpay_xml_payout_webhook

Conversation

@Sakilmostak
Copy link
Contributor

@Sakilmostak Sakilmostak commented Nov 19, 2025

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Add webhook for payouts in Worldpayxml

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Create an MCA (Worldpayxml):

Setup webhook in Worldpayxml dasbhoard:

{{baseUrl}}/webhooks/{{merchant_id}}/{{mca_id}}

Create a Payout:

curl --location '{{baseUrl}}/payouts/create' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key:{{api_key}}' \
--data-raw '{
    "amount": 100,
    "currency": "GBP",
    "customer_id": "payout_customer",
    "email": "payout_customer@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payout request",
    "payout_type": "wallet",
    "payout_method_data": {
        "wallet": {
            "apple_pay_decrypt": {
                "dpan": "4444333322221111",
                "expiry_month": "05",
                "expiry_year": "2035",
                "card_holder_name": "John Appleseed",
                "card_network": "Visa"
            }
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "NY",
            "zip": "94122",
            "country": "GB",
            "first_name": "John",
            "last_name": "Doe"  
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "entity_type": "Individual",
    "metadata": {
        "ref": "123"
    },
    "auto_fulfill": true,
    "confirm": true
}'

The status should be initiated in the response:

{
    "payout_id": "payout_5zSLZL916FgOh8kVuDp0",
    "merchant_id": "merchant_1763544699",
    "merchant_order_reference_id": null,
    "amount": 100,
    "currency": "GBP",
    "connector": "worldpayxml",
    "payout_type": "wallet",
    "payout_method_data": {
        "wallet": {
            "email": null,
            "telephone_number": null,
            "paypal_id": null
        }
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "GB",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "NY",
            "first_name": "John",
            "last_name": "Doe",
            "origin_zip": null
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "auto_fulfill": true,
    "customer_id": "payout_customer",
    "customer": {
        "id": "payout_customer",
        "name": "John Doe",
        "email": "payout_customer@example.com",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "client_secret": "payout_payout_5zSLZL916FgOh8kVuDp0_secret_zXHVZzIScQq7HVBBfHpY",
    "return_url": null,
    "business_country": null,
    "business_label": null,
    "description": "Its my first payout request",
    "entity_type": "Individual",
    "recurring": false,
    "metadata": {
        "ref": "123"
    },
    "merchant_connector_id": "mca_nfN7Mf3AxIjd3GCiJXdP",
    "status": "initiated",
    "error_message": null,
    "error_code": null,
    "profile_id": "pro_5qd4oLpVwjlhHBTOOpld",
    "created": "2025-11-19T10:10:53.463Z",
    "connector_transaction_id": "payout_5zSLZL916FgOh8kVuDp0_1",
    "priority": null,
    "payout_link": null,
    "email": "payout_customer@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "unified_code": null,
    "unified_message": null,
    "payout_method_id": null
}

Wait for the webhook to update the status to success

Do a Payout Sync to check the latest status:

curl --location '{{baseUrl}}/payouts/{{payout_id}}?force_sync=true' \
--header 'api-key:{{api_key}}'

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@Sakilmostak Sakilmostak self-assigned this Nov 19, 2025
@Sakilmostak Sakilmostak requested a review from a team as a code owner November 19, 2025 11:21
@Sakilmostak Sakilmostak added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement labels Nov 19, 2025
@semanticdiff-com
Copy link

semanticdiff-com bot commented Nov 19, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/worldpayxml.rs  25% smaller
  crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs  8% smaller

@Sakilmostak Sakilmostak linked an issue Nov 19, 2025 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 0% with 35 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@e35884e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...perswitch_connectors/src/connectors/worldpayxml.rs 0.00% 26 Missing ⚠️
...nectors/src/connectors/worldpayxml/transformers.rs 0.00% 9 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10346   +/-   ##
=======================================
  Coverage        ?    6.49%           
=======================================
  Files           ?     1238           
  Lines           ?   309350           
  Branches        ?        0           
=======================================
  Hits            ?    20090           
  Misses          ?   289260           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@likhinbopanna likhinbopanna added this pull request to the merge queue Nov 20, 2025
Merged via the queue into main with commit 1628032 Nov 20, 2025
29 of 31 checks passed
@likhinbopanna likhinbopanna deleted the worldpay_xml_payout_webhook branch November 20, 2025 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: [PAYOUTS] Add webhooks for Worldpay Xml

4 participants