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

refactor(connector): [BRAINTREE] Pass email in payment requests #7617

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

deepanshu-iiitu
Copy link
Contributor

Type of Change

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

Description

ORIGINAL PR: #7591
Pass email in payment request body of Braintree as it is mandatory field for sending receipts in braintree

Additional Changes

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

Motivation and Context

#7590

How did you test it?

Payment Request:

{
    "amount": 1233,
    "currency": "EUR",
    "confirm": true,
    "customer_id": "abcdef",
    "billing": {
        "email": "[email protected]"
    }
    "name": "John Doe",
    "authentication_type": "no_three_ds",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "5200000000001096",
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        }
    }
}

Payment Response:

{
    "payment_id": "pay_o6SLsqlZ6J049AiPkHwW",
    "merchant_id": "postman_merchant_GHAction_ec4bf644-13b4-420a-9747-5a91dc33c1b5",
    "status": "requires_customer_action",
    "amount": 100,
    "net_amount": 100,
    "shipping_cost": null,
    "amount_capturable": 100,
    "amount_received": null,
    "connector": "braintree",
    "client_secret": "pay_o6SLsqlZ6J049AiPkHwW_secret_Bv6iGp8QmWWfywJd7jOO",
    "created": "2025-03-21T11:15:04.414Z",
    "currency": "EUR",
    "customer_id": "deepanshu",
    "customer": {
        "id": "deepanshu",
        "name": null,
        "email": "[email protected]",
        "phone": null,
        "phone_country_code": null
    },
    "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": null,
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1096",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "520000",
            "card_extended_bin": null,
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "Deepanshu Bansal",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": null,
        "phone": null,
        "email": "[email protected]"
    },
    "order_details": null,
    "email": "[email protected]",
    "name": null,
    "phone": null,
    "return_url": "https://duck.com/",
    "authentication_type": "three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_o6SLsqlZ6J049AiPkHwW/postman_merchant_GHAction_ec4bf644-13b4-420a-9747-5a91dc33c1b5/pay_o6SLsqlZ6J049AiPkHwW_1"
    },
    "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": "deepanshu",
        "created_at": 1742555704,
        "expires": 1742559304,
        "secret": "epk_cc70c871e62f4f0a9a0fb797bb433941"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_pzlYtlAD7YgNLdXLPSlq",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_CSJaSjj2gRnDoaSDRndr",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-03-21T11:30:04.414Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_xp0BCgE81c2YO7G4Zan5",
    "payment_method_status": "inactive",
    "updated": "2025-03-21T11:15:06.916Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": "manual",
    "issuer_error_code": null,
    "issuer_error_message": 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

@deepanshu-iiitu deepanshu-iiitu added A-connector-integration Area: Connector integration C-refactor Category: Refactor labels Mar 25, 2025
@deepanshu-iiitu deepanshu-iiitu self-assigned this Mar 25, 2025
@deepanshu-iiitu deepanshu-iiitu requested a review from a team as a code owner March 25, 2025 09:20
Copy link

semanticdiff-com bot commented Mar 25, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs  0% smaller

@deepanshu-iiitu deepanshu-iiitu linked an issue Mar 25, 2025 that may be closed by this pull request
2 tasks
@likhinbopanna likhinbopanna merged commit e578f29 into hotfix-2025.03.19.0 Mar 25, 2025
17 of 20 checks passed
@likhinbopanna likhinbopanna deleted the bt-email-fix branch March 25, 2025 10:47
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-refactor Category: Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] [BRAINTREE] Pass email in payment requests
5 participants