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