Skip to content

Conversation

@Sakilmostak
Copy link
Contributor

@Sakilmostak Sakilmostak commented Sep 30, 2025

Type of Change

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

Description

  • Add Cards Payout through Nuvei
  • Add Webhook support for Payouts in Nuvei
  • Propagate error from failure response in payouts
  • Create webhook_url in PayoutsData Request to pass to Psp's

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?

Tested through Postman:
Create an MCA (Nuvei):
Creata a Card Payouts:

curl --location '{{baseUrl}}/payouts/create' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key:{{api_key}}' \
--data-raw '{
    "amount": 10,
    "currency": "EUR",
    "customer_id": "payout_customer",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payout request",
    "payout_type": "card",
    "payout_method_data": {
        "card": {
            "card_number": "4000027891380961",
            "expiry_month": "12",
            "expiry_year": "2025",
            "card_holder_name": "CL-BRW1"
        }
    },
    "entity_type": "Individual",
    "recurring": true,
    "metadata": {
        "ref": "123"
    },
    "auto_fulfill": true,
    "confirm": true
}'

The response should be succeeded and you should receive an webhook

{
    "payout_id": "payout_NOakA22TBihvGMX3h2Qb",
    "merchant_id": "merchant_1759235409",
    "merchant_order_reference_id": null,
    "amount": 10,
    "currency": "EUR",
    "connector": "nuvei",
    "payout_type": "card",
    "payout_method_data": {
        "card": {
            "card_issuer": null,
            "card_network": null,
            "card_type": null,
            "card_issuing_country": null,
            "bank_code": null,
            "last4": "0961",
            "card_isin": "400002",
            "card_extended_bin": null,
            "card_exp_month": "12",
            "card_exp_year": "2025",
            "card_holder_name": "CL-BRW1"
        }
    },
    "billing": null,
    "auto_fulfill": true,
    "customer_id": "payout_customer",
    "customer": {
        "id": "payout_customer",
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "client_secret": "payout_payout_NOakA22TBihvGMX3h2Qb_secret_jCqeQBT3uVeU77Oth6Pl",
    "return_url": null,
    "business_country": null,
    "business_label": null,
    "description": "Its my first payout request",
    "entity_type": "Individual",
    "recurring": true,
    "metadata": {
        "ref": "123"
    },
    "merchant_connector_id": "mca_cDe3Fa7sUarn7ryqAMOk",
    "status": "success",
    "error_message": null,
    "error_code": null,
    "profile_id": "pro_9bk44BClwKvHHsVHiRIV",
    "created": "2025-09-30T12:40:14.361Z",
    "connector_transaction_id": "7110000000017707955",
    "priority": null,
    "payout_link": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "unified_code": null,
    "unified_message": null,
    "payout_method_id": "pm_WkPPJd9Tr9Mnmw73fkG5"
}

Payout success event should be received and webhook should be source verified

image image

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 Sep 30, 2025
@Sakilmostak Sakilmostak requested a review from a team as a code owner September 30, 2025 08:17
@Sakilmostak Sakilmostak added the A-connector-integration Area: Connector integration label Sep 30, 2025
@Sakilmostak Sakilmostak requested a review from a team as a code owner September 30, 2025 08:17
@Sakilmostak Sakilmostak added C-feature Category: Feature request or enhancement Payouts Area: Payouts labels Sep 30, 2025
@semanticdiff-com
Copy link

semanticdiff-com bot commented Sep 30, 2025

@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Sep 30, 2025
Copy link
Contributor

@kashif-m kashif-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add

  1. connector_configs for enabling on dashboard
  2. PM filters
  3. Dynamic required fields (if needed)

@Sakilmostak Sakilmostak requested review from a team as code owners September 30, 2025 10:54
kashif-m
kashif-m previously approved these changes Sep 30, 2025
@Sakilmostak Sakilmostak linked an issue Sep 30, 2025 that may be closed by this pull request
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Sep 30, 2025
Merged via the queue into main with commit 3b5302c Sep 30, 2025
23 of 28 checks passed
@Gnanasundari24 Gnanasundari24 deleted the nuvei_payouts branch September 30, 2025 16:58
Sakilmostak added a commit that referenced this pull request Oct 1, 2025
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
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 M-api-contract-changes Metadata: This PR involves API contract changes Payouts Area: Payouts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: [Nuvei] add payout flows

6 participants