feat(core): Implement UCS based upi for paytm and phonepe#8732
Merged
Gnanasundari24 merged 22 commits intomainfrom Jul 31, 2025
Merged
feat(core): Implement UCS based upi for paytm and phonepe#8732Gnanasundari24 merged 22 commits intomainfrom
Gnanasundari24 merged 22 commits intomainfrom
Conversation
jarnura
previously approved these changes
Jul 29, 2025
su-shivanshmathur
previously approved these changes
Jul 29, 2025
jarnura
previously approved these changes
Jul 31, 2025
jarnura
previously approved these changes
Jul 31, 2025
su-shivanshmathur
previously approved these changes
Jul 31, 2025
Resolved conflicts by including both katapult (from main) and paytm/phonepe (from feature branch) connectors
jarnura
approved these changes
Jul 31, 2025
su-shivanshmathur
approved these changes
Jul 31, 2025
pixincreate
added a commit
that referenced
this pull request
Aug 1, 2025
…rver * 'main' of github.com:juspay/hyperswitch: (25 commits) chore: `xof` currency to cybersource cards (#8799) chore(version): 2025.08.01.0 feat(core): Implement UCS based upi for paytm and phonepe (#8732) feat(connector): [katapult]add template code for katapult (#8783) feat(router): introduce `feature` and `feature_data` to gsm (#7771) feat(connector): [cybersource] add changes for field CybersourceConsumerAuthInformation (#8768) feat(authentication): added authentication sync api (#8596) feat(connector): [facilitapay] fix refunds, add webhook and void support (#8778) feat(connector): [payload] add recurring payments (#8597) chore(version): 2025.07.31.0 feat(connector): [Flexiti]Add support for flexiti connector (#8743) chore(router): events enhancement for kafka (#8780) ci(cypress): Making a mandate payment with large customer user agents (#8790) fix(openapi): update create_platform endpoint in api-reference docs (#8782) chore(version): 2025.07.30.0 fix(connector): [GLOBALPAY] Added Tokenization Flow for CITs (#8568) feat(routing): Add api-refs for new decision engine endpoints (#8709) fix: replace xtrim with xdel to support older redis version (#8515) fix(connector): [Worldpay] handle multiple ddc submission for CompleteAuthorize (#8741) feat(connector): [Adyen] receive incoming webhooks for pix expiry (#8720) ...
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
Fixed #8734
Description
This PR implements UPI Intent and QR code payment flows for the Unified Connector Service (UCS) integration, adding default implementations for Paytm and PhonePe connectors.
Key Changes:
Note: This PR does not implement direct integrations with Paytm or PhonePe APIs. The actual payment processing and API communication is handled by the Unified Connector Service (UCS). This PR provides the necessary scaffolding and routing logic to support these payment methods through UCS.
Additional Changes
Configuration changes can be found in:
config/development.tomlconfig/deployments/production.tomlconfig/deployments/sandbox.tomlconfig/deployments/integration_test.tomlcrates/connector_configs/toml/*.tomlMotivation and Context
This change enables merchants to accept UPI payments through Paytm and PhonePe payment gateways using the Unified Connector Service. UPI is a crucial payment method in India, and supporting Intent and QR code flows allows for seamless integration across mobile apps and web platforms.
The implementation leverages the UCS architecture where:
How did you test it?
Automated Tests
crates/router/tests/connectors/Manual Testing
{ "payment_id": "pay_XzkwJ5pFVTmuGGAXBy3G", "merchant_id": "merchant_1753180563", "status": "processing", "amount": 1000, "net_amount": 1000, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": "phonepe", "client_secret": "[REDACTED]", "created": "2025-07-23T08:36:35.265Z", "currency": "INR", "customer_id": "IatapayCustomer", "customer": { "id": "IatapayCustomer", "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": null, "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "upi", "payment_method_data": { "upi": { "upi_intent": {} }, "billing": { "address": { "city": "San Fransico", "country": "IN", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "California", "first_name": "Swangi", "last_name": "Kumari" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": "swangi.kumari@juspay.in" } }, "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": "swangi.kumari@juspay.in" }, "billing": { "address": { "city": "San Fransico", "country": "IN", "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": "swangi.kumari@juspay.in" }, "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": { "type": "qr_code_information", "image_data_url": "[REDACTED BASE64 QR CODE DATA]", "display_to_timestamp": null, "qr_code_url": null, "display_text": null, "border_color": null }, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "upi_intent", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "IatapayCustomer", "created_at": 1753259795, "expires": 1753263395, "secret": "[REDACTED]" }, "manual_retry_allowed": false, "connector_transaction_id": "pay_XzkwJ5pFVTmuGGAXBy3G_1", "frm_message": null, "metadata": { "udf1": "value1", "login_date": "2019-09-10T10:11:12Z", "new_customer": "true" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_XzkwJ5pFVTmuGGAXBy3G_1", "payment_link": null, "profile_id": "pro_aDyARAw6YQZAPr6sqHgi", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_fTVznSS9dGiTX3QEXrg3", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-07-23T08:51:35.265Z", "fingerprint": null, "browser_info": null, "payment_method_id": null, "payment_method_status": null, "updated": "2025-07-23T08:36:35.797Z", "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": null, "force_3ds_challenge": false, "force_3ds_challenge_trigger": false, "issuer_error_code": null, "issuer_error_message": null, "is_iframe_redirection_enabled": null, "whole_connector_response": "{\"success\":true,\"code\":\"PAYMENT_INITIATED\",\"message\":\"Payment initiated\",\"data\":{\"merchantId\":\"JUSPAONLINE\",\"merchantTransactionId\":\"pay_XzkwJ5pFVTmuGGAXBy3G_1\",\"instrumentResponse\":{\"type\":\"UPI_INTENT\",\"intentUrl\":\"upi://pay?pa=JUSPAONLINE@ybl&pn=Juspay&am=10.00&mam=10.00&tr=OM2507231406356135400588&tn=Payment%20for%20pay_XzkwJ5pFVTmuGGAXBy3G_1&mc=6051&mode=04&purpose=00&utm_campaign=B2B_PG&utm_medium=JUSPAONLINE&utm_source=OM2507231406356135400588\"}}}" }The response shows successful routing through UCS with QR code generation (when invoked from sdk) for UPI payment.
Checklist
cargo +nightly fmt --allcargo clippy