Skip to content
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

fix(connector): fix required fields for mandates supported connectors #6930

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Debarshi-Gupta
Copy link

@Debarshi-Gupta Debarshi-Gupta commented Dec 24, 2024

Type of Change

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

Description

Bugfix for Required Fields for Connectors

Connectors I have checked for : Aci, Adyen, Authorizeddotnet, Globalpay, Multisafepay, Worldpay, Nexinets, Noon, Novalnet, Payme, Stripe, Bankofamerica, Cybersource, Wellsfargo

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?

1. Worldpay

  • A) Create Payment

  • Request

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_MA7DHjl9k4izCsQ42Vh7VJEKQeNy78RkGjIISOOrAbu78sRnpwuuuJmmipITEyae' \
--data-raw '{
    "amount":1001,
    "currency": "USD",
    "confirm": false,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 1001,
    "customer_id": "StripeCustomer",
    "setup_future_usage": "off_session",
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "4242424242424242",
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "card_cvc": "737"
        }
    },
    
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "CA",
            "line3": "CA",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "CA",
            "line3": "CA",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "browser_info": {
        "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
        "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,\/;q=0.8",
        "language": "nl-NL",
        "color_depth": 24,
        "ip_address": "127.2.2.0",
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'
  • Response
{
    "payment_id": "pay_HZXVkB3Sgivp05S4ZNb5",
    "merchant_id": "postman_merchant_GHAction_2df9b020-7ee8-4a4f-bbe8-fcfea85b6e97",
    "status": "requires_confirmation",
    "amount": 1001,
    "net_amount": 1001,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_HZXVkB3Sgivp05S4ZNb5_secret_vcAhY1ZDv6o3JUXQGD1O",
    "created": "2024-12-30T10:47:52.494Z",
    "currency": "USD",
    "customer_id": "StripeCustomer",
    "customer": {
        "id": "StripeCustomer",
        "name": "John Doe",
        "email": "guest@example.com",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "4242",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "424242",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_mTYGZbORdGoUVjWd3HIB",
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "CA",
            "line3": "CA",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "CA",
            "line3": "CA",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "StripeCustomer",
        "created_at": 1735555672,
        "expires": 1735559272,
        "secret": "epk_598e7f9c98c5408bb9713a296458924e"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_FXQzfrQDc9z2aCNJY9SG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": null,
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-12-30T11:02:52.494Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "127.2.2.0",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "color_depth": 24,
        "java_enabled": true,
        "screen_width": 1536,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8",
        "screen_height": 723,
        "java_script_enabled": true
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-12-30T10:47:52.525Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null
}
  • B) List Payment Method Merchant

  • Request

curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_HZXVkB3Sgivp05S4ZNb5_secret_vcAhY1ZDv6o3JUXQGD1O' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_6934f023b7e340578a6802a69b225f1e'
  • Response
{
    "redirect_url": "https://duck.com/success",
    "currency": "USD",
    "payment_methods": [
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "credit",
                    "payment_experience": null,
                    "card_networks": [
                        {
                            "card_network": "Visa",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "worldpay"
                            ]
                        },
                        {
                            "card_network": "Mastercard",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "worldpay"
                            ]
                        }
                    ],
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": null,
                    "required_fields": {
                        "payment_method_data.card.card_exp_month": {
                            "required_field": "payment_method_data.card.card_exp_month",
                            "display_name": "card_exp_month",
                            "field_type": "user_card_expiry_month",
                            "value": null
                        },
                        "billing.address.zip": {
                            "required_field": "billing.address.zip",
                            "display_name": "zip",
                            "field_type": "user_address_pincode",
                            "value": "94122"
                        },
                        "billing.address.country": {
                            "required_field": "billing.address.country",
                            "display_name": "country",
                            "field_type": {
                                "user_address_country": {
                                    "options": [
                                        "AF",
                                        "AU",
                                        "AW",
                                        "AZ",
                                        "BS",
                                        "BH",
                                        "BD",
                                        "BB",
                                        "BZ",
                                        "BM",
                                        "BT",
                                        "BO",
                                        "BA",
                                        "BW",
                                        "BR",
                                        "BN",
                                        "BG",
                                        "BI",
                                        "KH",
                                        "CA",
                                        "CV",
                                        "KY",
                                        "CL",
                                        "CO",
                                        "KM",
                                        "CD",
                                        "CR",
                                        "CZ",
                                        "DZ",
                                        "DK",
                                        "DJ",
                                        "ST",
                                        "DO",
                                        "EC",
                                        "EG",
                                        "SV",
                                        "ER",
                                        "ET",
                                        "FK",
                                        "FJ",
                                        "GM",
                                        "GE",
                                        "GH",
                                        "GI",
                                        "GT",
                                        "GN",
                                        "GY",
                                        "HT",
                                        "HN",
                                        "HK",
                                        "HU",
                                        "IS",
                                        "IN",
                                        "ID",
                                        "IR",
                                        "IQ",
                                        "IE",
                                        "IL",
                                        "IT",
                                        "JM",
                                        "JP",
                                        "JO",
                                        "KZ",
                                        "KE",
                                        "KW",
                                        "LA",
                                        "LB",
                                        "LS",
                                        "LR",
                                        "LY",
                                        "LT",
                                        "MO",
                                        "MK",
                                        "MG",
                                        "MW",
                                        "MY",
                                        "MV",
                                        "MR",
                                        "MU",
                                        "MX",
                                        "MD",
                                        "MN",
                                        "MA",
                                        "MZ",
                                        "MM",
                                        "NA",
                                        "NZ",
                                        "NI",
                                        "NG",
                                        "KP",
                                        "NO",
                                        "AR",
                                        "PK",
                                        "PG",
                                        "PY",
                                        "PE",
                                        "UY",
                                        "PH",
                                        "PL",
                                        "GB",
                                        "QA",
                                        "OM",
                                        "RO",
                                        "RU",
                                        "RW",
                                        "WS",
                                        "SG",
                                        "ST",
                                        "ZA",
                                        "KR",
                                        "LK",
                                        "SH",
                                        "SD",
                                        "SR",
                                        "SZ",
                                        "SE",
                                        "CH",
                                        "SY",
                                        "TW",
                                        "TJ",
                                        "TZ",
                                        "TH",
                                        "TT",
                                        "TN",
                                        "TR",
                                        "UG",
                                        "UA",
                                        "US",
                                        "UZ",
                                        "VU",
                                        "VE",
                                        "VN",
                                        "ZM",
                                        "ZW"
                                    ]
                                }
                            },
                            "value": "US"
                        },
                        "payment_method_data.card.card_exp_year": {
                            "required_field": "payment_method_data.card.card_exp_year",
                            "display_name": "card_exp_year",
                            "field_type": "user_card_expiry_year",
                            "value": null
                        },
                        "payment_method_data.card.card_number": {
                            "required_field": "payment_method_data.card.card_number",
                            "display_name": "card_number",
                            "field_type": "user_card_number",
                            "value": null
                        }
                    },
                    "surcharge_details": null,
                    "pm_auth_connector": null
                },
                {
                    "payment_method_type": "debit",
                    "payment_experience": null,
                    "card_networks": [
                        {
                            "card_network": "Mastercard",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "worldpay"
                            ]
                        },
                        {
                            "card_network": "Visa",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "worldpay"
                            ]
                        }
                    ],
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": null,
                    "required_fields": {
                        "payment_method_data.card.card_number": {
                            "required_field": "payment_method_data.card.card_number",
                            "display_name": "card_number",
                            "field_type": "user_card_number",
                            "value": null
                        },
                        "payment_method_data.card.card_exp_year": {
                            "required_field": "payment_method_data.card.card_exp_year",
                            "display_name": "card_exp_year",
                            "field_type": "user_card_expiry_year",
                            "value": null
                        },
                        "payment_method_data.card.card_exp_month": {
                            "required_field": "payment_method_data.card.card_exp_month",
                            "display_name": "card_exp_month",
                            "field_type": "user_card_expiry_month",
                            "value": null
                        },
                        "billing.address.country": {
                            "required_field": "billing.address.country",
                            "display_name": "country",
                            "field_type": {
                                "user_address_country": {
                                    "options": [
                                        "AF",
                                        "AU",
                                        "AW",
                                        "AZ",
                                        "BS",
                                        "BH",
                                        "BD",
                                        "BB",
                                        "BZ",
                                        "BM",
                                        "BT",
                                        "BO",
                                        "BA",
                                        "BW",
                                        "BR",
                                        "BN",
                                        "BG",
                                        "BI",
                                        "KH",
                                        "CA",
                                        "CV",
                                        "KY",
                                        "CL",
                                        "CO",
                                        "KM",
                                        "CD",
                                        "CR",
                                        "CZ",
                                        "DZ",
                                        "DK",
                                        "DJ",
                                        "ST",
                                        "DO",
                                        "EC",
                                        "EG",
                                        "SV",
                                        "ER",
                                        "ET",
                                        "FK",
                                        "FJ",
                                        "GM",
                                        "GE",
                                        "GH",
                                        "GI",
                                        "GT",
                                        "GN",
                                        "GY",
                                        "HT",
                                        "HN",
                                        "HK",
                                        "HU",
                                        "IS",
                                        "IN",
                                        "ID",
                                        "IR",
                                        "IQ",
                                        "IE",
                                        "IL",
                                        "IT",
                                        "JM",
                                        "JP",
                                        "JO",
                                        "KZ",
                                        "KE",
                                        "KW",
                                        "LA",
                                        "LB",
                                        "LS",
                                        "LR",
                                        "LY",
                                        "LT",
                                        "MO",
                                        "MK",
                                        "MG",
                                        "MW",
                                        "MY",
                                        "MV",
                                        "MR",
                                        "MU",
                                        "MX",
                                        "MD",
                                        "MN",
                                        "MA",
                                        "MZ",
                                        "MM",
                                        "NA",
                                        "NZ",
                                        "NI",
                                        "NG",
                                        "KP",
                                        "NO",
                                        "AR",
                                        "PK",
                                        "PG",
                                        "PY",
                                        "PE",
                                        "UY",
                                        "PH",
                                        "PL",
                                        "GB",
                                        "QA",
                                        "OM",
                                        "RO",
                                        "RU",
                                        "RW",
                                        "WS",
                                        "SG",
                                        "ST",
                                        "ZA",
                                        "KR",
                                        "LK",
                                        "SH",
                                        "SD",
                                        "SR",
                                        "SZ",
                                        "SE",
                                        "CH",
                                        "SY",
                                        "TW",
                                        "TJ",
                                        "TZ",
                                        "TH",
                                        "TT",
                                        "TN",
                                        "TR",
                                        "UG",
                                        "UA",
                                        "US",
                                        "UZ",
                                        "VU",
                                        "VE",
                                        "VN",
                                        "ZM",
                                        "ZW"
                                    ]
                                }
                            },
                            "value": "US"
                        },
                        "billing.address.zip": {
                            "required_field": "billing.address.zip",
                            "display_name": "zip",
                            "field_type": "user_address_pincode",
                            "value": "94122"
                        }
                    },
                    "surcharge_details": null,
                    "pm_auth_connector": null
                }
            ]
        }
    ],
    "mandate_payment": null,
    "merchant_name": "NewAge Retailer",
    "show_surcharge_breakup_screen": false,
    "payment_type": "new_mandate",
    "request_external_three_ds_authentication": false,
    "collect_shipping_details_from_wallets": false,
    "collect_billing_details_from_wallets": false,
    "is_tax_calculation_enabled": false
}

2. Multisafepay

  • A) Create Payment

  • Request

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_uaN1P2yDTIvML6tuSZabswFxSGfDz2xK63AoXpDeO6lEisiftVuZwXEpIxc4cGgH' \
--data-raw '{
    "amount":1001,
    "currency": "USD",
    "confirm": false,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 1001,
    "customer_id": "StripeCustomer",
    "setup_future_usage": "off_session",
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "4242424242424242",
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "card_cvc": "737"
        }
    },
    
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "CA",
            "line3": "CA",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "CA",
            "line3": "CA",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "browser_info": {
        "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
        "accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,\/;q=0.8",
        "language": "nl-NL",
        "color_depth": 24,
        "ip_address": "127.2.2.0",
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'
  • Response
{
    "payment_id": "pay_CXaeXrSELBOHKt8WwrzN",
    "merchant_id": "postman_merchant_GHAction_4a25406a-bc96-4cfb-ae31-79d35d47eb57",
    "status": "requires_confirmation",
    "amount": 1001,
    "net_amount": 1001,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_CXaeXrSELBOHKt8WwrzN_secret_ZC42GH8feee79hkRIptR",
    "created": "2024-12-30T10:58:02.272Z",
    "currency": "USD",
    "customer_id": "StripeCustomer",
    "customer": {
        "id": "StripeCustomer",
        "name": "John Doe",
        "email": "guest@example.com",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "4242",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "424242",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_bFixxgfXyxtUjbRgGicv",
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "CA",
            "line3": "CA",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "CA",
            "line3": "CA",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "StripeCustomer",
        "created_at": 1735556282,
        "expires": 1735559882,
        "secret": "epk_c7c9dd7c672e45c1b61fbea9a77d0c2a"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_wMwY5DYf61LpJu0wYwB1",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": null,
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-12-30T11:13:02.272Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "127.2.2.0",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "color_depth": 24,
        "java_enabled": true,
        "screen_width": 1536,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8",
        "screen_height": 723,
        "java_script_enabled": true
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-12-30T10:58:02.310Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null
}
  • B) List Payment Method Merchant

  • Request

curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_CXaeXrSELBOHKt8WwrzN_secret_ZC42GH8feee79hkRIptR' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_3bf61b76e332498a80708f11a3b017a2'
  • Response
{
    "redirect_url": "https://duck.com/success",
    "currency": "USD",
    "payment_methods": [
        {
            "payment_method": "wallet",
            "payment_method_types": [
                {
                    "payment_method_type": "google_pay",
                    "payment_experience": [
                        {
                            "payment_experience_type": "redirect_to_url",
                            "eligible_connectors": [
                                "multisafepay"
                            ]
                        }
                    ],
                    "card_networks": null,
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": null,
                    "required_fields": {
                        "billing.address.city": {
                            "required_field": "payment_method_data.billing.address.city",
                            "display_name": "city",
                            "field_type": "user_address_city",
                            "value": "San Fransico"
                        },
                        "billing.address.last_name": {
                            "required_field": "payment_method_data.billing.address.last_name",
                            "display_name": "billing_last_name",
                            "field_type": "user_billing_name",
                            "value": "Doe"
                        },
                        "billing.address.zip": {
                            "required_field": "payment_method_data.billing.address.zip",
                            "display_name": "zip",
                            "field_type": "user_address_pincode",
                            "value": "94122"
                        },
                        "billing.address.line2": {
                            "required_field": "payment_method_data.billing.address.line2",
                            "display_name": "line2",
                            "field_type": "user_address_line2",
                            "value": "CA"
                        },
                        "billing.address.first_name": {
                            "required_field": "payment_method_data.billing.address.first_name",
                            "display_name": "billing_first_name",
                            "field_type": "user_billing_name",
                            "value": "joseph"
                        },
                        "billing.address.state": {
                            "required_field": "payment_method_data.billing.address.state",
                            "display_name": "state",
                            "field_type": "user_address_state",
                            "value": "California"
                        },
                        "billing.address.country": {
                            "required_field": "payment_method_data.billing.address.country",
                            "display_name": "country",
                            "field_type": {
                                "user_address_country": {
                                    "options": [
                                        "ALL"
                                    ]
                                }
                            },
                            "value": "US"
                        },
                        "billing.address.line1": {
                            "required_field": "payment_method_data.billing.address.line1",
                            "display_name": "line1",
                            "field_type": "user_address_line1",
                            "value": "1467"
                        }
                    },
                    "surcharge_details": null,
                    "pm_auth_connector": null
                }
            ]
        },
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "credit",
                    "payment_experience": null,
                    "card_networks": [
                        {
                            "card_network": "Mastercard",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "multisafepay"
                            ]
                        },
                        {
                            "card_network": "Visa",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "multisafepay"
                            ]
                        }
                    ],
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": null,
                    "required_fields": {
                        "billing.address.city": {
                            "required_field": "payment_method_data.billing.address.city",
                            "display_name": "city",
                            "field_type": "user_address_city",
                            "value": "San Fransico"
                        },
                        "billing.address.country": {
                            "required_field": "payment_method_data.billing.address.country",
                            "display_name": "country",
                            "field_type": {
                                "user_address_country": {
                                    "options": [
                                        "ALL"
                                    ]
                                }
                            },
                            "value": "US"
                        },
                        "billing.address.line2": {
                            "required_field": "payment_method_data.billing.address.line2",
                            "display_name": "line2",
                            "field_type": "user_address_line2",
                            "value": "CA"
                        },
                        "billing.address.line1": {
                            "required_field": "payment_method_data.billing.address.line1",
                            "display_name": "line1",
                            "field_type": "user_address_line1",
                            "value": "1467"
                        },
                        "payment_method_data.card.card_number": {
                            "required_field": "payment_method_data.card.card_number",
                            "display_name": "card_number",
                            "field_type": "user_card_number",
                            "value": null
                        },
                        "billing.address.first_name": {
                            "required_field": "payment_method_data.billing.address.first_name",
                            "display_name": "card_holder_name",
                            "field_type": "user_full_name",
                            "value": "joseph"
                        },
                        "payment_method_data.card.card_exp_month": {
                            "required_field": "payment_method_data.card.card_exp_month",
                            "display_name": "card_exp_month",
                            "field_type": "user_card_expiry_month",
                            "value": null
                        },
                        "payment_method_data.card.card_cvc": {
                            "required_field": "payment_method_data.card.card_cvc",
                            "display_name": "card_cvc",
                            "field_type": "user_card_cvc",
                            "value": null
                        },
                        "billing.address.zip": {
                            "required_field": "payment_method_data.billing.address.zip",
                            "display_name": "zip",
                            "field_type": "user_address_pincode",
                            "value": "94122"
                        },
                        "payment_method_data.card.card_exp_year": {
                            "required_field": "payment_method_data.card.card_exp_year",
                            "display_name": "card_exp_year",
                            "field_type": "user_card_expiry_year",
                            "value": null
                        },
                        "billing.address.last_name": {
                            "required_field": "payment_method_data.billing.address.last_name",
                            "display_name": "card_holder_name",
                            "field_type": "user_full_name",
                            "value": "Doe"
                        }
                    },
                    "surcharge_details": null,
                    "pm_auth_connector": null
                },
                {
                    "payment_method_type": "debit",
                    "payment_experience": null,
                    "card_networks": [
                        {
                            "card_network": "Mastercard",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "multisafepay"
                            ]
                        },
                        {
                            "card_network": "Visa",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "multisafepay"
                            ]
                        }
                    ],
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": null,
                    "required_fields": {
                        "billing.address.line1": {
                            "required_field": "payment_method_data.billing.address.line1",
                            "display_name": "line1",
                            "field_type": "user_address_line1",
                            "value": "1467"
                        },
                        "payment_method_data.card.card_exp_month": {
                            "required_field": "payment_method_data.card.card_exp_month",
                            "display_name": "card_exp_month",
                            "field_type": "user_card_expiry_month",
                            "value": null
                        },
                        "payment_method_data.card.card_number": {
                            "required_field": "payment_method_data.card.card_number",
                            "display_name": "card_number",
                            "field_type": "user_card_number",
                            "value": null
                        },
                        "billing.address.city": {
                            "required_field": "payment_method_data.billing.address.city",
                            "display_name": "city",
                            "field_type": "user_address_city",
                            "value": "San Fransico"
                        },
                        "billing.address.first_name": {
                            "required_field": "payment_method_data.billing.address.first_name",
                            "display_name": "card_holder_name",
                            "field_type": "user_full_name",
                            "value": "joseph"
                        },
                        "billing.address.zip": {
                            "required_field": "payment_method_data.billing.address.zip",
                            "display_name": "zip",
                            "field_type": "user_address_pincode",
                            "value": "94122"
                        },
                        "billing.address.last_name": {
                            "required_field": "payment_method_data.billing.address.last_name",
                            "display_name": "card_holder_name",
                            "field_type": "user_full_name",
                            "value": "Doe"
                        },
                        "billing.address.country": {
                            "required_field": "payment_method_data.billing.address.country",
                            "display_name": "country",
                            "field_type": {
                                "user_address_country": {
                                    "options": [
                                        "ALL"
                                    ]
                                }
                            },
                            "value": "US"
                        },
                        "billing.address.line2": {
                            "required_field": "payment_method_data.billing.address.line2",
                            "display_name": "line2",
                            "field_type": "user_address_line2",
                            "value": "CA"
                        },
                        "payment_method_data.card.card_exp_year": {
                            "required_field": "payment_method_data.card.card_exp_year",
                            "display_name": "card_exp_year",
                            "field_type": "user_card_expiry_year",
                            "value": null
                        },
                        "payment_method_data.card.card_cvc": {
                            "required_field": "payment_method_data.card.card_cvc",
                            "display_name": "card_cvc",
                            "field_type": "user_card_cvc",
                            "value": null
                        }
                    },
                    "surcharge_details": null,
                    "pm_auth_connector": null
                }
            ]
        }
    ],
    "mandate_payment": null,
    "merchant_name": "NewAge Retailer",
    "show_surcharge_breakup_screen": false,
    "payment_type": "new_mandate",
    "request_external_three_ds_authentication": false,
    "collect_shipping_details_from_wallets": false,
    "collect_billing_details_from_wallets": false,
    "is_tax_calculation_enabled": false
}

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

@Debarshi-Gupta Debarshi-Gupta added the A-connector-integration Area: Connector integration label Dec 24, 2024
@Debarshi-Gupta Debarshi-Gupta self-assigned this Dec 24, 2024
@Debarshi-Gupta Debarshi-Gupta requested a review from a team as a code owner December 24, 2024 08:58
Copy link

semanticdiff-com bot commented Dec 24, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/configs/defaults/payment_connector_required_fields.rs  67% smaller

@Debarshi-Gupta Debarshi-Gupta linked an issue Dec 26, 2024 that may be closed by this pull request
2 tasks
@Debarshi-Gupta Debarshi-Gupta changed the title bugfix: Refactored required fields for connectors bugfix(connectors): Refactored required fields for connectors Dec 27, 2024
@Debarshi-Gupta Debarshi-Gupta changed the title bugfix(connectors): Refactored required fields for connectors bug(connectors): Refactored required fields for connectors Dec 27, 2024
@Debarshi-Gupta Debarshi-Gupta changed the title bug(connectors): Refactored required fields for connectors fix(connectors): Refactored required fields for connectors Dec 27, 2024
Copy link
Contributor

@srujanchikke srujanchikke left a comment

Choose a reason for hiding this comment

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

Can you please write for what all connectors you have verified these mandatory fields and what are left to evaluate. Also please write the test cases.

@srujanchikke srujanchikke changed the title fix(connectors): Refactored required fields for connectors fix(connector): fix required fields for mandates supported connectors Dec 30, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Connector Required Fields for Mandates not present
3 participants