Skip to content

feat(payments_v2): add logic to render required_fields in response of payment_method list #8317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 17, 2025

Conversation

Sakilmostak
Copy link
Contributor

@Sakilmostak Sakilmostak commented Jun 11, 2025

Type of Change

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

Description

This add the filtering and logic for required fields in payment_mehtod list of payment's v2.

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 in V2 (adyen):
Create an payment intent:

curl --location '{{baseUrl}}/v2/payments/create-intent' \
--header 'Content-Type: application/json' \
--header 'x-profile-id:{{profile_id}}' \
--header 'Authorization: api-key={{api_key}}' \
--data-raw '{
    "amount_details": {
        "order_amount": 100,
        "currency": "EUR"
    },
    
    "capture_method":"automatic",
    "authentication_type": "no_three_ds",
    "shipping": {
        "address": {
            "first_name": "John",
            "last_name": "Dough",
            "city": "Karwar",
            "zip": "581301",
            "state": "Karnataka"
        },
        "email": "[email protected]"
    },
    "billing": {
        "address": {
            "city": "test",
            "country": "US",
            "line1": "here is some \n there is some \n none is some? \n ",
            "line2": "there",
            "line3": "anywhere",
            "zip": "560095",
            "state": "SE",
            "first_name": "Sakil",
            "last_name": "Mostak"
        },
        "phone": {
            "number": "1234567890",
            "country_code": "+1"
        },
        "email": "[email protected]"
    }
}'

List payment method:

curl --location '{{baseUrl}}/v2/payments/{{payment_id}}/payment-methods' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: {{profile_id}}' \
--header 'Authorization: publishable-key={{pub_key}},client-secret={{client_secret}}'

Following should be the response:

{
    "payment_methods_enabled": [
        {
            "payment_method_type": "card_redirect",
            "payment_method_subtype": "card_redirect",
            "payment_experience": "redirect_to_url",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "card",
            "payment_method_subtype": "credit",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.card.card_number",
                    "display_name": "card_number",
                    "field_type": "user_card_number",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_year",
                    "display_name": "card_exp_year",
                    "field_type": "user_card_expiry_year",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_cvc",
                    "display_name": "card_cvc",
                    "field_type": "user_card_cvc",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "card",
            "payment_method_subtype": "debit",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.card.card_number",
                    "display_name": "card_number",
                    "field_type": "user_card_number",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_year",
                    "display_name": "card_exp_year",
                    "field_type": "user_card_expiry_year",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_cvc",
                    "display_name": "card_cvc",
                    "field_type": "user_card_cvc",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "google_pay",
            "payment_experience": "invoke_sdk_client",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "apple_pay",
            "payment_experience": null,
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "we_chat_pay",
            "payment_experience": null,
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "ali_pay",
            "payment_experience": null,
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "paypal",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.billing.email",
                    "display_name": "email_address",
                    "field_type": "user_email_address",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "mb_way",
            "payment_experience": null,
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "klarna",
            "payment_experience": "redirect_to_url",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "affirm",
            "payment_experience": "redirect_to_url",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "afterpay_clearpay",
            "payment_experience": "redirect_to_url",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "walley",
            "payment_experience": "redirect_to_url",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "giropay",
            "payment_experience": "redirect_to_url",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "ideal",
            "payment_experience": "redirect_to_url",
            "required_fields": [
                {
                    "required_field": "payment_method_data.bank_redirect.ideal.bank_name",
                    "display_name": "bank_name",
                    "field_type": "user_bank",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "eps",
            "payment_experience": "redirect_to_url",
            "required_fields": [
                {
                    "required_field": "payment_method_data.bank_redirect.eps.bank_name",
                    "display_name": "bank_name",
                    "field_type": "user_bank",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "bancontact_card",
            "payment_experience": "redirect_to_url",
            "required_fields": [
                {
                    "required_field": "payment_method_data.bank_redirect.bancontact_card.card_number",
                    "display_name": "card_number",
                    "field_type": "user_card_number",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.bank_redirect.bancontact_card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.bank_redirect.bancontact_card.card_exp_year",
                    "display_name": "card_exp_year",
                    "field_type": "user_card_expiry_year",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "przelewy24",
            "payment_experience": "redirect_to_url",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "sofort",
            "payment_experience": "redirect_to_url",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "blik",
            "payment_experience": "redirect_to_url",
            "required_fields": [
                {
                    "required_field": "payment_method_data.bank_redirect.blik.blik_code",
                    "display_name": "blik_code",
                    "field_type": "user_blik_code",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "trustly",
            "payment_experience": "redirect_to_url",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "online_banking_finland",
            "payment_experience": "redirect_to_url",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "online_banking_poland",
            "payment_experience": "redirect_to_url",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_transfer",
            "payment_method_subtype": "ach",
            "payment_experience": "redirect_to_url",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_transfer",
            "payment_method_subtype": "sepa",
            "payment_experience": "redirect_to_url",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_transfer",
            "payment_method_subtype": "bacs",
            "payment_experience": "redirect_to_url",
            "required_fields": [],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_debit",
            "payment_method_subtype": "ach",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "billing_address_first_name",
                    "field_type": "text",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "billing_address_last_name",
                    "field_type": "text",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.bank_debit.ach.account_number",
                    "display_name": "account_number",
                    "field_type": "text",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.bank_debit.ach.routing_number",
                    "display_name": "routing_number",
                    "field_type": "text",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_debit",
            "payment_method_subtype": "sepa",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "billing_address_first_name",
                    "field_type": "text",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "billing_address_last_name",
                    "field_type": "text",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.bank_debit.sepa.iban",
                    "display_name": "iban",
                    "field_type": "text",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_debit",
            "payment_method_subtype": "bacs",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "billing_address_first_name",
                    "field_type": "text",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "billing_address_last_name",
                    "field_type": "text",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.bank_debit.bacs.account_number",
                    "display_name": "account_number",
                    "field_type": "text",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.bank_debit.bacs.sort_code",
                    "display_name": "sort_code",
                    "field_type": "text",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_debit",
            "payment_method_subtype": "becs",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "billing_address_first_name",
                    "field_type": "text",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "billing_address_last_name",
                    "field_type": "text",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.bank_debit.becs.account_number",
                    "display_name": "account_number",
                    "field_type": "text",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.bank_debit.bacs.sort_code",
                    "display_name": "sort_code",
                    "field_type": "text",
                    "value": null
                }
            ],
            "surcharge_details": null
        }
    ],
    "customer_payment_methods": 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

Summary by CodeRabbit

  • Refactor
    • Updated required fields for payment methods to always be present as a list, even if empty, ensuring more consistent responses.
    • Improved internal handling and naming of required fields for payment methods, providing clearer and more predictable data in API responses.
  • API Changes
    • Made the "required_fields" property mandatory in payment method responses, simplifying the data structure for better clarity and usage.

@Sakilmostak Sakilmostak self-assigned this Jun 11, 2025
@Sakilmostak Sakilmostak requested review from a team as code owners June 11, 2025 11:02
@Sakilmostak Sakilmostak added A-core Area: Core flows C-feature Category: Feature request or enhancement M-api-contract-changes Metadata: This PR involves API contract changes labels Jun 11, 2025
Copy link

semanticdiff-com bot commented Jun 11, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  api-reference/v2/openapi_spec_v2.json  60% smaller
  crates/router/src/core/payments/payment_methods.rs  22% smaller
  crates/api_models/src/payments.rs  0% smaller

Copy link

coderabbitai bot commented Jun 11, 2025

Walkthrough

The changes update the handling of required fields for payment methods by making the required fields always present as vectors, even if empty, instead of being optional. Supporting structures, traits, and methods are introduced or updated to consistently retrieve and manage required fields, with naming and type adjustments throughout the relevant modules.

Changes

File(s) Change Summary
crates/api_models/src/payments.rs Changed required_fields in ResponsePaymentMethodTypesForPayments from Option<Vec<...>> to Vec<...>.
crates/router/src/core/payments/payment_methods.rs Added RequiredFieldsInput struct and GetRequiredFields trait; updated required fields logic; renamed fields from required_field to required_fields; adjusted related method signatures and data flow.
api-reference-v2/openapi_spec.json Updated schema for ResponsePaymentMethodTypesForPayments: added required_fields as a required property; changed required_fields from optional array to required single reference.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API
    participant PaymentMethodsCore
    participant Settings

    Client->>API: Request list of payment methods
    API->>PaymentMethodsCore: list_payment_methods()
    PaymentMethodsCore->>Settings: Get RequiredFields config
    PaymentMethodsCore->>PaymentMethodsCore: get_required_fields(config)
    PaymentMethodsCore->>PaymentMethodsCore: Combine common and mandate fields
    PaymentMethodsCore->>API: Return payment methods with required_fields (Vec)
    API->>Client: Respond with payment methods and required_fields
Loading

Poem

In fields where payments hop and play,
Now every method leads the way—
No more "optional," just a list,
Of fields required, none are missed!
With traits and structs all neat and new,
The code hops forward—rabbits approve, too!
🐇✨


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
crates/router/src/core/payments/payment_methods.rs (4)

63-68: Avoid cloning the entire required_fields config on every request

state.conf.required_fields.clone() copies the whole configuration for each list_payment_methods call.
Unless the struct is trivially small, this is avoidable churn. Passing an immutable reference (or an Arc) keeps the API identical for downstream code while eliminating the per-call allocation.

-            .get_required_fields(RequiredFieldsInput::new(state.conf.required_fields.clone()))
+            .get_required_fields(RequiredFieldsInput::new(&state.conf.required_fields))

…and update RequiredFieldsInput accordingly.


75-86: RequiredFieldsInput is a single-field wrapper – consider inlining

A newtype wrapper makes sense when you need custom traits or type safety. Here it just forwards a cloned config. Removing it (or converting it into a simple &settings::RequiredFields parameter) reduces mental overhead and an extra struct hop.


88-111: Trait may be over-generalised and name collides with impl method

GetRequiredFields is only implemented for settings::RequiredFields, and you already have another method named get_required_fields on FilteredPaymentMethodsEnabled. The duplicate naming is easy to mix up in call-sites. If no additional implementors are expected, a plain inherent method on settings::RequiredFields keeps the API flatter and avoids the cognitive clash.


133-153: Minor allocation optimisations in required-field aggregation

  1. iter().flatten().map(ToOwned::to_owned) clones each element one by one.
    If RequiredFieldInfo is Clone, iter().flatten().cloned() is clearer and avoids importing ToOwned.
  2. common_required_fields.chain(mandate_required_fields).collect::<Vec<_>>() builds an intermediate iterator just to collect; consider reserving capacity when both vectors are Some to reduce reallocations.

Not a blocker, but easy wins.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ce2ab2 and e867b46.

📒 Files selected for processing (2)
  • crates/api_models/src/payments.rs (1 hunks)
  • crates/router/src/core/payments/payment_methods.rs (8 hunks)
🔇 Additional comments (1)
crates/router/src/core/payments/payment_methods.rs (1)

236-241: surcharge is always None – verify intended behaviour

perform_surcharge_calculation copies the required_fields but leaves surcharge: None.
If surcharge calculation will be plugged in later, add a TODO so the placeholder isn’t forgotten; otherwise, remove the dead path to avoid misleading callers.

@hyperswitch-bot hyperswitch-bot bot removed the M-api-contract-changes Metadata: This PR involves API contract changes label Jun 11, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between db6c2ad and 9a71818.

📒 Files selected for processing (1)
  • api-reference-v2/openapi_spec.json (2 hunks)
🔇 Additional comments (1)
api-reference-v2/openapi_spec.json (1)

22037-22041: Confirm mandatory inclusion of required_fields.

Adding "required_fields" to the required array correctly enforces its presence in every response object, matching the updated Rust model (Vec<RequiredFieldInfo>) and the PR goal to always return this field (even if empty).

Comment on lines 22057 to 22059
"required_fields": {
"allOf": [
{
"$ref": "#/components/schemas/RequiredFieldInfo"
}
],
"nullable": true
"$ref": "#/components/schemas/RequiredFieldInfo"
},
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Fix schema type: wrap RequiredFieldInfo in an array.

The required_fields property should be defined as an array of RequiredFieldInfo objects—not a single object reference. Without the "type": "array" and "items" wrapper, code generators and validators will misinterpret this field.

Apply this diff:

-"required_fields": {
-  "$ref": "#/components/schemas/RequiredFieldInfo"
-},
+"required_fields": {
+  "type": "array",
+  "items": {
+    "$ref": "#/components/schemas/RequiredFieldInfo"
+  }
+},
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"required_fields": {
"allOf": [
{
"$ref": "#/components/schemas/RequiredFieldInfo"
}
],
"nullable": true
"$ref": "#/components/schemas/RequiredFieldInfo"
},
"required_fields": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RequiredFieldInfo"
}
},
🤖 Prompt for AI Agents
In api-reference-v2/openapi_spec.json around lines 22057 to 22059, the
required_fields property is incorrectly defined as a single object reference. To
fix this, change required_fields to be an array by adding "type": "array" and
wrapping the "$ref" inside an "items" object. This ensures required_fields is
correctly interpreted as an array of RequiredFieldInfo objects.

@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jun 11, 2025
@Sakilmostak Sakilmostak changed the base branch from main to confirm_call_changes_v2 June 17, 2025 07:11
@Sakilmostak Sakilmostak merged commit 9b99db5 into confirm_call_changes_v2 Jun 17, 2025
19 of 24 checks passed
@Sakilmostak Sakilmostak deleted the payments_v2_required_fields branch June 17, 2025 07:12
Sakilmostak added a commit that referenced this pull request Jul 15, 2025
… payment_method list (#8317)

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-core Area: Core flows 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.

1 participant