Skip to content

fix(core): Fix connector mandate details for setup mandate#6096

Merged
Gnanasundari24 merged 2 commits intomainfrom
fix-cmid-setup
Sep 26, 2024
Merged

fix(core): Fix connector mandate details for setup mandate#6096
Gnanasundari24 merged 2 commits intomainfrom
fix-cmid-setup

Conversation

@Aprabhat19
Copy link
Contributor

@Aprabhat19 Aprabhat19 commented Sep 26, 2024

Type of Change

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

Description

Add support for setup mandate payments to show connector_mandate_id

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?

  • Create a MA and MCA
  • Create a 0 dollar payment , the connector_mandate_details should be populated in the response
{
    "payment_id": "pay_u9daXin9p77AD1e4OudT",
    "merchant_id": "merchant_1727343268",
    "status": "succeeded",
    "amount": 0,
    "net_amount": 0,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": "stripe",
    "client_secret": "pay_u9daXin9p77AD1e4OudT_secret_BwUFsGfYpSRg8xjosR4e",
    "created": "2024-09-26T09:40:24.193Z",
    "currency": "USD",
    "customer_id": "CustomerX7777",
    "customer": {
        "id": "CustomerX7777",
        "name": "Joseph Doe",
        "email": "something@gmail.com",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "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": "06",
            "card_exp_year": "2030",
            "card_holder_name": null,
            "payment_checks": {
                "cvc_check": "pass",
                "address_line1_check": null,
                "address_postal_code_check": null
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "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": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": null,
    "email": "something@gmail.com",
    "name": "Joseph Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "seti_1Q3EBqD5R7gDAGffYGE5bgus",
    "frm_message": null,
    "metadata": {
        "brand": "waytopark",
        "order_id": 221275
    },
    "connector_metadata": {
        "apple_pay": null,
        "airwallex": null,
        "noon": {
            "order_category": "pay"
        }
    },
    "feature_metadata": null,
    "reference_id": "seti_1Q3EBqD5R7gDAGffYGE5bgus",
    "payment_link": null,
    "profile_id": "pro_V3hSOe56Ypty8ommiNy8",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_BPDaQo1STbco0XnGtMcW",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-26T09:55:24.193Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "125.0.0.1",
        "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": "pm_o8ZUz1c0PVwN1qZKNMhB",
    "payment_method_status": null,
    "updated": "2024-09-26T09:40:51.361Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": "pm_1Q3EBqD5R7gDAGffTtTkfOfu"
}

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

@Aprabhat19 Aprabhat19 self-assigned this Sep 26, 2024
@Aprabhat19 Aprabhat19 requested a review from a team as a code owner September 26, 2024 09:58
@semanticdiff-com
Copy link

semanticdiff-com bot commented Sep 26, 2024

Review changes with SemanticDiff.

Analyzed 1 of 1 files.

Overall, the semantic diff is 38% smaller than the GitHub diff.

Filename Status
✔️ crates/router/src/core/payments/operations/payment_response.rs 37.5% smaller

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Sep 26, 2024
Merged via the queue into main with commit 8c12862 Sep 26, 2024
@Gnanasundari24 Gnanasundari24 deleted the fix-cmid-setup branch September 26, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] Add connector_mandate_details to the payments_response based on the merchant config

4 participants