Skip to content

Conversation

pixincreate
Copy link
Member

@pixincreate pixincreate commented Jun 6, 2025

Type of Change

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

Description

This PR fixes the required fields error in SDK.

Additional Changes

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

Motivation and Context

SDK throws Missing Required Param: cpf.

Closes #8275

How did you test it?

CPF now gets populated:

curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_1iYxKKzKMLFXthlD6iAO_secret_i2gpOEtZadPHnlUpKR1Z' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_9caa65826ff740e78fcf292b7d96f31f'
{
    "redirect_url": "https://duck.com/",
    "currency": "BRL",
    "payment_methods": [
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "credit",
                    "payment_experience": null,
                    "card_networks": [
                        {
                            "card_network": "Interac",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "Discover",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "AmericanExpress",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "JCB",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "Visa",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "DinersClub",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "Mastercard",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "UnionPay",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "RuPay",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        }
                    ],
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": null,
                    "required_fields": null,
                    "surcharge_details": null,
                    "pm_auth_connector": null
                },
                {
                    "payment_method_type": "debit",
                    "payment_experience": null,
                    "card_networks": [
                        {
                            "card_network": "AmericanExpress",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "Interac",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "JCB",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "Visa",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "Discover",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "Mastercard",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "UnionPay",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "DinersClub",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        },
                        {
                            "card_network": "RuPay",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "facilitapay"
                            ]
                        }
                    ],
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": null,
                    "required_fields": null,
                    "surcharge_details": null,
                    "pm_auth_connector": null
                }
            ]
        },
        {
            "payment_method": "bank_transfer",
            "payment_method_types": [
                {
                    "payment_method_type": "pix",
                    "payment_experience": null,
                    "card_networks": null,
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": {
                        "eligible_connectors": [
                            "facilitapay"
                        ]
                    },
                    "required_fields": {
                        "billing.address.country": {
                            "required_field": "payment_method_data.billing.address.country",
                            "display_name": "country",
                            "field_type": {
                                "user_address_country": {
                                    "options": [
                                        "BR"
                                    ]
                                }
                            },
                            "value": "BR"
                        },
                        "payment_method_data.bank_transfer.pix.source_bank_account_id": {
                            "required_field": "payment_method_data.bank_transfer.pix.source_bank_account_id",
                            "display_name": "source_bank_account_id",
                            "field_type": "user_source_bank_account_id",
                            "value": null
                        },
                        "payment_method_data.bank_transfer.pix.destination_bank_account_id": {
                            "required_field": "payment_method_data.bank_transfer.pix.destination_bank_account_id",
                            "display_name": "destination_bank_account_id",
                            "field_type": "user_destination_bank_account_id",
                            "value": null
                        },
                        "payment_method_data.bank_transfer.pix.cpf": {
                            "required_field": "payment_method_data.bank_transfer.pix.cpf",
                            "display_name": "cpf",
                            "field_type": "user_cpf",
                            "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": "THE"
                        },
                        "billing.address.first_name": {
                            "required_field": "payment_method_data.billing.address.first_name",
                            "display_name": "card_holder_name",
                            "field_type": "user_full_name",
                            "value": "PiX"
                        }
                    },
                    "surcharge_details": null,
                    "pm_auth_connector": null
                }
            ]
        }
    ],
    "mandate_payment": null,
    "merchant_name": "NewAge Retailer",
    "show_surcharge_breakup_screen": false,
    "payment_type": "normal",
    "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 just clippy && just clippy_v2
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@pixincreate pixincreate added this to the June 2025 Release milestone Jun 6, 2025
@pixincreate pixincreate self-assigned this Jun 6, 2025
@pixincreate pixincreate requested a review from a team as a code owner June 6, 2025 11:06
@pixincreate pixincreate added A-connector-integration Area: Connector integration C-bug Category: Bug S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Jun 6, 2025
Copy link

semanticdiff-com bot commented Jun 6, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/payment_methods/src/configs/payment_connector_required_fields.rs  0% smaller

@likhinbopanna likhinbopanna enabled auto-merge June 6, 2025 11:27
@likhinbopanna likhinbopanna added this pull request to the merge queue Jun 6, 2025
Merged via the queue into main with commit 65acf59 Jun 6, 2025
18 of 24 checks passed
@likhinbopanna likhinbopanna deleted the connector/facilitapay-required-fields-fix branch June 6, 2025 12:30
@pixincreate pixincreate removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jun 6, 2025
pixincreate added a commit that referenced this pull request Jun 9, 2025
…nktransfer

* 'main' of github.com:juspay/hyperswitch: (211 commits)
  feat(tokenio): Add OpenBanking Redirection Flow (#8152)
  fix: Unified scarf setup (#8238)
  feat(health): Health check for Decision engine (#8243)
  chore: Update apple pay currency filter configs (#8217)
  refactor(customers_v2): Remove merchant reference id from v2 customer update (#7879)
  chore(version): 2025.06.09.0
  chore(postman): update Postman collection files
  ci(postman): add tunnel collection to postman tests (#8269)
  feat(connector): Added recurring payments support for split payments in Stripe (#8271)
  feat(connector): [STRIPE] Added Connector Tokenization Flow for Cards (#8248)
  refactor(core): introduce new field in payment_intent to handle longer return_url (#8135)
  fix(connector): [AUTHORIZEDOTNET] Remove country PM filters (#8278)
  refactor(config): redact config urls for hyperswitch vault (#8276)
  feat(vsaas): enable onboarding of Standard Merchant Accounts in Platform Organization (#8231)
  feat(router): add three_ds decision rule execute api (#8148)
  feat(router): Save payment method on payments confirm (V2) (#8090)
  ci(cypress): Add Airwallex Connector Test (#8187)
  feat(payment_methods): add `external_vault_details` for payments v2 sdk session call (#8003)
  fix(connector): [facilitapay] cpf is a required field (#8274)
  fix: Fixed spell check (#8227)
  ...
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 C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] CPF info not getting populated for Facilitapay required fields
4 participants