Skip to content

feat(router): Add Confirm-Intent API contract changes for split payments (v2)#9469

Merged
likhinbopanna merged 3 commits into
mainfrom
split-payments-api-changes
Sep 25, 2025
Merged

feat(router): Add Confirm-Intent API contract changes for split payments (v2)#9469
likhinbopanna merged 3 commits into
mainfrom
split-payments-api-changes

Conversation

@AnuthaDev

@AnuthaDev AnuthaDev commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

Type of Change

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

Description

  • Added split_payment_method_data field to confirm-intent call to accept a Vec of payment methods
image

Additional Changes

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

Motivation and Context

Closes #9467

How did you test it?

Note: Currently the split_payment_method_data field is not used. This PR just adds it to the API contract. There are no behaviour changes. The field will be used in a future PR.

Request:

curl --location 'http://localhost:8080/v2/payments/12345_pay_019975b06d2d77b0beff1a83df9a3377/confirm-intent' \
--header 'x-profile-id: pro_JSAAWLeyardnZ5iQDB4o' \
--header 'x-client-secret: cs_019975b06d407b738bb37971ce338246' \
--header 'Authorization: publishable-key=pk_dev_e098d9545be8466a9e52bfd7db41ec77,client-secret=cs_019975b06d407b738bb37971ce338246' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_e098d9545be8466a9e52bfd7db41ec77' \
--data '{
    "payment_method_data": {
        "card": {
            "card_cvc": "737",
            "card_exp_month": "03",
            "card_exp_year": "30",
            "card_number": "4000620000000007",
            "card_holder_name": "joseph Doe"
        }
    },
    "payment_method_type": "card",
    "payment_method_subtype": "card",
    "split_payment_method_data": [
        {
            "payment_method_data": {
                "gift_card": {
                    "givex": {
                        "number": "6036280000000000000",
                        "cvc": "123"
                    }
                }
            },
            "payment_method_type": "gift_card",
            "payment_method_subtype": "givex"
        }
    ],
    "browser_info": {
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
        "accept_header": "text\\/html,application\\/xhtml+xml,application\\/xml;q=0.9,image\\/webp,image\\/apng,*\\/*;q=0.8",
        "language": "en-GB",
        "color_depth": 24,
        "screen_height": 1440,
        "screen_width": 2560,
        "time_zone": -330,
        "java_enabled": true,
        "java_script_enabled": true,
        "ip_address": "0.0.0.0"
    }
}'

Response:

{
    "id": "12345_pay_019975b06d2d77b0beff1a83df9a3377",
    "status": "succeeded",
    "amount": {
        "order_amount": 1000,
        "currency": "USD",
        "shipping_cost": null,
        "order_tax_amount": null,
        "external_tax_calculation": "skip",
        "surcharge_calculation": "skip",
        "surcharge_amount": null,
        "tax_on_surcharge": null,
        "net_amount": 1000,
        "amount_to_capture": null,
        "amount_capturable": 0,
        "amount_captured": 1000
    },
    "customer_id": "12345_cus_019975b064727f82a64abdb387d8fd72",
    "connector": "adyen",
    "created": "2025-09-23T08:28:40.634Z",
    "modified_at": "2025-09-23T08:29:32.736Z",
    "payment_method_data": {
        "billing": null
    },
    "payment_method_type": "card",
    "payment_method_subtype": "card",
    "connector_transaction_id": "GRFLWGK5NVTV7VV5",
    "connector_reference_id": "12345_att_019975b12e2176c2bfa32a42a67b8891",
    "merchant_connector_id": "mca_yON0ejlCVv7kJuPN8wRs",
    "browser_info": null,
    "error": null,
    "shipping": null,
    "billing": null,
    "attempts": null,
    "connector_token_details": null,
    "payment_method_id": null,
    "next_action": null,
    "return_url": "https://google.com/success",
    "authentication_type": "three_ds",
    "authentication_type_applied": "three_ds",
    "is_iframe_redirection_enabled": null,
    "merchant_reference_id": null,
    "raw_connector_response": null,
    "feature_metadata": null,
    "metadata": null
}

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

@AnuthaDev AnuthaDev self-assigned this Sep 22, 2025
@AnuthaDev AnuthaDev requested a review from a team as a code owner September 22, 2025 07:31
@AnuthaDev AnuthaDev added C-feature Category: Feature request or enhancement api-v2 labels Sep 22, 2025
@semanticdiff-com

semanticdiff-com Bot commented Sep 22, 2025

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  api-reference/v2/openapi_spec_v2.json  0% smaller
  crates/api_models/src/payments.rs  0% smaller
  crates/openapi/src/openapi_v2.rs  0% smaller

@hyperswitch-bot hyperswitch-bot Bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Sep 22, 2025
@likhinbopanna likhinbopanna added this pull request to the merge queue Sep 25, 2025
Merged via the queue into main with commit 46090ea Sep 25, 2025
21 of 25 checks passed
@likhinbopanna likhinbopanna deleted the split-payments-api-changes branch September 25, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-v2 C-feature Category: Feature request or enhancement M-api-contract-changes Metadata: This PR involves API contract changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

confirm-intent API contract changes for split payments (v2)

4 participants