feat(connector): [Redsys] Use merchant payment_id for ds_merchant_order with length check#8485
Merged
Gnanasundari24 merged 18 commits intomainfrom Jul 3, 2025
Merged
feat(connector): [Redsys] Use merchant payment_id for ds_merchant_order with length check#8485Gnanasundari24 merged 18 commits intomainfrom
Gnanasundari24 merged 18 commits intomainfrom
Conversation
kashif-m
reviewed
Jun 28, 2025
crates/router/src/routes/payments.rs
Outdated
Comment on lines
+2274
to
+2278
| payload.is_payment_id_from_merchant = matches!( | ||
| &payload.payment_id, | ||
| Some(payment_types::PaymentIdType::PaymentIntentId(_)) | ||
| ); | ||
|
|
Contributor
There was a problem hiding this comment.
NIT: this can be set just before setting payload.payment_id
Contributor
Author
There was a problem hiding this comment.
This is now set just before assigning payload.payment_id
2 tasks
kashif-m
previously approved these changes
Jun 30, 2025
jagan-jaya
previously approved these changes
Jun 30, 2025
kashif-m
reviewed
Jul 3, 2025
migrations/2025-07-01-073253_add_connector_request_reference_id_in_payment_attempt/down.sql
Show resolved
Hide resolved
kashif-m
previously approved these changes
Jul 3, 2025
ThisIsMani
previously approved these changes
Jul 3, 2025
jagan-jaya
previously approved these changes
Jul 3, 2025
sai-harsha-vardhan
previously approved these changes
Jul 3, 2025
deepanshu-iiitu
previously approved these changes
Jul 3, 2025
d52b877
ThisIsMani
approved these changes
Jul 3, 2025
deepanshu-iiitu
approved these changes
Jul 3, 2025
kashif-m
approved these changes
Jul 3, 2025
jagan-jaya
approved these changes
Jul 3, 2025
sai-harsha-vardhan
approved these changes
Jul 3, 2025
Saptak88
added a commit
that referenced
this pull request
Jul 4, 2025
…er with length check (#8485) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Closed
14 tasks
Saptak88
added a commit
that referenced
this pull request
Jul 4, 2025
…er with length check (#8485) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Merged
14 tasks
Saptak88
added a commit
that referenced
this pull request
Jul 8, 2025
…er with length check (#8485) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
14 tasks
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
Additional Changes
Motivation and Context
Redsys requires the payment_id (ds_merchant_order) to be no longer than 12 characters.
Currently, Hyperswitch generates a random payment_id internally, which gets passed to Redsys.
This PR does the following:
Uses merchant provided payment_id if present: Instead of generating a random ID, it will now use the payment_id sent by the merchant if is_config_enabled_to_send_payment_id_as_connector_request_id is true.
Validation: If the merchant-provided payment_id exceeds 12 characters, a 4xx error is returned.
If the merchant does not provide a payment_id, it will generate one that conforms to Redsys constraints (max 12 characters).
A new field is_payment_id_from_merchant is introduced in the payment_intent table and RouterData. It indicates whether the payment_id was provided by the merchant (true) or generated internally by Hyperswitch (false).
A new field connector_request_reference_id is introduced in the payment_attempt table.
How did you test it?
Redsys Connector Create
{ "connector_type": "payment_processor", "connector_name": "redsys", "business_country": "US", "business_label": "default", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "**********************", "key1": "****", "api_secret": "***********" }, "test_mode": false, "disabled": false, "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "debit", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "apple_pay", "payment_experience": "invoke_sdk_client", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "google_pay", "payment_experience": "invoke_sdk_client", "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ] }Response
{ "connector_type": "payment_processor", "connector_name": "redsys", "connector_label": "redsys_US_default", "merchant_connector_id": "mca_ORJf5rnLEcFeI3o7Fxiw", "profile_id": "pro_Pg2QIEEzbZewBtns4HzP", "connector_account_details": { "auth_type": "SignatureKey", "api_key": "3*******1", "key1": "***", "api_secret": "s******************************7" }, "payment_methods_enabled": [ { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "credit", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "card", "payment_method_types": [ { "payment_method_type": "debit", "payment_experience": null, "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "apple_pay", "payment_experience": "invoke_sdk_client", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] }, { "payment_method": "wallet", "payment_method_types": [ { "payment_method_type": "google_pay", "payment_experience": "invoke_sdk_client", "card_networks": null, "accepted_currencies": null, "accepted_countries": null, "minimum_amount": 1, "maximum_amount": 68607706, "recurring_enabled": true, "installment_payment_enabled": true } ] } ], "connector_webhook_details": null, "metadata": null, "test_mode": false, "disabled": false, "frm_configs": null, "business_country": "US", "business_label": "default", "business_sub_label": null, "applepay_verified_domains": null, "pm_auth_config": null, "status": "active", "additional_merchant_data": null, "connector_wallets_details": null }Payment Create without passing payment_id
{ "amount": 10, "currency": "EUR", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "First_Customer", "name": "John Doe", "confirm": true, "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4548814479727229", "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "authentication_type": "three_ds", "return_url": "https://google.com", "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } , "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "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": "Ceuta", "zip": "94122", "country": "ES", "first_name": "John", "last_name": "Doe" } }, "setup_future_usage":"on_session" }Response
{ "payment_id": "pay_17nevdGKbQmhtYU3Ecx0", "merchant_id": "merchant_1751452129", "status": "succeeded", "amount": 10, "net_amount": 10, "shipping_cost": null, "amount_capturable": 0, "amount_received": 10, "connector": "redsys", "client_secret": "pay_17nevdGKbQmhtYU3Ecx0_secret_UBBzpAVIuo9QJ6wcfGLa", "created": "2025-07-02T10:30:52.589Z", "currency": "EUR", "customer_id": "First_Customer", "customer": { "id": "First_Customer", "name": "John Doe", "email": null, "phone": null, "phone_country_code": null }, "description": null, "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": "card", "payment_method_data": { "card": { "last4": "7229", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "454881", "card_extended_bin": null, "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": "token_aEceGVQiuQALUkhR0WpU", "shipping": { "address": { "city": "San Fransico", "country": "ES", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "Ceuta", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "ES", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "Ceuta", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": null, "name": "John Doe", "phone": null, "return_url": "https://google.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": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "First_Customer", "created_at": 1751452252, "expires": 1751455852, "secret": "epk_20aadf0c4f9240e18ffc20d13d46e896" }, "manual_retry_allowed": false, "connector_transaction_id": "656153631970", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "656153631970", "payment_link": null, "profile_id": "pro_Pg2QIEEzbZewBtns4HzP", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_ORJf5rnLEcFeI3o7Fxiw", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-07-02T10:45:52.588Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 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,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-07-02T10:30:55.133Z", "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": "manual", "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 }Payment Create by passing payment_id with 12 characters
{ "amount": 10, "currency": "EUR", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "First_Customer", "payment_id": "777123456712" , "name": "John Doe", "confirm": true, "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4548814479727229", "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "authentication_type": "three_ds", "return_url": "https://google.com", "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } , "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "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": "Ceuta", "zip": "94122", "country": "ES", "first_name": "John", "last_name": "Doe" } }, "setup_future_usage":"on_session" }Response
{ "payment_id": "777123456712", "merchant_id": "merchant_1751452129", "status": "succeeded", "amount": 10, "net_amount": 10, "shipping_cost": null, "amount_capturable": 0, "amount_received": 10, "connector": "redsys", "client_secret": "777123456712_secret_PpTcAh299S5LBU8hAA7h", "created": "2025-07-02T10:32:42.984Z", "currency": "EUR", "customer_id": "First_Customer", "customer": { "id": "First_Customer", "name": "John Doe", "email": null, "phone": null, "phone_country_code": null }, "description": null, "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": "card", "payment_method_data": { "card": { "last4": "7229", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "454881", "card_extended_bin": null, "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": "token_YTFQhiBGwJ7QMnGVq7UQ", "shipping": { "address": { "city": "San Fransico", "country": "ES", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "Ceuta", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "ES", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "Ceuta", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": null, "name": "John Doe", "phone": null, "return_url": "https://google.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": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "First_Customer", "created_at": 1751452362, "expires": 1751455962, "secret": "epk_ecd021e84b2d4cdabdd66d07f7d49bbd" }, "manual_retry_allowed": false, "connector_transaction_id": "777123456712", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "777123456712", "payment_link": null, "profile_id": "pro_Pg2QIEEzbZewBtns4HzP", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_ORJf5rnLEcFeI3o7Fxiw", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-07-02T10:47:42.984Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 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,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-07-02T10:32:45.666Z", "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": "manual", "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 }Payment Create by passing payment_id with more than 12 characters
{ "amount": 10, "currency": "EUR", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "First_Customer", "payment_id": "77712345671233" , "name": "John Doe", "confirm": true, "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4548814479727229", "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "authentication_type": "three_ds", "return_url": "https://google.com", "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } , "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "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": "Ceuta", "zip": "94122", "country": "ES", "first_name": "John", "last_name": "Doe" } }, "setup_future_usage":"on_session" }Response
{ "error": { "type": "invalid_request", "message": "Connector 'Redsys' rejected field 'ds_merchant_order': length 14 exceeds maximum of 12", "code": "IR_47", "connector": "Redsys" } }Payment Update with payment_id from merchant
Payment create request
{ "amount": 10, "currency": "EUR", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "First_Customer", "payment_id": "777123456" , "name": "John Doe", // "confirm": true, // "payment_method": "card", // "payment_method_type": "credit", // "payment_method_data": { // "card": { // "card_number": "4548814479727229", // "card_exp_month": "12", // "card_exp_year": "25", // "card_holder_name": "joseph Doe", // "card_cvc": "124" // } // }, "authentication_type": "three_ds", "return_url": "https://google.com", "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } , "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "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": "Ceuta", "zip": "94122", "country": "ES", "first_name": "John", "last_name": "Doe" } }, "setup_future_usage":"on_session" }Payment create Response
{ "payment_id": "777123456", "merchant_id": "merchant_1751452129", "status": "requires_payment_method", "amount": 10, "net_amount": 10, "shipping_cost": null, "amount_capturable": 10, "amount_received": null, "connector": null, "client_secret": "777123456_secret_Q1a4FhoD0V89IjisTkVJ", "created": "2025-07-02T10:35:25.045Z", "currency": "EUR", "customer_id": "First_Customer", "customer": { "id": "First_Customer", "name": "John Doe", "email": null, "phone": null, "phone_country_code": null }, "description": null, "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": null, "payment_method_data": null, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "ES", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "Ceuta", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "ES", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "Ceuta", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": null, "name": "John Doe", "phone": null, "return_url": "https://google.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": null, "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "First_Customer", "created_at": 1751452525, "expires": 1751456125, "secret": "epk_d4bec8814d3a435aa48f647bef687da7" }, "manual_retry_allowed": null, "connector_transaction_id": null, "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_Pg2QIEEzbZewBtns4HzP", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": null, "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-07-02T10:50:25.045Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 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,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-07-02T10:35:25.073Z", "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 }Payment Update request
{ "amount": 10, "currency": "EUR", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "First_Customer", "name": "John Doe", "authentication_type": "three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4548814479727229", "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } , "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "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": "Ceuta", "zip": "94122", "country": "ES", "first_name": "John", "last_name": "Doe" } }, "setup_future_usage":"on_session" }Payment Update Response
{ "payment_id": "777123456", "merchant_id": "merchant_1751452129", "status": "succeeded", "amount": 10, "net_amount": 10, "shipping_cost": null, "amount_capturable": 0, "amount_received": 10, "connector": "redsys", "client_secret": "777123456_secret_Q1a4FhoD0V89IjisTkVJ", "created": "2025-07-02T10:35:25.045Z", "currency": "EUR", "customer_id": "First_Customer", "customer": { "id": "First_Customer", "name": "John Doe", "email": null, "phone": null, "phone_country_code": null }, "description": null, "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": "card", "payment_method_data": { "card": { "last4": "7229", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "454881", "card_extended_bin": null, "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": "token_i0yM6VGkpHLxYDtFHN9Z", "shipping": { "address": { "city": "San Fransico", "country": "ES", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "Ceuta", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "ES", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "Ceuta", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": null, "name": "John Doe", "phone": null, "return_url": "https://google.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": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "777123456", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "777123456", "payment_link": null, "profile_id": "pro_Pg2QIEEzbZewBtns4HzP", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_ORJf5rnLEcFeI3o7Fxiw", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-07-02T10:50:25.045Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 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,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-07-02T10:36:32.646Z", "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": "manual", "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 }Payment Confirm with payment_id from merchant
Payment create request
{ "amount": 10, "currency": "EUR", "payment_id": "1234567892", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "First_Customer", "name": "John Doe", "authentication_type": "three_ds", "return_url": "https://google.com", "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } , "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "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": "Ceuta", "zip": "94122", "country": "ES", "first_name": "John", "last_name": "Doe" } }, "setup_future_usage":"on_session" }Payment create Response
{ "payment_id": "1234567892", "merchant_id": "merchant_1751036107", "status": "requires_payment_method", "amount": 10, "net_amount": 10, "shipping_cost": null, "amount_capturable": 10, "amount_received": null, "connector": null, "client_secret": "1234567892_secret_sfp8EvQSs23ilg7kcEYs", "created": "2025-06-27T18:55:55.126Z", "currency": "EUR", "customer_id": "First_Customer", "customer": { "id": "First_Customer", "name": "John Doe", "email": null, "phone": null, "phone_country_code": null }, "description": null, "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": null, "payment_method_data": null, "payment_token": null, "shipping": { "address": { "city": "San Fransico", "country": "ES", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "Ceuta", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "ES", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "Ceuta", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": null, "name": "John Doe", "phone": null, "return_url": "https://google.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": null, "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": { "customer_id": "First_Customer", "created_at": 1751050555, "expires": 1751054155, "secret": "epk_d90edd41dd8c47cb9067fc9cbf42c597" }, "manual_retry_allowed": null, "connector_transaction_id": null, "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_tWAYQMPpvJPRI8CbB959", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": null, "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-06-27T19:10:55.126Z", "fingerprint": null, "browser_info": { "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 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,image/apng,*/*;q=0.8", "screen_height": 723, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-06-27T18:55:55.174Z", "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 }Payment Confirm Request
{ "amount": 10, "currency": "EUR", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "First_Customer", "name": "John Doe", "authentication_type": "three_ds", "return_url": "https://google.com", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4548814479727229", "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "124" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "13.232.74.226" } , "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "Ceuta", "zip": "94122", "country": "ES", "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": "Ceuta", "zip": "94122", "country": "ES", "first_name": "John", "last_name": "Doe" } }, "setup_future_usage":"on_session" }Payment Confirm Response
{ "payment_id": "1234567892", "merchant_id": "merchant_1751036107", "status": "succeeded", "amount": 10, "net_amount": 10, "shipping_cost": null, "amount_capturable": 0, "amount_received": 10, "connector": "redsys", "client_secret": "1234567892_secret_sfp8EvQSs23ilg7kcEYs", "created": "2025-06-27T18:55:55.126Z", "currency": "EUR", "customer_id": "First_Customer", "customer": { "id": "First_Customer", "name": "John Doe", "email": null, "phone": null, "phone_country_code": null }, "description": null, "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": "card", "payment_method_data": { "card": { "last4": "7229", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "454881", "card_extended_bin": null, "card_exp_month": "12", "card_exp_year": "25", "card_holder_name": "joseph Doe", "payment_checks": null, "authentication_data": null }, "billing": null }, "payment_token": "token_Vz4dZyJWpwLNGkgHlu2v", "shipping": { "address": { "city": "San Fransico", "country": "ES", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "Ceuta", "first_name": "John", "last_name": "Doe" }, "phone": null, "email": null }, "billing": { "address": { "city": "San Fransico", "country": "ES", "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "zip": "94122", "state": "Ceuta", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": null }, "order_details": null, "email": null, "name": "John Doe", "phone": null, "return_url": "https://google.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": "credit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "1234567892", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": "1234567892", "payment_link": null, "profile_id": "pro_tWAYQMPpvJPRI8CbB959", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_zBfGoDuXmZOYXg7cDPPC", "incremental_authorization_allowed": null, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2025-06-27T19:10:55.126Z", "fingerprint": null, "browser_info": { "os_type": null, "language": "nl-NL", "time_zone": 0, "ip_address": "13.232.74.226", "os_version": null, "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "color_depth": 24, "device_model": null, "java_enabled": true, "screen_width": 1536, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 723, "accept_language": "en", "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2025-06-27T18:56:04.524Z", "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": "manual", "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 }cypress tests for redsys

Checklist
cargo +nightly fmt --allcargo clippy