Skip to content

feat(nuvei): applepay decrypt at hyperswitch flow#9431

Merged
likhinbopanna merged 5 commits intomainfrom
nuvei-applepay-decryptAtHypwh
Sep 19, 2025
Merged

feat(nuvei): applepay decrypt at hyperswitch flow#9431
likhinbopanna merged 5 commits intomainfrom
nuvei-applepay-decryptAtHypwh

Conversation

@Nithin1506200
Copy link
Contributor

@Nithin1506200 Nithin1506200 commented Sep 18, 2025

Type of Change

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

Description

Add support for hyperswitch side decrypt flow for applepay in Nuvei

  • Hyperswitch can decrypt applepay token without involvement of connector if it has Apple pay processing certificate and private key.

how did i test

Payment Request

{
    "amount": 6500,
    "currency": "USD",
    "email": "email4@gmail.com",
    "customer_id": "hello5",
    "capture_method": "automatic",
    "confirm": true,
    "return_url": "https://hyperswitch-demo-store.netlify.app/?isTestingMode=true&hyperswitchClientUrl=https://beta.hyperswitch.io/v1&hyperswitchCustomPodUri=&hyperswitchCustomBackendUrl=&publishableKey=pk_snd_e6c328fa58824247865647d532583e66&secretKey=snd_H0f0rZqfaXlv6kz81O6tQptd2e250u5vlFsA1L50ogMglapamZmDzJ7qRlj4mNlM&profileId=pro_PxNHqEwbZM6rbIfgClSg&environment=Sandbox",
     "billing": {
        "address": {
            "zip": "560095",
            "country": "US",
            "first_name": "Sakil",
            "last_name": "Mostak",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "city": "Fasdf"
        }
    },
    "payment_method_data": {
        "wallet": {
            "apple_pay": {
                "payment_data": "eyJkYXRhIjoiSWRNbUFu***************d****************2NDQ5NDlmMWUxNGZiYmM4NTdiNjk5N2NkYWJlMzczZGEyOTI3ZmU5NzcifSwidmVyc2lvbiI6IkVDX3YxIn0=",
                "payment_method": {
                    "display_name": "Visa 0492",
                    "network": "Visa",
                    "type": "debit"
                },
                "transaction_identifier": "85ea39d59610a6860eb723644949f1e14fbbc857b6997cdabe373da2927fe977"
            }
        }
    },
    "payment_method": "wallet",
    "payment_method_type": "apple_pay",
    "connector": [
        "nuvei"
    ],
    "browser_info": {
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Safari/605.1.15",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "language": "en-US",
        "color_depth": 24,
        "screen_height": 1117,
        "screen_width": 1728,
        "ip_address": "192.168.1.1",
        "time_zone": -330,
        "java_enabled": true,
        "java_script_enabled": true,
        "device_model": "Macintosh",
        "os_type": "macOS",
        "os_version": "10.15.7"
    },
    "payment_type": "normal"
}

Response

{
    "payment_id": "pay_7wu0YSHTd8LFDE8KD2UN",
    "merchant_id": "merchant_1758115709",
    "status": "succeeded",
    "amount": 6500,
    "net_amount": 6500,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 6500,
    "connector": "nuvei",
    "client_secret": "pay_7wu0YSHTd8LFDE8KD2UN_secret_kIWxoLIlS4kexcOCmHz1",
    "created": "2025-09-18T07:35:21.765Z",
    "currency": "USD",
    "customer_id": "hello5",
    "customer": {
        "id": "hello5",
        "name": null,
        "email": "email4@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "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": "wallet",
    "payment_method_data": {
        "wallet": {
            "apple_pay": {
                "last4": "0492",
                "card_network": "Visa",
                "type": "debit"
            }
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "Fasdf",
            "country": "US",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "line3": null,
            "zip": "560095",
            "state": null,
            "first_name": "Sakil",
            "last_name": "Mostak",
            "origin_zip": null
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "email4@gmail.com",
    "name": null,
    "phone": null,
    "return_url": "https://hyperswitch-demo-store.netlify.app/?isTestingMode=true&hyperswitchClientUrl=https://beta.hyperswitch.io/v1&hyperswitchCustomPodUri=&hyperswitchCustomBackendUrl=&publishableKey=pk_snd_e6c328fa58824247865647d532583e66&secretKey=snd_H0f0rZqfaXlv6kz81O6tQptd2e250u5vlFsA1L50ogMglapamZmDzJ7qRlj4mNlM&profileId=pro_PxNHqEwbZM6rbIfgClSg&environment=Sandbox",
    "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": "apple_pay",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "hello5",
        "created_at": 1758180921,
        "expires": 1758184521,
        "secret": "epk_228ed6b0222a461b9497d73df63c5e11"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "7110000000017082220",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "8937234111",
    "payment_link": null,
    "profile_id": "pro_G0scDt6GAZBxs3brIkts",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_4ioDaxsfaPf9R3aZCrE6",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-09-18T07:50:21.765Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": "macOS",
        "language": "en-US",
        "time_zone": -330,
        "ip_address": "192.168.1.1",
        "os_version": "10.15.7",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Safari/605.1.15",
        "color_depth": 24,
        "device_model": "Macintosh",
        "java_enabled": true,
        "screen_width": 1728,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 1117,
        "java_script_enabled": true
    },
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": "",
    "payment_method_status": null,
    "updated": "2025-09-18T07:35:25.366Z",
    "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": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null
}
Screenshot 2025-09-18 at 1 24 08 PM

Similarly for manual capture

Screenshot 2025-09-18 at 1 25 41 PM

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

@semanticdiff-com
Copy link

semanticdiff-com bot commented Sep 18, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/payment_methods/src/configs/payment_connector_required_fields.rs  42% smaller
  crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs  41% smaller
  crates/connector_configs/toml/development.toml Unsupported file format
  crates/connector_configs/toml/production.toml Unsupported file format
  crates/connector_configs/toml/sandbox.toml Unsupported file format

@Nithin1506200 Nithin1506200 marked this pull request as ready for review September 18, 2025 08:00
@Nithin1506200 Nithin1506200 requested review from a team as code owners September 18, 2025 08:00
@Nithin1506200 Nithin1506200 linked an issue Sep 18, 2025 that may be closed by this pull request
2 tasks
@Nithin1506200 Nithin1506200 self-assigned this Sep 18, 2025
@likhinbopanna likhinbopanna added this pull request to the merge queue Sep 19, 2025
Merged via the queue into main with commit c59a66a Sep 19, 2025
21 of 25 checks passed
@likhinbopanna likhinbopanna deleted the nuvei-applepay-decryptAtHypwh branch September 19, 2025 12:22
pixincreate added a commit that referenced this pull request Sep 23, 2025
…aysafe-apple-pay

* 'main' of github.com:juspay/hyperswitch:
  feat(connector): [Tokenex] add template code (#9416)
  fix(webhooks): add idempotent_event_id generation using URL-safe Base64 (no padding) and SHA256 digest (#9405)
  feat(core): add webhook setup event handler (#9420)
  chore(version): 2025.09.22.0
  fix(connectors): [Nexixpay] send cvv in nexixpay requests (#9459)
  feat(router): add flag to wait for post message in `threeDSMethodData` for `three_ds_invoke` next action in Payments Confirm (#9454)
  feat(connector): [Paysafe] add wasm changes (#9455)
  feat: Implement subscription create for Chargebee (#9303)
  fix(connector): [CYBERSOURCE] Pass transaction type for only wallet MITs (#9444)
  feat(Connector): [checkout] l2l3 data  (#9446)
  feat(nuvei): applepay decrypt at hyperswitch flow (#9431)
  fix(connectors): [Nuvei] payments, refunds and chargeback webhooks (#9378)
  fix(connector): [ADYEN] Add fallback parsing for refusal codes and messages (#9361)
  feat(connector): Add support for get plan prices for Chargebee (#9300)
  feat(core): Juspay 3DS Server via Payments API (#9433)
  fix(core): Add Validation Check for Amount in Capture Flow (#9434)
  chore(version): 2025.09.19.0
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.

[FEATURE] Nuvei Apple pay hyperswitch-decryption flow

5 participants