Skip to content

Conversation

@Vani-1107
Copy link
Contributor

@Vani-1107 Vani-1107 commented Nov 29, 2025

Type of Change

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

Description

Implemented apple pay - connector decryption flow for WorldpayWPG

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?

Request:


{
    "amount": 1000,
    "currency": "USD",
    "confirm": true,
    "return_url": "https://www.google.com",
    "capture_method": "automatic",
    "all_keys_required": true,
    "enable_partial_authorization": true,
    "authentication_type": "no_three_ds",
    "description": "hellow world",
    "billing": {
        "address": {
            "zip": "560095",
            "country": "US",
            "first_name": "Sakil",
            "last_name": "Mostak",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "city": "Fasdf"
        }
    },
    "shipping": {
        "address": {
            "zip": "560095",
            "country": "US",
            "first_name": "Sakil",
            "last_name": "Mostak",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "city": "Fasdf"
        }
    },
    "customer": {
        "phone": "12345678911",
        "phone_country_code": "+91",
        "name": "test add",
        "id": "cus_1234"
    },
    "browser_info": {
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
        "ip_address": "192.168.1.1",
        "java_enabled": true,
        "java_script_enabled": true,
        "language": "en-US",
        "color_depth": 24,
        "screen_height": 864,
        "screen_width": 1536,
        "time_zone": 300,
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
    },
    "email": "[email protected]",
    "payment_method": "wallet",
    "payment_method_type": "apple_pay",
    "payment_method_data": {
        "wallet": {
            "apple_pay": {
                "payment_data": "eyJkYXRh******************m",
                "payment_method": {
                    "display_name": "Visa 0492",
                    "network": "Visa",
                    "type": "debit"
                },
                "transaction_identifier": "3ff9bec3(*******5541a4b5ef830b941"
            }
        }
    }
}

Response:


{
    "payment_id": "pay_O9AyaZzfbAYLUshrw685",
    "merchant_id": "merchant_1765197510",
    "status": "processing",
    "amount": 1000,
    "net_amount": 1000,
    "shipping_cost": null,
    "amount_capturable": 1000,
    "amount_received": null,
    "connector": "worldpayxml",
    "client_secret": "pay_O9AyaZzfbAYLUshrw685_secret_1PLbDXhVqfGDdZdqERP6",
    "created": "2025-12-08T12:42:36.061Z",
    "currency": "USD",
    "customer_id": "cus_1234",
    "customer": {
        "id": "cus_1234",
        "name": "test add",
        "email": "[email protected]",
        "phone": "12345678911",
        "phone_country_code": "+91"
    },
    "description": "hellow world",
    "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",
                "card_exp_month": null,
                "card_exp_year": null
            }
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "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
    },
    "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": "[email protected]",
    "name": "test add",
    "phone": "12345678911",
    "return_url": "https://www.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,
    "error_reason": 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": "cus_1234",
        "created_at": 1765197756,
        "expires": 1765201356,
        "secret": "epk_3ed3c07946ed4a6f8ea9c192fdacca6f"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "U6MRTdqQNqz9inprEhCv4yRrvKmO0sEkasIQ_59VpqGUNCLQyr38DBFPedb28HB5",
    "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": "U6MRTdqQNqz9inprEhCv4yRrvKmO0sEkasIQ_59VpqGUNCLQyr38DBFPedb28HB5",
    "payment_link": null,
    "profile_id": "pro_kShnsixnRohXUN6NPLe4",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_OG4Y5UfnVtfndC66StFK",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-12-08T12:57:36.061Z",
    "fingerprint": null,
    "browser_info": {
        "language": "en-US",
        "time_zone": 300,
        "ip_address": "192.168.1.1",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 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,*/*;q=0.8",
        "screen_height": 864,
        "java_script_enabled": true
    },
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-12-08T12:42:37.989Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "extended_authorization_last_applied_at": null,
    "request_extended_authorization": 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,
    "enable_partial_authorization": true,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null,
    "billing_descriptor": null,
    "tokenization": null,
    "partner_merchant_identifier_details": null
}

PSync:


{
    "payment_id": "pay_O9AyaZzfbAYLUshrw685",
    "merchant_id": "merchant_1765197510",
    "status": "succeeded",
    "amount": 1000,
    "net_amount": 1000,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 1000,
    "connector": "worldpayxml",
    "client_secret": "pay_O9AyaZzfbAYLUshrw685_secret_1PLbDXhVqfGDdZdqERP6",
    "created": "2025-12-08T12:42:36.061Z",
    "modified_at": "2025-12-08T13:01:18.133Z",
    "currency": "USD",
    "customer_id": "cus_1234",
    "customer": {
        "id": "cus_1234",
        "name": "test add",
        "email": "[email protected]",
        "phone": "12345678911",
        "phone_country_code": "+91"
    },
    "description": "hellow world",
    "refunds": null,
    "disputes": null,
    "attempts": [
        {
            "attempt_id": "pay_O9AyaZzfbAYLUshrw685_1",
            "status": "pending",
            "amount": 1000,
            "order_tax_amount": null,
            "currency": "USD",
            "connector": "worldpayxml",
            "error_message": null,
            "payment_method": "wallet",
            "connector_transaction_id": "U6MRTdqQNqz9inprEhCv4yRrvKmO0sEkasIQ_59VpqGUNCLQyr38DBFPedb28HB5",
            "capture_method": "automatic",
            "authentication_type": "no_three_ds",
            "created_at": "2025-12-08T12:42:36.062Z",
            "modified_at": "2025-12-08T12:42:37.989Z",
            "cancellation_reason": null,
            "mandate_id": null,
            "error_code": null,
            "payment_token": null,
            "connector_metadata": null,
            "payment_experience": null,
            "payment_method_type": "apple_pay",
            "reference_id": "U6MRTdqQNqz9inprEhCv4yRrvKmO0sEkasIQ_59VpqGUNCLQyr38DBFPedb28HB5",
            "unified_code": null,
            "unified_message": null,
            "client_source": null,
            "client_version": 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",
                "card_exp_month": null,
                "card_exp_year": null
            }
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "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
    },
    "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": "[email protected]",
    "name": "test add",
    "phone": "12345678911",
    "return_url": "https://www.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": "apple_pay",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "U6MRTdqQNqz9inprEhCv4yRrvKmO0sEkasIQ_59VpqGUNCLQyr38DBFPedb28HB5",
    "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": "U6MRTdqQNqz9inprEhCv4yRrvKmO0sEkasIQ_59VpqGUNCLQyr38DBFPedb28HB5",
    "payment_link": null,
    "profile_id": "pro_kShnsixnRohXUN6NPLe4",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_OG4Y5UfnVtfndC66StFK",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-12-08T12:57:36.061Z",
    "fingerprint": null,
    "browser_info": {
        "language": "en-US",
        "time_zone": 300,
        "ip_address": "192.168.1.1",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 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,*/*;q=0.8",
        "screen_height": 864,
        "java_script_enabled": true
    },
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-12-08T13:01:18.133Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "extended_authorization_last_applied_at": null,
    "request_extended_authorization": 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,
    "enable_partial_authorization": true,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null,
    "billing_descriptor": null,
    "tokenization": null,
    "partner_merchant_identifier_details": null,
    "payment_method_tokenization_details": null
}

WASM:
Screenshot 2025-11-28 at 5 23 46 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

@Vani-1107 Vani-1107 requested review from a team as code owners November 29, 2025 16:39
@semanticdiff-com
Copy link

semanticdiff-com bot commented Nov 29, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs  10% smaller
  config/config.example.toml Unsupported file format
  config/deployments/integration_test.toml Unsupported file format
  config/deployments/production.toml Unsupported file format
  config/deployments/sandbox.toml Unsupported file format
  config/development.toml Unsupported file format
  config/docker_compose.toml Unsupported file format
  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
  crates/hyperswitch_connectors/src/connectors/worldpayxml.rs  0% smaller
  loadtest/config/development.toml Unsupported file format

@Vani-1107 Vani-1107 linked an issue Nov 29, 2025 that may be closed by this pull request
2 tasks
@codecov
Copy link

codecov bot commented Nov 29, 2025

Codecov Report

❌ Patch coverage is 0% with 47 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@2543a81). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...nectors/src/connectors/worldpayxml/transformers.rs 0.00% 38 Missing ⚠️
...perswitch_connectors/src/connectors/worldpayxml.rs 0.00% 9 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10482   +/-   ##
=======================================
  Coverage        ?    6.44%           
=======================================
  Files           ?     1254           
  Lines           ?   313372           
  Branches        ?        0           
=======================================
  Hits            ?    20208           
  Misses          ?   293164           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Vani-1107 Vani-1107 self-assigned this Nov 30, 2025
@Vani-1107 Vani-1107 added the A-payment-methods Area: Payment Methods label Dec 8, 2025
@deepanshu-iiitu deepanshu-iiitu self-requested a review December 8, 2025 15:03
ShankarSinghC
ShankarSinghC previously approved these changes Dec 9, 2025
deepanshu-iiitu
deepanshu-iiitu previously approved these changes Dec 9, 2025
@likhinbopanna likhinbopanna added this pull request to the merge queue Dec 10, 2025
Merged via the queue into main with commit cc2eef3 Dec 10, 2025
26 of 27 checks passed
@likhinbopanna likhinbopanna deleted the wpg-applepay branch December 10, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-payment-methods Area: Payment Methods

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] [WorldpayWPG] Add apple pay - connector decryption flow

5 participants