Skip to content

Conversation

kashif-m
Copy link
Contributor

@kashif-m kashif-m commented Jul 18, 2025

Type of Change

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

Description

Fixes Worldpay refused payment responses not populating error codes and messages.

Changes in this PR

  • Reorder WorldpayPaymentResponseFields enum variants to prioritize RefusedResponse over AuthorizedResponse

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Fixes enum deserialization issue where refused responses were incorrectly matched as AuthorizedResponse due to variant ordering, causing refusalCode and refusalDescription fields to be silently ignored.

How did you test it?

Things to be verified

  • Failed transactions
  • Successfull transactions
  • Across 3DS and Non3DS payments

Acceptance criteria

  • Failed transactions should ALWAYS have error code and error message
  • Existing behavior should not be impacted
1. Create a refused 3DS payment

cURL

curl --location --request POST 'http://localhost:8080/payments' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'api-key: dev_OcigA2cQZxBX9COYGBfHgAWOZUukSoY32EnWQfuFtRPpW5lmWhJSsxtQxmvFOr3K' \
    --data-raw '{"amount":4500,"currency":"EUR","confirm":true,"profile_id":"pro_lIwQy04ZJdIxAZHNj6cf","capture_method":"automatic","authentication_type":"three_ds","setup_future_usage":"off_session","customer_id":"cus_HMf1El4VyvUOTQcyPabO","email":"[email protected]","return_url":"https://google.com","payment_method":"card","payment_method_data":{"card":{"card_number":"4000000000002503","card_exp_month":"12","card_exp_year":"49","card_holder_name":"SOFT_DECLINED","card_cvc":"123"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","zip":"94122","country":"SG","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.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-US","color_depth":32,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true,"ip_address":"127.0.0.1"},"customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"session_expiry":60}'

Response

{"payment_id":"pay_nf1wozrQrzByP9V4yeoD","merchant_id":"merchant_1752829595","status":"requires_customer_action","amount":4500,"net_amount":4500,"shipping_cost":null,"amount_capturable":4500,"amount_received":null,"connector":"worldpay","client_secret":"pay_nf1wozrQrzByP9V4yeoD_secret_oPWhpyOQDgJxMryKsRGw","created":"2025-07-18T09:23:30.740Z","currency":"EUR","customer_id":"cus_HMf1El4VyvUOTQcyPabO","customer":{"id":"cus_HMf1El4VyvUOTQcyPabO","name":"John Nether","email":"[email protected]","phone":"6168205362","phone_country_code":"+1"},"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":"2503","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"400000","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"49","card_holder_name":"SOFT_DECLINED","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"SG","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":null,"first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":"John Nether","phone":"6168205362","return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":{"type":"redirect_to_url","redirect_to_url":"http://localhost:8080/payments/redirect/pay_nf1wozrQrzByP9V4yeoD/merchant_1752829595/pay_nf1wozrQrzByP9V4yeoD_1"},"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":"cus_HMf1El4VyvUOTQcyPabO","created_at":1752830610,"expires":1752834210,"secret":"epk_94ed61cae43c47cfa3812753e04b645a"},"manual_retry_allowed":null,"connector_transaction_id":"eyJrIjoxLCJkIjoiNWwwQkpkeFd4UXA2dUw0b2dHRWlaVzlUUzh0aEhIL0F2WVFJN2ROYnZWNGl3V1R3UXYwb0tLYTdJQm1hY3hQdiJ9_2","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"06ecb837-d1ff-4baa-b608-18d2e56074f0","payment_link":null,"profile_id":"pro_lIwQy04ZJdIxAZHNj6cf","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_21oWs6dvHalGcN2EkEzx","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-18T09:24:30.740Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"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_method_id":null,"payment_method_status":null,"updated":"2025-07-18T09:23:32.148Z","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}

Open and complete the payment
Fetch payment

cURL

curl --location --request GET 'http://localhost:8080/payments/pay_nf1wozrQrzByP9V4yeoD?force_sync=true' \
    --header 'Accept: application/json' \
    --header 'api-key: dev_OcigA2cQZxBX9COYGBfHgAWOZUukSoY32EnWQfuFtRPpW5lmWhJSsxtQxmvFOr3K'

Response

{"payment_id":"pay_nf1wozrQrzByP9V4yeoD","merchant_id":"merchant_1752829595","status":"failed","amount":4500,"net_amount":4500,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpay","client_secret":"pay_nf1wozrQrzByP9V4yeoD_secret_oPWhpyOQDgJxMryKsRGw","created":"2025-07-18T09:23:30.740Z","currency":"EUR","customer_id":"cus_HMf1El4VyvUOTQcyPabO","customer":{"id":"cus_HMf1El4VyvUOTQcyPabO","name":"John Nether","email":"[email protected]","phone":"6168205362","phone_country_code":"+1"},"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":"2503","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"400000","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"49","card_holder_name":"SOFT_DECLINED","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"SG","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":null,"first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":"John Nether","phone":"6168205362","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":"65","error_message":"Authentication requested","unified_code":"UE_9000","unified_message":"Something went wrong","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":null,"manual_retry_allowed":true,"connector_transaction_id":"5d0040f1-bb19-4ac5-8baa-9f083ce53cb0","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"62043e75-b414-4d8e-aa4d-5970a990152b","payment_link":null,"profile_id":"pro_lIwQy04ZJdIxAZHNj6cf","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_21oWs6dvHalGcN2EkEzx","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-18T09:24:30.740Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"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_method_id":"pm_us4PtNRsIDqN5ABOVj7J","payment_method_status":"inactive","updated":"2025-07-18T09:24:31.424Z","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":"65","issuer_error_message":"Authentication requested","is_iframe_redirection_enabled":null,"whole_connector_response":null}
2. Create a refused Non3DS payment

cURL

curl --location --request POST 'http://localhost:8080/payments' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'api-key: dev_OcigA2cQZxBX9COYGBfHgAWOZUukSoY32EnWQfuFtRPpW5lmWhJSsxtQxmvFOr3K' \
    --data-raw '{"amount":4500,"currency":"EUR","confirm":true,"profile_id":"pro_lIwQy04ZJdIxAZHNj6cf","capture_method":"automatic","authentication_type":"no_three_ds","setup_future_usage":"off_session","customer_id":"cus_HMf1El4VyvUOTQcyPabO","email":"[email protected]","return_url":"https://google.com","payment_method":"card","payment_method_data":{"card":{"card_number":"4000000000002503","card_exp_month":"12","card_exp_year":"49","card_holder_name":"SOFT_DECLINED","card_cvc":"123"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","zip":"94122","country":"SG","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.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-US","color_depth":32,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true,"ip_address":"127.0.0.1"},"customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"session_expiry":60}'

Response

{"payment_id":"pay_7xBftAitD04sY2GZJ8Z2","merchant_id":"merchant_1752829595","status":"failed","amount":4500,"net_amount":4500,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpay","client_secret":"pay_7xBftAitD04sY2GZJ8Z2_secret_hKtavE5ciTrVajUHJjZc","created":"2025-07-18T09:25:11.617Z","currency":"EUR","customer_id":"cus_HMf1El4VyvUOTQcyPabO","customer":{"id":"cus_HMf1El4VyvUOTQcyPabO","name":"John Nether","email":"[email protected]","phone":"6168205362","phone_country_code":"+1"},"description":null,"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":"card","payment_method_data":{"card":{"last4":"2503","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"400000","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"49","card_holder_name":"SOFT_DECLINED","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"SG","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":null,"first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":"John Nether","phone":"6168205362","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":"65","error_message":"Authentication requested","unified_code":"UE_9000","unified_message":"Something went wrong","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":"cus_HMf1El4VyvUOTQcyPabO","created_at":1752830711,"expires":1752834311,"secret":"epk_89925864b5a44ace803a9c3bfd9d3a5a"},"manual_retry_allowed":true,"connector_transaction_id":"6ec4e6b4-b2cc-4816-b8de-d682c3799560","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_lIwQy04ZJdIxAZHNj6cf","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_21oWs6dvHalGcN2EkEzx","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-18T09:26:11.617Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"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_method_id":null,"payment_method_status":null,"updated":"2025-07-18T09:25:12.302Z","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":"65","issuer_error_message":"Authentication requested","is_iframe_redirection_enabled":null,"whole_connector_response":null}
3. Create a successful Non3DS payment

cURL

curl --location --request POST 'http://localhost:8080/payments' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'api-key: dev_OcigA2cQZxBX9COYGBfHgAWOZUukSoY32EnWQfuFtRPpW5lmWhJSsxtQxmvFOr3K' \
    --data-raw '{"amount":4500,"currency":"EUR","confirm":true,"profile_id":"pro_lIwQy04ZJdIxAZHNj6cf","capture_method":"automatic","authentication_type":"no_three_ds","setup_future_usage":"off_session","customer_id":"cus_HMf1El4VyvUOTQcyPabO","email":"[email protected]","return_url":"https://google.com","payment_method":"card","payment_method_data":{"card":{"card_number":"4000000000002503","card_exp_month":"12","card_exp_year":"49","card_cvc":"123"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","zip":"94122","country":"SG","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.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-US","color_depth":32,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true,"ip_address":"127.0.0.1"},"customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"session_expiry":60}'

Response

{"payment_id":"pay_fvSgG7vbmiancVdM7egW","merchant_id":"merchant_1752829595","status":"succeeded","amount":4500,"net_amount":4500,"shipping_cost":null,"amount_capturable":0,"amount_received":4500,"connector":"worldpay","client_secret":"pay_fvSgG7vbmiancVdM7egW_secret_Tf1f2y1DQin8y7nQHp7y","created":"2025-07-18T09:27:05.084Z","currency":"EUR","customer_id":"cus_HMf1El4VyvUOTQcyPabO","customer":{"id":"cus_HMf1El4VyvUOTQcyPabO","name":"John Nether","email":"[email protected]","phone":"6168205362","phone_country_code":"+1"},"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":"2503","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"400000","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"49","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"SG","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":null,"first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":"John Nether","phone":"6168205362","return_url":"https://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":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_HMf1El4VyvUOTQcyPabO","created_at":1752830825,"expires":1752834425,"secret":"epk_cb4c1f4042ab432fa0cc74d74ad1bf7f"},"manual_retry_allowed":false,"connector_transaction_id":"eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNi4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99HBj426bdlJXCgTskLhNY5Ml0rXtEPNSyl2cbsnj4b2DZwiqL3HuQDxN:neVn+zbpclW4Z+fnZKMutoUGX3m1:mly6gHHs10vDfRKiqHMymO64+yqY47+sAF1kkNrL23Bs3QiAabaRzXyjYDjJ+U38V81VQ0:KjdVX14V+Q12mM8Z5iKyQs9iW3YxEeAqFJXOYrW66yFNGsWi87tzkRENLR8ix3NBfHPU2KlzlyTrmR0mwasA4zRNlfY:bG7Aaa:GaUgn8jvCNhmdUlN6uDEfAu3+Gpx8cadeYO0VLI6Wl9IlMW1jd8Xy+vVmj3Q+75eENcq03E2danxlr+Vv+81CEF","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"0d52ed33-52a5-4180-a8c0-a594dfce4250","payment_link":null,"profile_id":"pro_lIwQy04ZJdIxAZHNj6cf","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_21oWs6dvHalGcN2EkEzx","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-18T09:28:05.084Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"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_method_id":null,"payment_method_status":null,"updated":"2025-07-18T09:27:07.450Z","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}
4. Create a successful 3DS payment

cURL

curl --location --request POST 'http://localhost:8080/payments' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'api-key: dev_OcigA2cQZxBX9COYGBfHgAWOZUukSoY32EnWQfuFtRPpW5lmWhJSsxtQxmvFOr3K' \
    --data-raw '{"amount":4500,"currency":"EUR","confirm":true,"profile_id":"pro_lIwQy04ZJdIxAZHNj6cf","capture_method":"automatic","authentication_type":"three_ds","setup_future_usage":"off_session","customer_id":"cus_HMf1El4VyvUOTQcyPabO","email":"[email protected]","return_url":"https://google.com","payment_method":"card","payment_method_data":{"card":{"card_number":"4000000000002503","card_exp_month":"12","card_exp_year":"49","card_cvc":"123"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","zip":"94122","country":"SG","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.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-US","color_depth":32,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true,"ip_address":"127.0.0.1"},"customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"session_expiry":60}'

Response

{"payment_id":"pay_B0btcvBLNpPhJ1s7NEGc","merchant_id":"merchant_1752829595","status":"requires_customer_action","amount":4500,"net_amount":4500,"shipping_cost":null,"amount_capturable":4500,"amount_received":null,"connector":"worldpay","client_secret":"pay_B0btcvBLNpPhJ1s7NEGc_secret_FoMuFj3e5H5vxBtXLOJ6","created":"2025-07-18T09:27:55.106Z","currency":"EUR","customer_id":"cus_HMf1El4VyvUOTQcyPabO","customer":{"id":"cus_HMf1El4VyvUOTQcyPabO","name":"John Nether","email":"[email protected]","phone":"6168205362","phone_country_code":"+1"},"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":"2503","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"400000","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"49","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"SG","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":null,"first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":"John Nether","phone":"6168205362","return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":{"type":"redirect_to_url","redirect_to_url":"http://localhost:8080/payments/redirect/pay_B0btcvBLNpPhJ1s7NEGc/merchant_1752829595/pay_B0btcvBLNpPhJ1s7NEGc_1"},"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":"cus_HMf1El4VyvUOTQcyPabO","created_at":1752830875,"expires":1752834475,"secret":"epk_0ca1d0b0a4324a30b287522647a4e1e7"},"manual_retry_allowed":null,"connector_transaction_id":"eyJrIjoxLCJkIjoiMjVnYzlzNUVaWU94M1hPaFYvbXUwT21hRmZjMFNmZWQvR0pnRGxaWU5vc2l3V1R3UXYwb0tLYTdJQm1hY3hQdiJ9_2","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"187b8a5d-10e8-4711-8f61-321d497174c5","payment_link":null,"profile_id":"pro_lIwQy04ZJdIxAZHNj6cf","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_21oWs6dvHalGcN2EkEzx","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-18T09:28:55.106Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"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_method_id":null,"payment_method_status":null,"updated":"2025-07-18T09:27:55.619Z","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}

Open and complete payment
Fetch payment

cURL

curl --location --request GET 'http://localhost:8080/payments/pay_B0btcvBLNpPhJ1s7NEGc?force_sync=true' \
    --header 'Accept: application/json' \
    --header 'api-key: dev_OcigA2cQZxBX9COYGBfHgAWOZUukSoY32EnWQfuFtRPpW5lmWhJSsxtQxmvFOr3K'

Response

{"payment_id":"pay_B0btcvBLNpPhJ1s7NEGc","merchant_id":"merchant_1752829595","status":"succeeded","amount":4500,"net_amount":4500,"shipping_cost":null,"amount_capturable":0,"amount_received":4500,"connector":"worldpay","client_secret":"pay_B0btcvBLNpPhJ1s7NEGc_secret_FoMuFj3e5H5vxBtXLOJ6","created":"2025-07-18T09:27:55.106Z","currency":"EUR","customer_id":"cus_HMf1El4VyvUOTQcyPabO","customer":{"id":"cus_HMf1El4VyvUOTQcyPabO","name":"John Nether","email":"[email protected]","phone":"6168205362","phone_country_code":"+1"},"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":"2503","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"400000","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"49","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"SG","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":null,"first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":"John Nether","phone":"6168205362","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":null,"manual_retry_allowed":false,"connector_transaction_id":"3749d357-0130-498e-8c74-6a8e2069fa55","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"3749d357-0130-498e-8c74-6a8e2069fa55","payment_link":null,"profile_id":"pro_lIwQy04ZJdIxAZHNj6cf","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_21oWs6dvHalGcN2EkEzx","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-18T09:28:55.106Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"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_method_id":"pm_fu8PQqH8zNwUxq5cyixG","payment_method_status":"active","updated":"2025-07-18T09:28:08.906Z","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}

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

@kashif-m kashif-m self-assigned this Jul 18, 2025
@kashif-m kashif-m requested a review from a team as a code owner July 18, 2025 09:30
Copy link

semanticdiff-com bot commented Jul 18, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/worldpay/response.rs  0% smaller

@kashif-m kashif-m changed the title fix:(connector): [Access Worldpay] correct enum deserialization for payment responses fix:(connector): correct enum deserialization for payment responses for access worldpay Jul 18, 2025
@kashif-m kashif-m changed the title fix:(connector): correct enum deserialization for payment responses for access worldpay fix(connector): correct enum deserialization for payment responses for access worldpay Jul 18, 2025
@kashif-m kashif-m changed the title fix(connector): correct enum deserialization for payment responses for access worldpay fix(connector): [Access Worldpay] correct enum deserialization for payment responses for Jul 18, 2025
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Jul 21, 2025
Merged via the queue into main with commit 58f8429 Jul 21, 2025
17 of 23 checks passed
@Gnanasundari24 Gnanasundari24 deleted the 8687-bug-refused-payment-responses-missing-error-codes-and-messages-for-access-worldpay branch July 21, 2025 07:20
pixincreate added a commit that referenced this pull request Jul 22, 2025
…ordea-sepa

* 'main' of github.com:juspay/hyperswitch:
  refactor(connector): [Adyen] map ssn and session validity for Pix (#8702)
  feat(core): Implement UCS kill switch for emergency fallback (#8651)
  fix(openapi): Added Error Response Schema for Status Code 400 (#8684)
  feat(connector): Add template code for breadpay (#8655)
  chore(version): 2025.07.21.1
  refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template (#8681)
  fix(router): Make v2 endpoints follow standard naming conventions (#8630)
  fix(connector): [Cybersource] Add type_selection_indicator as 1 for all cards  (#8663)
  feat(routing): Add API key auth for decision engine endpoints (#8640)
  feat(authentication): Added eligibility flow for modular authentication (#8431)
  feat(connector): [BLACKHAWKNETWORK] Add Template Code  (#8632)
  fix: remove straight through routing from routing approach (#8695)
  fix(connector): [Access Worldpay] correct enum deserialization for payment responses for (#8689)
  chore(version): 2025.07.21.0
pixincreate added a commit that referenced this pull request Jul 22, 2025
…ayload-recurring

* 'main' of github.com:juspay/hyperswitch: (48 commits)
  fix(connector): Add Trustpay in Authentication Providers Config (#8622)
  refactor(connector): [Adyen] map ssn and session validity for Pix (#8702)
  feat(core): Implement UCS kill switch for emergency fallback (#8651)
  fix(openapi): Added Error Response Schema for Status Code 400 (#8684)
  feat(connector): Add template code for breadpay (#8655)
  chore(version): 2025.07.21.1
  refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template (#8681)
  fix(router): Make v2 endpoints follow standard naming conventions (#8630)
  fix(connector): [Cybersource] Add type_selection_indicator as 1 for all cards  (#8663)
  feat(routing): Add API key auth for decision engine endpoints (#8640)
  feat(authentication): Added eligibility flow for modular authentication (#8431)
  feat(connector): [BLACKHAWKNETWORK] Add Template Code  (#8632)
  fix: remove straight through routing from routing approach (#8695)
  fix(connector): [Access Worldpay] correct enum deserialization for payment responses for (#8689)
  chore(version): 2025.07.21.0
  feat(debit_routing): add debit routing support for apple pay (#8673)
  refactor(router): decrypt the wallet token before the debit routing call (#8598)
  chore: update org retrieve api response to include org type (#8660)
  feat(routing): Add routing evaluation rule endpoint and related flow (#8656)
  fix(connector): [AUTHORIZEDOTNET] Added Invoice Number Fix (#8685)
  ...
pixincreate added a commit that referenced this pull request Jul 22, 2025
…acilitapay-mca-metadata

* 'main' of github.com:juspay/hyperswitch:
  fix(connector): Add Trustpay in Authentication Providers Config (#8622)
  refactor(connector): [Adyen] map ssn and session validity for Pix (#8702)
  feat(core): Implement UCS kill switch for emergency fallback (#8651)
  fix(openapi): Added Error Response Schema for Status Code 400 (#8684)
  feat(connector): Add template code for breadpay (#8655)
  chore(version): 2025.07.21.1
  refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template (#8681)
  fix(router): Make v2 endpoints follow standard naming conventions (#8630)
  fix(connector): [Cybersource] Add type_selection_indicator as 1 for all cards  (#8663)
  feat(routing): Add API key auth for decision engine endpoints (#8640)
  feat(authentication): Added eligibility flow for modular authentication (#8431)
  feat(connector): [BLACKHAWKNETWORK] Add Template Code  (#8632)
  fix: remove straight through routing from routing approach (#8695)
  fix(connector): [Access Worldpay] correct enum deserialization for payment responses for (#8689)
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.

[BUG] refused payment responses missing error codes and messages for Access Worldpay
4 participants