Skip to content

fix(connector): [Worldpayvantiv] Psync status mapping and add address lines to billing data#8602

Merged
Gnanasundari24 merged 6 commits intomainfrom
fix-psync
Jul 15, 2025
Merged

fix(connector): [Worldpayvantiv] Psync status mapping and add address lines to billing data#8602
Gnanasundari24 merged 6 commits intomainfrom
fix-psync

Conversation

@AkshayaFoiger
Copy link
Contributor

@AkshayaFoiger AkshayaFoiger commented Jul 10, 2025

Type of Change

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

Description

Initially the status handling was done on the basis of previous payment status. Because of this during manual payment, doing psync twice resulted in succeeded payment, without even triggering capture call.
In this PR, we have modified

  • api_call_id : to indicate the operation
  • handle status using api_call_id receivedin sync response
  • add adress lines to bill to address

How did you test it?

Automatic payment and Refund with address line 2 Create a payment
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_hQJJ2Ut5ZzTIqSxWGY1ud4U2GjpBbqNfjRYucF6ERe567dQXTVQSQB2oCRM7WAfp' \
--data '{
    "amount": 15000,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    
    "billing": {
        "address": {
            "line1": "2 Main St.",
            "line2": "2 Main St.",
            
            "city": "Riverside",
            "state": "RI",
            "zip": "02915",
            "country": "US",
            "first_name": "Mike",
            "last_name": "J. Hammer"
        }
    },
    "customer_id": "hyperswitch_sdk_demo_id",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "5435101234510196", 
            "card_exp_month": "11",
            "card_exp_year": "50",
            
            "card_cvc": "987"
        }
    }
   
}'

Response

{"payment_id":"pay_gAJTPBfK9UEF7GklvSaP","merchant_id":"postman_merchant_GHAction_c5106eba-7361-4bb2-a8db-a873c6849da9","status":"processing","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_gAJTPBfK9UEF7GklvSaP_secret_g3NH3CAlCTyaEKUvjb1H","created":"2025-07-11T02:51:50.870Z","currency":"USD","customer_id":"hyperswitch_sdk_demo_id","customer":{"id":"hyperswitch_sdk_demo_id","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"0196","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"543510","card_extended_bin":null,"card_exp_month":"11","card_exp_year":"50","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"Riverside","country":"US","line1":"2 Main St.","line2":"2 Main St.","line3":null,"zip":"02915","state":"RI","first_name":"Mike","last_name":"J. Hammer"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"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":"credit","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":1752202310,"expires":1752205910,"secret":"epk_cb63ae6a5a3f4b2b978370c222d61f9a"},"manual_retry_allowed":false,"connector_transaction_id":"83997183208401633","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_gAJTPBfK9UEF7GklvSaP_1","payment_link":null,"profile_id":"pro_v0l6zYurjcsEYbxFysux","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_wzQksqIKbnLo0Q41EH5j","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-11T03:06:50.870Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-11T02:52:07.732Z","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}

Psync

{"payment_id":"pay_gAJTPBfK9UEF7GklvSaP","merchant_id":"postman_merchant_GHAction_c5106eba-7361-4bb2-a8db-a873c6849da9","status":"succeeded","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":0,"amount_received":15000,"connector":"worldpayvantiv","client_secret":"pay_gAJTPBfK9UEF7GklvSaP_secret_g3NH3CAlCTyaEKUvjb1H","created":"2025-07-11T02:51:50.870Z","currency":"USD","customer_id":"hyperswitch_sdk_demo_id","customer":{"id":"hyperswitch_sdk_demo_id","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"0196","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"543510","card_extended_bin":null,"card_exp_month":"11","card_exp_year":"50","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"Riverside","country":"US","line1":"2 Main St.","line2":"2 Main St.","line3":null,"zip":"02915","state":"RI","first_name":"Mike","last_name":"J. Hammer"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"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":"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":"83997183208401633","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_gAJTPBfK9UEF7GklvSaP_1","payment_link":null,"profile_id":"pro_v0l6zYurjcsEYbxFysux","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_wzQksqIKbnLo0Q41EH5j","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-11T03:06:50.870Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-11T02:52:29.491Z","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}

Refund

curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_hQJJ2Ut5ZzTIqSxWGY1ud4U2GjpBbqNfjRYucF6ERe567dQXTVQSQB2oCRM7WAfp' \
--data '{
    "payment_id": "pay_gAJTPBfK9UEF7GklvSaP",
    
    "reason": "Customer returned product",
    "refund_type": "instant"
}'

Response

{"refund_id":"ref_IoM7FMxFQxfJgx9drJ2Z","payment_id":"pay_gAJTPBfK9UEF7GklvSaP","amount":15000,"currency":"USD","status":"pending","reason":"Customer returned product","metadata":null,"error_message":null,"error_code":null,"unified_code":null,"unified_message":null,"created_at":"2025-07-11T02:52:52.989Z","updated_at":"2025-07-11T02:52:53.362Z","connector":"worldpayvantiv","profile_id":"pro_v0l6zYurjcsEYbxFysux","merchant_connector_id":"mca_wzQksqIKbnLo0Q41EH5j","split_refunds":null,"issuer_error_code":null,"issuer_error_message":null}

Refund

{"refund_id":"ref_IoM7FMxFQxfJgx9drJ2Z","payment_id":"pay_gAJTPBfK9UEF7GklvSaP","amount":15000,"currency":"USD","status":"succeeded","reason":"Customer returned product","metadata":null,"error_message":null,"error_code":null,"unified_code":null,"unified_message":null,"created_at":"2025-07-11T02:52:52.989Z","updated_at":"2025-07-11T02:53:34.147Z","connector":"worldpayvantiv","profile_id":"pro_v0l6zYurjcsEYbxFysux","merchant_connector_id":"mca_wzQksqIKbnLo0Q41EH5j","split_refunds":null,"issuer_error_code":null,"issuer_error_message":null}
Manual Capture with address line 2 and address line 3 Create a manual payment
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_hQJJ2Ut5ZzTIqSxWGY1ud4U2GjpBbqNfjRYucF6ERe567dQXTVQSQB2oCRM7WAfp' \
--data '{
    "amount": 15000,
    "currency": "USD",
    "confirm": true,
    "capture_method": "manual",
    
    "billing": {
        "address": {
            "line1": "2 Main St.",
            "line2": "2 Main St.",
            "line3": "2 Main St.",
            "city": "Riverside",
            "state": "RI",
            "zip": "02915",
            "country": "US",
            "first_name": "Mike",
            "last_name": "J. Hammer"
        }
    },
    "customer_id": "hyperswitch_sdk_demo_id",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "5435101234510196", 
            "card_exp_month": "11",
            "card_exp_year": "50",
            
            "card_cvc": "987"
        }
    }
  
}'

Response

{"payment_id":"pay_2WkZoyvRYEBnWW4Me5LY","merchant_id":"postman_merchant_GHAction_c5106eba-7361-4bb2-a8db-a873c6849da9","status":"processing","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":15000,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_2WkZoyvRYEBnWW4Me5LY_secret_eVgftXJDUNujGipnz8Se","created":"2025-07-11T02:54:47.916Z","currency":"USD","customer_id":"hyperswitch_sdk_demo_id","customer":{"id":"hyperswitch_sdk_demo_id","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"0196","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"543510","card_extended_bin":null,"card_exp_month":"11","card_exp_year":"50","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"Riverside","country":"US","line1":"2 Main St.","line2":"2 Main St.","line3":"2 Main St.","zip":"02915","state":"RI","first_name":"Mike","last_name":"J. Hammer"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"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":"credit","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":1752202487,"expires":1752206087,"secret":"epk_31922ae84827441d9a66386de1ac0368"},"manual_retry_allowed":false,"connector_transaction_id":"83997183208402961","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_2WkZoyvRYEBnWW4Me5LY_1","payment_link":null,"profile_id":"pro_v0l6zYurjcsEYbxFysux","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_wzQksqIKbnLo0Q41EH5j","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-11T03:09:47.916Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-11T02:54:50.027Z","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}

Psync

{"payment_id":"pay_2WkZoyvRYEBnWW4Me5LY","merchant_id":"postman_merchant_GHAction_c5106eba-7361-4bb2-a8db-a873c6849da9","status":"requires_capture","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":15000,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_2WkZoyvRYEBnWW4Me5LY_secret_eVgftXJDUNujGipnz8Se","created":"2025-07-11T02:54:47.916Z","currency":"USD","customer_id":"hyperswitch_sdk_demo_id","customer":{"id":"hyperswitch_sdk_demo_id","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"0196","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"543510","card_extended_bin":null,"card_exp_month":"11","card_exp_year":"50","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"Riverside","country":"US","line1":"2 Main St.","line2":"2 Main St.","line3":"2 Main St.","zip":"02915","state":"RI","first_name":"Mike","last_name":"J. Hammer"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"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":"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":"83997183208402961","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_2WkZoyvRYEBnWW4Me5LY_1","payment_link":null,"profile_id":"pro_v0l6zYurjcsEYbxFysux","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_wzQksqIKbnLo0Q41EH5j","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-11T03:09:47.916Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-11T02:55:55.509Z","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}

Capture

curl --location 'http://localhost:8080/payments/pay_2WkZoyvRYEBnWW4Me5LY/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_hQJJ2Ut5ZzTIqSxWGY1ud4U2GjpBbqNfjRYucF6ERe567dQXTVQSQB2oCRM7WAfp' \
--data '{
    
    "statement_descriptor_name": "Joseph",
    "statement_descriptor_suffix": "JS"
}'

Response

{"payment_id":"pay_2WkZoyvRYEBnWW4Me5LY","merchant_id":"postman_merchant_GHAction_c5106eba-7361-4bb2-a8db-a873c6849da9","status":"processing","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":15000,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_2WkZoyvRYEBnWW4Me5LY_secret_eVgftXJDUNujGipnz8Se","created":"2025-07-11T02:54:47.916Z","currency":"USD","customer_id":"hyperswitch_sdk_demo_id","customer":{"id":"hyperswitch_sdk_demo_id","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"0196","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"543510","card_extended_bin":null,"card_exp_month":"11","card_exp_year":"50","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"Riverside","country":"US","line1":"2 Main St.","line2":"2 Main St.","line3":"2 Main St.","zip":"02915","state":"RI","first_name":"Mike","last_name":"J. Hammer"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"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":"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":"83997183413946869","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_2WkZoyvRYEBnWW4Me5LY_1","payment_link":null,"profile_id":"pro_v0l6zYurjcsEYbxFysux","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_wzQksqIKbnLo0Q41EH5j","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-11T03:09:47.916Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-11T02:56:20.329Z","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}

Psync

{"payment_id":"pay_2WkZoyvRYEBnWW4Me5LY","merchant_id":"postman_merchant_GHAction_c5106eba-7361-4bb2-a8db-a873c6849da9","status":"succeeded","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":0,"amount_received":15000,"connector":"worldpayvantiv","client_secret":"pay_2WkZoyvRYEBnWW4Me5LY_secret_eVgftXJDUNujGipnz8Se","created":"2025-07-11T02:54:47.916Z","currency":"USD","customer_id":"hyperswitch_sdk_demo_id","customer":{"id":"hyperswitch_sdk_demo_id","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"0196","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"543510","card_extended_bin":null,"card_exp_month":"11","card_exp_year":"50","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"Riverside","country":"US","line1":"2 Main St.","line2":"2 Main St.","line3":"2 Main St.","zip":"02915","state":"RI","first_name":"Mike","last_name":"J. Hammer"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"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":"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":"83997183413946869","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_2WkZoyvRYEBnWW4Me5LY_1","payment_link":null,"profile_id":"pro_v0l6zYurjcsEYbxFysux","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_wzQksqIKbnLo0Q41EH5j","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-11T03:09:47.916Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-11T02:56:54.101Z","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}
Create a manual payment and void the payment without address lines Create a manual payment
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_hQJJ2Ut5ZzTIqSxWGY1ud4U2GjpBbqNfjRYucF6ERe567dQXTVQSQB2oCRM7WAfp' \
--data '{
    "amount": 15000,
    "currency": "USD",
    "confirm": true,
    "capture_method": "manual",
    
    "billing": {
        "address": {
            "city": "Riverside",
            "state": "RI",
            "zip": "02915",
            "country": "US",
            "first_name": "Mike",
            "last_name": "J. Hammer"
        }
    },
    "customer_id": "hyperswitch_sdk_demo_id",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "5435101234510196", 
            "card_exp_month": "11",
            "card_exp_year": "50",
            
            "card_cvc": "987"
        }
    }   
}'

Response

{"payment_id":"pay_xynlshGK0KIfzJhKZ7Jy","merchant_id":"postman_merchant_GHAction_c5106eba-7361-4bb2-a8db-a873c6849da9","status":"processing","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":15000,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_xynlshGK0KIfzJhKZ7Jy_secret_igkU7TdzhDswnamaTKU3","created":"2025-07-11T02:58:31.762Z","currency":"USD","customer_id":"hyperswitch_sdk_demo_id","customer":{"id":"hyperswitch_sdk_demo_id","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"0196","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"543510","card_extended_bin":null,"card_exp_month":"11","card_exp_year":"50","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"Riverside","country":"US","line1":null,"line2":null,"line3":null,"zip":"02915","state":"RI","first_name":"Mike","last_name":"J. Hammer"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"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":"credit","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":1752202711,"expires":1752206311,"secret":"epk_6d7214c99c97483dba473a4908ffebdc"},"manual_retry_allowed":false,"connector_transaction_id":"84085142647433277","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_xynlshGK0KIfzJhKZ7Jy_1","payment_link":null,"profile_id":"pro_v0l6zYurjcsEYbxFysux","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_wzQksqIKbnLo0Q41EH5j","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-11T03:13:31.762Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-11T02:58:36.761Z","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}

Psync

{"payment_id":"pay_xynlshGK0KIfzJhKZ7Jy","merchant_id":"postman_merchant_GHAction_c5106eba-7361-4bb2-a8db-a873c6849da9","status":"requires_capture","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":15000,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_xynlshGK0KIfzJhKZ7Jy_secret_igkU7TdzhDswnamaTKU3","created":"2025-07-11T02:58:31.762Z","currency":"USD","customer_id":"hyperswitch_sdk_demo_id","customer":{"id":"hyperswitch_sdk_demo_id","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"0196","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"543510","card_extended_bin":null,"card_exp_month":"11","card_exp_year":"50","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"Riverside","country":"US","line1":null,"line2":null,"line3":null,"zip":"02915","state":"RI","first_name":"Mike","last_name":"J. Hammer"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"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":"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":"84085142647433277","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_xynlshGK0KIfzJhKZ7Jy_1","payment_link":null,"profile_id":"pro_v0l6zYurjcsEYbxFysux","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_wzQksqIKbnLo0Q41EH5j","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-11T03:13:31.762Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-11T02:59:14.490Z","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}

Void

curl --location 'http://localhost:8080/payments/pay_xynlshGK0KIfzJhKZ7Jy/cancel' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_hQJJ2Ut5ZzTIqSxWGY1ud4U2GjpBbqNfjRYucF6ERe567dQXTVQSQB2oCRM7WAfp' \
--data '{"cancellation_reason":"requested_by_customer"}'

Response

{"payment_id":"pay_xynlshGK0KIfzJhKZ7Jy","merchant_id":"postman_merchant_GHAction_c5106eba-7361-4bb2-a8db-a873c6849da9","status":"processing","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_xynlshGK0KIfzJhKZ7Jy_secret_igkU7TdzhDswnamaTKU3","created":"2025-07-11T02:58:31.762Z","currency":"USD","customer_id":"hyperswitch_sdk_demo_id","customer":{"id":"hyperswitch_sdk_demo_id","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"0196","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"543510","card_extended_bin":null,"card_exp_month":"11","card_exp_year":"50","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"Riverside","country":"US","line1":null,"line2":null,"line3":null,"zip":"02915","state":"RI","first_name":"Mike","last_name":"J. Hammer"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":"requested_by_customer","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":"84085142759342183","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_xynlshGK0KIfzJhKZ7Jy_1","payment_link":null,"profile_id":"pro_v0l6zYurjcsEYbxFysux","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_wzQksqIKbnLo0Q41EH5j","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-11T03:13:31.762Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-11T02:59:32.991Z","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}

Psync

{"payment_id":"pay_xynlshGK0KIfzJhKZ7Jy","merchant_id":"postman_merchant_GHAction_c5106eba-7361-4bb2-a8db-a873c6849da9","status":"cancelled","amount":15000,"net_amount":15000,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayvantiv","client_secret":"pay_xynlshGK0KIfzJhKZ7Jy_secret_igkU7TdzhDswnamaTKU3","created":"2025-07-11T02:58:31.762Z","currency":"USD","customer_id":"hyperswitch_sdk_demo_id","customer":{"id":"hyperswitch_sdk_demo_id","name":null,"email":null,"phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"0196","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"543510","card_extended_bin":null,"card_exp_month":"11","card_exp_year":"50","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"Riverside","country":"US","line1":null,"line2":null,"line3":null,"zip":"02915","state":"RI","first_name":"Mike","last_name":"J. Hammer"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":"requested_by_customer","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":"84085142759342183","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_xynlshGK0KIfzJhKZ7Jy_1","payment_link":null,"profile_id":"pro_v0l6zYurjcsEYbxFysux","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_wzQksqIKbnLo0Q41EH5j","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-11T03:13:31.762Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-11T03:00:13.829Z","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

@AkshayaFoiger AkshayaFoiger requested a review from a team as a code owner July 10, 2025 11:20
@semanticdiff-com
Copy link

semanticdiff-com bot commented Jul 10, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs  24% smaller
  crates/hyperswitch_connectors/src/utils.rs  0% smaller

@AkshayaFoiger AkshayaFoiger self-assigned this Jul 10, 2025
@AkshayaFoiger AkshayaFoiger changed the title fix(connectors): Psync status mapping and add address line 2 to billing data fix(connector): [Worldpayvantiv] Psync status mapping and add address line 2 to billing data Jul 10, 2025
@AkshayaFoiger AkshayaFoiger changed the title fix(connector): [Worldpayvantiv] Psync status mapping and add address line 2 to billing data fix(connector): [Worldpayvantiv] Psync status mapping and add address_line_2 to billing data Jul 10, 2025
@AkshayaFoiger AkshayaFoiger changed the title fix(connector): [Worldpayvantiv] Psync status mapping and add address_line_2 to billing data fix(connector): [Worldpayvantiv] Psync status mapping and add address lines to billing data Jul 11, 2025
@AkshayaFoiger AkshayaFoiger added A-connector-integration Area: Connector integration C-refactor Category: Refactor labels Jul 11, 2025
@AkshayaFoiger
Copy link
Contributor Author

Cypress Test Issues for Vantiv
Here is the list of issues with Vantiv sandbox testing, that affects cypress test cases

  1. Sandbox behavior in consistent - Sometimes two sync calls are required to bring a payment status to requires_capture /succeeded . Other times, the single sync call is sufficient.
  2. Initially all payment operation will go processing before going to a terminal state or requires_capture.
    Tried using ResponseCustom to handle the possibility of multiple response, but it is not working as expected

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Jul 15, 2025
Merged via the queue into main with commit a4ec03f Jul 15, 2025
16 of 20 checks passed
@Gnanasundari24 Gnanasundari24 deleted the fix-psync branch July 15, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-connector-integration Area: Connector integration C-refactor Category: Refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants