feat(payments): add tokenization action handling to payment flow for braintree#9506
Merged
likhinbopanna merged 5 commits intomainfrom Sep 30, 2025
Merged
feat(payments): add tokenization action handling to payment flow for braintree#9506likhinbopanna merged 5 commits intomainfrom
likhinbopanna merged 5 commits intomainfrom
Conversation
Changed Files
|
047977e to
20248c7
Compare
hrithikesh026
previously approved these changes
Sep 24, 2025
crates/router/src/core/payments/operations/payment_confirm_intent.rs
Outdated
Show resolved
Hide resolved
prasunna09
requested changes
Sep 24, 2025
crates/router/src/core/payments/operations/payment_confirm_intent.rs
Outdated
Show resolved
Hide resolved
hrithikesh026
approved these changes
Sep 24, 2025
prasunna09
approved these changes
Sep 25, 2025
pixincreate
added a commit
that referenced
this pull request
Sep 30, 2025
…pay-new-field * 'main' of github.com:juspay/hyperswitch: (21 commits) feat(payments): add tokenization action handling to payment flow for braintree (#9506) feat(connector): [Loonio] Add template code (#9586) fix(connector): [paysafe] make `eci_indicator` field optional (#9591) fix(core): add should_call_connector_customer function to connector specification (#9569) feat(ucs): Add profile ID to lineage tracking in Unified Connector Service (#9559) feat(core): Add support for partial auth in proxy payments [V2] (#9503) chore(version): 2025.09.30.0 fix(authorizedotnet): refund via ucs missing connector_metadata (#9581) feat(auth): add new authentication to communicate between microservices (#9547) Fix: Ideal Giropay Country Currency Config (#9552) feat(connector): [ACI] cypress added (#9502) feat(connector): Add Peachpayments Cypress (#9573) chore(version): 2025.09.29.0 feat(finix): template code (#9557) feat(cypress): add cypress test-cases for manual retry (#9505) feat(core): update additional payment method data in psync response (#9519) feat(connector): [Checkout] Add Google Pay Predecrypt Flow (#9130) feat(framework): Added smithy, smithy-core and smithy-generator crates (#9249) fix(core): add request_extended_authorization in the payment attempt and populate it in the payment response (#9492) chore(version): 2025.09.26.0 ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
This feature add connector-level tokenization to Hyperswitch V2, allowing secure storage of card data as tokens at payment connectors like Braintree.
Additionally Tokenization in router is not implemented, because of temp locker mechanism which is still pending.
For connector-level tokenization:
1.When a payment comes with raw card data and the connector supports tokenization, send the card details to the connector’s tokenization API.
2. Receive the tokenized payment method ID.
3. Use the token for the subsequent payment call.
Additional Changes
Motivation and Context
Closes #9501
How did you test it?
▶ Create and Confirm Request
Request:
Response:
{ "id": "12345_pay_0199758923487c2380efbcb7a0480045", "status": "succeeded", "amount": { "order_amount": 100, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 100, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": 100 }, "customer_id": null, "connector": "braintree", "created": "2025-09-23T07:45:45.801Z", "modified_at": "2025-09-23T07:45:46.773Z", "payment_method_data": { "billing": null }, "payment_method_type": "card", "payment_method_subtype": "credit", "connector_transaction_id": "dHJhbnNhY3Rpb25fcWE0NGtmdHM", "connector_reference_id": null, "merchant_connector_id": "mca_15ue2HSPzmSPtuWvipkZ", "browser_info": null, "error": null, "shipping": null, "billing": null, "attempts": null, "connector_token_details": null, "payment_method_id": null, "next_action": null, "return_url": "https://google.com/success", "authentication_type": "no_three_ds", "authentication_type_applied": "no_three_ds", "is_iframe_redirection_enabled": null, "merchant_reference_id": null, "raw_connector_response": null, "feature_metadata": null, "metadata": null }▶ Create Intent
Request:
Response:
{ "id": "12345_pay_019975899d367c61ae62b88f1edde4e9", "status": "requires_payment_method", "amount_details": { "order_amount": 10000, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null }, "client_secret": "cs_019975899d487c93a8bf823b41c05b44", "profile_id": "pro_pYmCUDflXtfYghJEbwig", "merchant_reference_id": null, "routing_algorithm_id": null, "capture_method": "automatic", "authentication_type": "no_three_ds", "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", "origin_zip": null }, "phone": null, "email": "example@example.com" }, "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", "origin_zip": null }, "phone": null, "email": "example@example.com" }, "customer_id": null, "customer_present": "present", "description": null, "return_url": null, "setup_future_usage": "on_session", "apply_mit_exemption": "Skip", "statement_descriptor": null, "order_details": null, "allowed_payment_method_types": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "payment_link_enabled": "Skip", "payment_link_config": null, "request_incremental_authorization": "false", "split_txns_enabled": "skip", "expires_on": "2025-09-23T08:01:17.027Z", "frm_metadata": null, "request_external_three_ds_authentication": "Skip", "payment_type": "normal" }▶ Confirm Intent
Request:
Response:
{ "id": "12345_pay_019975899d367c61ae62b88f1edde4e9", "status": "succeeded", "amount": { "order_amount": 10000, "currency": "USD", "shipping_cost": null, "order_tax_amount": null, "external_tax_calculation": "skip", "surcharge_calculation": "skip", "surcharge_amount": null, "tax_on_surcharge": null, "net_amount": 10000, "amount_to_capture": null, "amount_capturable": 0, "amount_captured": 10000 }, "customer_id": null, "connector": "braintree", "created": "2025-09-23T07:46:17.027Z", "modified_at": "2025-09-23T07:47:00.359Z", "payment_method_data": { "billing": null }, "payment_method_type": "card", "payment_method_subtype": "credit", "connector_transaction_id": "dHJhbnNhY3Rpb25fZnhxaDczNXY", "connector_reference_id": null, "merchant_connector_id": "mca_15ue2HSPzmSPtuWvipkZ", "browser_info": null, "error": null, "shipping": null, "billing": null, "attempts": null, "connector_token_details": null, "payment_method_id": null, "next_action": null, "return_url": "https://google.com/success", "authentication_type": "no_three_ds", "authentication_type_applied": "no_three_ds", "is_iframe_redirection_enabled": null, "merchant_reference_id": null, "raw_connector_response": null, "feature_metadata": null, "metadata": null }Checklist
cargo +nightly fmt --allcargo clippy