hyperswitch icon indicating copy to clipboard operation
hyperswitch copied to clipboard

fix(required_fields_v2): add `payment_required_fields` file in docker

Open Narayanbhat166 opened this issue 9 months ago • 1 comments

Type of Change

  • [x] Bugfix

Description

This PR allows the required fields configuration to be provided by the configuration file in docker.

Motivation and Context

This is necessary since there is no other way to provide the configuration in environment variables.

How did you test it?

This has been tested on the integ environment

  • Create a payment method session
curl --location 'https://integ-api.hyperswitch.io/v2/payment-methods-session' \
--header 'x-profile-id: pro_KZvF738f3wnMWSIcLGSN' \
--header 'Authorization: api-key=<>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "customer_id": "12345_cus_01966c6b108072a1b9aac1e76f7d79f5",
     "billing": {
        "address": {
            "first_name": "John",
            "last_name": "Dough"
        },
        "email": "[email protected]"
    }
}'
  • Call payment method list, check for the required fields
{
    "payment_methods_enabled": [
        {
            "payment_method_type": "card",
            "payment_method_subtype": "credit",
            "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_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.card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                }
            ]
        },
        {
            "payment_method_type": "card",
            "payment_method_subtype": "debit",
            "required_fields": []
        }
    ],
    "customer_payment_methods": []
}

Narayanbhat166 avatar Apr 04 '25 07:04 Narayanbhat166

Review changes with  SemanticDiff

semanticdiff-com[bot] avatar Apr 04 '25 07:04 semanticdiff-com[bot]