Skip to content

feat(router): add support for GooglePay pre-decrypted token in the payments confirm call #8865

Merged
likhinbopanna merged 2 commits intomainfrom
gpay_decrypted
Aug 8, 2025
Merged

feat(router): add support for GooglePay pre-decrypted token in the payments confirm call #8865
likhinbopanna merged 2 commits intomainfrom
gpay_decrypted

Conversation

@awasthi21
Copy link
Contributor

@awasthi21 awasthi21 commented Aug 7, 2025

Type of Change

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

Description

This PR will allow to pass the Decrypted Payload(GooglePay) directly in the Payments Confirm call

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?

GooglePay Decypted CyberSource Flow
Requesst

--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_M71MzSCVlIx951DQSg5QcC3uFSrwEzKm4cYnFhwHpUwXJg9WJH1fTVF93NyykOOE' \
--data-raw '{
    "amount": 6540,
    "currency": "EUR",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 6540,
    "customer_id": "BamboraCustomer",
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "payment_method": "wallet",
    "payment_method_type": "google_pay",
    "payment_method_data": {
        "wallet": {
            "google_pay": {
                "type": "CARD",
                "description": "SuccessfulAuth: Visa •••• 1000",
                "info": {
                    "card_network": "VISA",
                    "card_details": "1000",
                    "assurance_details": {
                        "card_holder_authenticated": false,
                        "account_verified": true
                    }
                },
                "tokenization_data": {
                    "type": "DIRECT",
                    "token": ""
                }
            }
        },
        "billing": {
            "address": {
                "line1": "1467",
                "line2": "Harrison Street",
                "line3": "Harrison Street",
                "city": "San Fransico",
                "state": "California",
                "zip": "94122",
                "country": "US",
                "first_name": "joseph",
                "last_name": "Doe"
            },
            "phone": {
                "number": "8056594427",
                "country_code": "+91"
            }
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "setup_future_usage": "off_session"
}'

Response

{
    "payment_id": "pay_syTVFvcTY4b0PjT6PKEt",
    "merchant_id": "postman_merchant_GHAction_02016f26-5b2d-4ec4-9b86-78a3e3e1f922",
    "status": "succeeded",
    "amount": 6540,
    "net_amount": 6540,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 6540,
    "connector": "cybersource",
    "client_secret": "pay_syTVFvcTY4b0PjT6PKEt_secret_CrowG7yDryGZXDfXDENH",
    "created": "2025-08-07T11:31:26.390Z",
    "currency": "EUR",
    "customer_id": "BamboraCustomer",
    "customer": {
        "id": "BamboraCustomer",
        "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": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "payment_method_data": {
        "wallet": {
            "google_pay": {
                "last4": "1000",
                "card_network": "VISA",
                "type": "CARD"
            }
        },
        "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": {
                "number": "8056594427",
                "country_code": "+91"
            },
            "email": null
        }
    },
    "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",
            "origin_zip": null
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "billing": null,
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "google_pay",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "BamboraCustomer",
        "created_at": 1754566285,
        "expires": 1754569885,
        "secret": "epk_70a449192d1b480e83ded610e7688e82"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7545662883716066604807",
    "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_syTVFvcTY4b0PjT6PKEt_1",
    "payment_link": null,
    "profile_id": "pro_oq1JzZKwE5N7nVMYLUCF",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_XLlQeCZZDTIKsFLqxpNb",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-08-07T11:46:26.390Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-08-07T11:31:28.687Z",
    "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
}

Vantive GPay Decrypted Flow (Merchant Side Decryption)
Request

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_UBWl0uGQwa2edSbIthcmcgkOZGBuirsDxKK8GoHi18URlT4ou1CeihfMnULoiJdk' \
--data-raw '{
    "amount": 7445,
    "currency": "USD",
    "confirm": true,
            "setup_future_usage": "off_session",

    "business_country": "US",
    "business_label": "default",
    "amount_to_capture": 7445,
    "customer_id": "cu_1754637351",
    "capture_method": "automatic",
     "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "in sit",
            "user_agent": "amet irure esse"
        }
    },
    "capture_on": "2022-09-10T10:11:12Z",
    
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "email": "something@gmail.com",
    "name": "Joseph Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "payment_method": "wallet",
    "payment_method_type": "google_pay",
    "billing": {
        "address": {
            "line1": "1467",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    
    "payment_method_data": {
        "wallet": {
            "google_pay": {
                "type": "CARD",
                "description": "SuccessfulAuth: Visa •••• 1000",
                "info": {
                    "assurance_details": {
                        "account_verified": true,
                        "card_holder_authenticated": false
                    },
                    "card_details": "1000",
                    "card_network": "MASTERCARd"
                },
                "tokenization_data": {
                    "application_primary_account_number": "5454545454545454",
                    "card_exp_month": "01",
                    "card_exp_year": "28",
                    "cryptogram": ""
                }
            }
        }
    }
}'

Response

{
    "payment_id": "pay_qy8KSDtXt9OoSeCdlLoa",
    "merchant_id": "merchant_1754566674",
    "status": "processing",
    "amount": 7445,
    "net_amount": 7445,
    "shipping_cost": null,
    "amount_capturable": 7445,
    "amount_received": null,
    "connector": "worldpayvantiv",
    "client_secret": "pay_qy8KSDtXt9OoSeCdlLoa_secret_81VlKhYLA8us868RDxPG",
    "created": "2025-08-08T07:14:57.290Z",
    "currency": "USD",
    "customer_id": "cu_1754637297",
    "customer": {
        "id": "cu_1754637297",
        "name": "Joseph Doe",
        "email": "something@gmail.com",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "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": "automatic",
    "payment_method": "wallet",
    "payment_method_data": {
        "wallet": {
            "google_pay": {
                "last4": "1000",
                "card_network": "MASTERCARd",
                "type": "CARD"
            }
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": null,
            "line3": null,
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe",
            "origin_zip": null
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": null,
    "email": "something@gmail.com",
    "name": "Joseph Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "three_ds",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "google_pay",
    "connector_label": "worldpayvantiv_US_default",
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "cu_1754637297",
        "created_at": 1754637297,
        "expires": 1754640897,
        "secret": "epk_a7a1a03427ac4315afcb6f847c9f179f"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "84085340646935892",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_qy8KSDtXt9OoSeCdlLoa_1",
    "payment_link": null,
    "profile_id": "pro_MiHsgjY1VrOKYtOyfZuV",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_xqwmWPRyq3PtFk5llZb1",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-08-08T07:29:57.290Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": "pm_okIlsI2U4cStk6zbYTFJ",
    "network_transaction_id": null,
    "payment_method_status": "inactive",
    "updated": "2025-08-08T07:15:00.211Z",
    "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": "5454540204265454",
    "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
}

Cybersource Gpay Flow
Request

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_tD9lty7koooHDy3ijR2CwW79p1vpqa2bIRzFAxJah36Jf32egCyCE8YmYE3xcJRQ' \
--data-raw '{
    "amount": 6500,
    
    "order_details": [
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": 6500
        }
    ],
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "authentication_type": "three_ds",
    "setup_future_usage": "on_session",
    "return_url": "https://duckduckgo.com/",
    "request_external_three_ds_authentication": false,
    "email": "user@gmail.com",
    "description": "Hello this is description",
    
    "shipping": {
        "address": {
            "state": "California",
            "city": "Banglore",
            "country": "US",
            "line1": "sdsdfsdf",
            "line2": "hsgdbhd",
            "line3": "alsksoe",
            "zip": "571201",
            "first_name": "John",
            "last_name": "Doe"
        },
        "phone": {
            "number": "123456789",
            "country_code": "+1"
        }
    },
    "connector_metadata": {
        "noon": {
            "order_category": "applepay"
        }
    },
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "payment_method": "wallet",
    "payment_method_type": "google_pay",
    "payment_method_data": {
        "wallet": {
            "google_pay": {
                "type": "CARD",
                "description": "SuccessfulAuth: Visa •••• 1000",
                "info": {
                    "assurance_details": {
                        "account_verified": true,
                        "card_holder_authenticated": false
                    },
                    "card_details": "1000",
                    "card_network": "VISA"
                },
                "tokenization_data": {
                    "token": "{\"signature\":\"\\\\u003d\\\"}\"}",
                    "type": "PAYMENT_GATEWAY"
                }
            }
        }
    },
    "connector": [
        "cybersource"
    ],
    "browser_info": {
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "language": "en-GB",
        "color_depth": 24,
        "screen_height": 967,
        "screen_width": 1496,
        "time_zone": -330,
        "java_enabled": true,
        "java_script_enabled": true,
        "device_model": "Macintosh",
        "os_type": "macOS",
        "os_version": "10.15.7"
    },
    "payment_type": "normal",
    "customer_id": "hyperswitch_sdk_demo_id"
}'

Response

{
    "payment_id": "pay_wAPR170kdZ7sKXDRPgbp",
    "merchant_id": "merchant_1754645629",
    "status": "succeeded",
    "amount": 6500,
    "net_amount": 6500,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 6500,
    "connector": "cybersource",
    "client_secret": "pay_wAPR170kdZ7sKXDRPgbp_secret_FW85m2TIHn3bUrbmsgFb",
    "created": "2025-08-08T09:39:49.412Z",
    "currency": "USD",
    "customer_id": "hyperswitch_sdk_demo_id",
    "customer": {
        "id": "hyperswitch_sdk_demo_id",
        "name": null,
        "email": "user@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "payment_method_data": {
        "wallet": {
            "google_pay": {
                "last4": "1000",
                "card_network": "VISA",
                "type": "CARD"
            }
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "Banglore",
            "country": "US",
            "line1": "sdsdfsdf",
            "line2": "hsgdbhd",
            "line3": "alsksoe",
            "zip": "571201",
            "state": "California",
            "first_name": "John",
            "last_name": "Doe",
            "origin_zip": null
        },
        "phone": {
            "number": "123456789",
            "country_code": "+1"
        },
        "email": null
    },
    "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": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": [
        {
            "sku": null,
            "upc": null,
            "brand": null,
            "amount": 6500,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "description": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "total_amount": null,
            "commodity_code": null,
            "unit_of_measure": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null,
            "unit_discount_amount": null
        }
    ],
    "email": "user@gmail.com",
    "name": null,
    "phone": null,
    "return_url": "https://duckduckgo.com/",
    "authentication_type": "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": "google_pay",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "hyperswitch_sdk_demo_id",
        "created_at": 1754645989,
        "expires": 1754649589,
        "secret": "epk_9a04877f4cd6405ca2c5e829b0be6b21"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7546459910616795204806",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": {
        "apple_pay": null,
        "airwallex": null,
        "noon": {
            "order_category": "applepay"
        },
        "braintree": null,
        "adyen": null
    },
    "feature_metadata": null,
    "reference_id": "pay_wAPR170kdZ7sKXDRPgbp_1",
    "payment_link": null,
    "profile_id": "pro_lASLph2JPwiOKRotieHp",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_sGhp7hsVeJDFexyhdxsZ",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-08-08T09:54:49.412Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": "macOS",
        "language": "en-GB",
        "time_zone": -330,
        "os_version": "10.15.7",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
        "color_depth": 24,
        "device_model": "Macintosh",
        "java_enabled": true,
        "screen_width": 1496,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 967,
        "java_script_enabled": true
    },
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-08-08T09:39:52.193Z",
    "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
}

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

@awasthi21 awasthi21 self-assigned this Aug 7, 2025
@awasthi21 awasthi21 requested review from a team as code owners August 7, 2025 08:32
@semanticdiff-com
Copy link

semanticdiff-com bot commented Aug 7, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/tests/connectors/worldpay.rs  90% smaller
  crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs  86% smaller
  crates/router/src/types/domain/payments.rs  85% smaller
  crates/router/tests/connectors/payu.rs  85% smaller
  crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs  66% smaller
  crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs  64% smaller
  crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs  62% smaller
  crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs  61% smaller
  crates/hyperswitch_connectors/src/connectors/noon/transformers.rs  58% smaller
  crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs  57% smaller
  crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs  55% smaller
  crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs  55% smaller
  crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs  55% smaller
  crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs  55% smaller
  crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs  55% smaller
  crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs  53% smaller
  crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs  50% smaller
  crates/common_enums/src/enums.rs  50% smaller
  crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs  46% smaller
  crates/hyperswitch_connectors/src/connectors/payu/transformers.rs  46% smaller
  crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs  44% smaller
  crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs  39% smaller
  crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs  33% smaller
  crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs  30% smaller
  crates/hyperswitch_domain_models/src/payment_method_data.rs  27% smaller
  crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs  25% smaller
  crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs  19% smaller
  crates/hyperswitch_connectors/src/utils.rs  18% smaller
  crates/api_models/src/payments.rs  16% smaller
  crates/router/src/core/payments.rs  14% smaller
  crates/openapi/src/openapi.rs  8% smaller
  crates/openapi/src/openapi_v2.rs  8% smaller
  crates/common_types/src/payments.rs  3% smaller
  crates/hyperswitch_domain_models/src/router_data.rs  2% smaller
  api-reference/v1/openapi_spec_v1.json  0% smaller
  api-reference/v2/openapi_spec_v2.json  0% smaller
  config/deployments/production.toml Unsupported file format
  config/deployments/sandbox.toml Unsupported file format
  config/development.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/router/src/connector/utils.rs  0% smaller
  crates/router/src/core/payments/helpers.rs  0% smaller
  crates/router/src/types.rs  0% smaller

@awasthi21 awasthi21 force-pushed the gpay_decrypted branch 5 times, most recently from 3e32aef to 76dd309 Compare August 7, 2025 16:33
deepanshu-iiitu
deepanshu-iiitu previously approved these changes Aug 8, 2025
Sakilmostak
Sakilmostak previously approved these changes Aug 8, 2025
Copy link
Contributor

@Sakilmostak Sakilmostak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Need extensive sanity testing given the scope

@awasthi21 awasthi21 dismissed stale reviews from Sakilmostak and deepanshu-iiitu via 67a0a60 August 8, 2025 06:58
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Aug 8, 2025
Comment on lines +538 to +546
pub fn get_expiry_month(&self) -> Result<Secret<String>, errors::ValidationError> {
let month_str = self.card_exp_month.peek();
let month = month_str
.parse::<u8>()
.map_err(|_| errors::ValidationError::InvalidValue {
message: format!("Failed to parse expiry month: {month_str}"),
})?;

if !(1..=12).contains(&month) {
return Err(errors::ValidationError::InvalidValue {
message: format!("Invalid expiry month: {month}. Must be between 1 and 12"),
}
.into());
}
Ok(self.card_exp_month.clone())
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add similar logic to get_expiry_month of ApplePayPredecryptData ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the same logic for ApplePayPredecryptData

@hyperswitch-bot hyperswitch-bot bot added M-api-contract-changes Metadata: This PR involves API contract changes and removed M-api-contract-changes Metadata: This PR involves API contract changes labels Aug 8, 2025
@hyperswitch-bot hyperswitch-bot bot removed the M-api-contract-changes Metadata: This PR involves API contract changes label Aug 8, 2025
deepanshu-iiitu
deepanshu-iiitu previously approved these changes Aug 8, 2025
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Aug 8, 2025
@likhinbopanna likhinbopanna enabled auto-merge August 8, 2025 10:31
@likhinbopanna likhinbopanna added this pull request to the merge queue Aug 8, 2025
Merged via the queue into main with commit b7f42cb Aug 8, 2025
18 of 22 checks passed
@likhinbopanna likhinbopanna deleted the gpay_decrypted branch August 8, 2025 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

M-api-contract-changes Metadata: This PR involves API contract changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants