Skip to content

feat(connector): [AUTHORIZEDOTNET] create connector customer flow added #8774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 5, 2025

Conversation

swetasharma03
Copy link
Contributor

@swetasharma03 swetasharma03 commented Jul 28, 2025

Type of Change

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

Description

Previously, the setup_mandate flow was responsible for creating a customer profile in Authorize.Net. This caused issues when the same customer_id and customer_email were used in subsequent setup_mandate calls (even with different payment_details), resulting in an error:

"A duplicate record with ID 932042699 already exists."

In this PR, segregated customer creation logic:

  • createConnectorCustomer

Creates the customer profile without payment details.
This logic was previously part of setup_mandate.

  • setup_mandate

Now only creates a customerPaymentProfile (a separate Authorize.Net API call).
Allows passing billTo details, which were not permitted in createCustomerProfile API calls but are supported in createCustomerPaymentProfile.

Benefits

  • Supports saving multiple payment methods for the same customer_id and customer_email.
  • Prevents duplicate-customer errors in setup_mandate calls.
  • Enables including billTo information, improving compatibility with payment profiles.

Additional Changes

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

Motivation and Context

How did you test it?

Screenshot 2025-08-04 at 5 42 06 PM
1. Setup mandate flow with new customer id and email (succeeded)
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_NArOvTgCUUPP6V2rDoKmK763cqpUdUs7F2vSbwbQbGd0VzyRnOyXJEpxALlP6W9O' \
--data-raw '
{
    "amount": 0,
    "currency": "USD",
    "confirm": true,
    
    "customer": {
        "email": "[email protected]",
        "id": "johndoe15",
        "name": "Manisha Slack",
        "phone": "1234567890",
        "phone_country_code": "+1"
    },
    
    "setup_future_usage": "off_session",
    "payment_type": "setup_mandate",
    "off_session": true,
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "4111111111111111",
            
            "card_exp_month": "07",
            "card_exp_year": "26",
            "card_holder_name": "Joseph Does",
            "card_cvc": "123"
        }
    },
    "mandate_data": {
        "customer_acceptance": {
            "acceptance_type": "offline",
            "accepted_at": "1963-05-03T04:07:52.723Z",
            "online": {
                "ip_address": "125.0.0.1",
                "user_agent": "amet irure esse"
            }
        },
        "mandate_type": {
            "multi_use": {
                "amount": 1000,
                "currency": "USD",
                "start_date": "2023-04-21T00:00:00Z",
                "end_date": "2023-05-21T00:00:00Z",
                "metadata": {
                    "frequency": "13"
                }
            }
        }
    },
        "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        },
        "email": "[email protected]"
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        }
    }
}
'

Response

{"payment_id":"pay_0z1mgolWl2l5dJdOuZwV","merchant_id":"merchant_1752844609","status":"succeeded","amount":0,"net_amount":0,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"authorizedotnet","client_secret":"pay_0z1mgolWl2l5dJdOuZwV_secret_48WIGG8egWSFUTQqs7Rc","created":"2025-07-28T11:11:43.858Z","currency":"USD","customer_id":"johndoe15","customer":{"id":"johndoe15","name":"Manisha Slack","email":"[email protected]","phone":"1234567890","phone_country_code":"+1"},"description":null,"refunds":null,"disputes":null,"mandate_id":"man_jdtgX5xSFsX24xvtXr6E","mandate_data":{"update_mandate_id":null,"customer_acceptance":{"acceptance_type":"offline","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"125.0.0.1","user_agent":"amet irure esse"}},"mandate_type":{"multi_use":{"amount":1000,"currency":"USD","start_date":"2023-04-21T00:00:00.000Z","end_date":"2023-05-21T00:00:00.000Z","metadata":{"frequency":"13"}}}},"setup_future_usage":"off_session","off_session":true,"capture_on":null,"capture_method":null,"payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"07","card_exp_year":"26","card_holder_name":"Joseph Does","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"John","last_name":"Doe"},"phone":null,"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":"Manisha Slack","phone":"1234567890","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":"johndoe15","created_at":1753701103,"expires":1753704703,"secret":"epk_c235ebf80b6e4565a8a61b6ce3b6d113"},"manual_retry_allowed":false,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_gqhHNlHuk3bYhHxu7Or4","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3U25eUMykwv26k6svLyu","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-28T11:26:43.857Z","fingerprint":null,"browser_info":null,"payment_method_id":"pm_qdasbRK2GjImZNqEV5t8","payment_method_status":"active","updated":"2025-07-28T11:11:46.340Z","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":"932042512-931323047","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}
2. Setup mandate flow with same customer id, email and payment details (failed, as expected)
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_NArOvTgCUUPP6V2rDoKmK763cqpUdUs7F2vSbwbQbGd0VzyRnOyXJEpxALlP6W9O' \
--data-raw '
{
    "amount": 0,
    "currency": "USD",
    "confirm": true,
    
    "customer": {
        "email": "[email protected]",
        "id": "johndoe15",
        "name": "Manisha Slack",
        "phone": "1234567890",
        "phone_country_code": "+1"
    },
    
    "setup_future_usage": "off_session",
    "payment_type": "setup_mandate",
    "off_session": true,
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "4111111111111111",
            
            "card_exp_month": "07",
            "card_exp_year": "26",
            "card_holder_name": "Joseph Does",
            "card_cvc": "123"
        }
    },
    "mandate_data": {
        "customer_acceptance": {
            "acceptance_type": "offline",
            "accepted_at": "1963-05-03T04:07:52.723Z",
            "online": {
                "ip_address": "125.0.0.1",
                "user_agent": "amet irure esse"
            }
        },
        "mandate_type": {
            "multi_use": {
                "amount": 1000,
                "currency": "USD",
                "start_date": "2023-04-21T00:00:00Z",
                "end_date": "2023-05-21T00:00:00Z",
                "metadata": {
                    "frequency": "13"
                }
            }
        }
    },
        "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        },
        "email": "[email protected]"
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        }
    }
}
'
{"payment_id":"pay_7wcbZnI1PqCseXtiLbf1","merchant_id":"merchant_1752844609","status":"failed","amount":0,"net_amount":0,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"authorizedotnet","client_secret":"pay_7wcbZnI1PqCseXtiLbf1_secret_mTT27SBbCZANImE48hxR","created":"2025-07-28T11:13:28.256Z","currency":"USD","customer_id":"johndoe15","customer":{"id":"johndoe15","name":"Manisha Slack","email":"[email protected]","phone":"1234567890","phone_country_code":"+1"},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":{"update_mandate_id":null,"customer_acceptance":{"acceptance_type":"offline","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"125.0.0.1","user_agent":"amet irure esse"}},"mandate_type":{"multi_use":{"amount":1000,"currency":"USD","start_date":"2023-04-21T00:00:00.000Z","end_date":"2023-05-21T00:00:00.000Z","metadata":{"frequency":"13"}}}},"setup_future_usage":"off_session","off_session":true,"capture_on":null,"capture_method":null,"payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"07","card_exp_year":"26","card_holder_name":"Joseph Does","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"John","last_name":"Doe"},"phone":null,"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":"Manisha Slack","phone":"1234567890","return_url":null,"authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":"E00039","error_message":"A duplicate customer payment profile already exists.","unified_code":"UE_9000","unified_message":"Something went wrong","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":"johndoe15","created_at":1753701207,"expires":1753704807,"secret":"epk_8dac9cc934e2421bb15f23a4caefb8ac"},"manual_retry_allowed":true,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_gqhHNlHuk3bYhHxu7Or4","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3U25eUMykwv26k6svLyu","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-28T11:28:28.256Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-28T11:13:30.456Z","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}
3. Setup mandate flow with same customer id, email but different payment details (succeeded)
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_NArOvTgCUUPP6V2rDoKmK763cqpUdUs7F2vSbwbQbGd0VzyRnOyXJEpxALlP6W9O' \
--data-raw '
{
    "amount": 0,
    "currency": "USD",
    "confirm": true,
    
    "customer": {
        "email": "[email protected]",
        "id": "johndoe15",
        "name": "Manisha Slack",
        "phone": "1234567890",
        "phone_country_code": "+1"
    },
    
    "setup_future_usage": "off_session",
    "payment_type": "setup_mandate",
    "off_session": true,
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            
            "card_number": "4242424242424242",
            "card_exp_month": "07",
            "card_exp_year": "31",
            "card_holder_name": "Joseph Does",
            "card_cvc": "123"
        }
    },
    "mandate_data": {
        "customer_acceptance": {
            "acceptance_type": "offline",
            "accepted_at": "1963-05-03T04:07:52.723Z",
            "online": {
                "ip_address": "125.0.0.1",
                "user_agent": "amet irure esse"
            }
        },
        "mandate_type": {
            "multi_use": {
                "amount": 1000,
                "currency": "USD",
                "start_date": "2023-04-21T00:00:00Z",
                "end_date": "2023-05-21T00:00:00Z",
                "metadata": {
                    "frequency": "13"
                }
            }
        }
    },
        "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        },
        "email": "[email protected]"
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        }
    }
}
'

Response

{"payment_id":"pay_BlquUEzJXm83W4DQUIwz","merchant_id":"merchant_1752844609","status":"succeeded","amount":0,"net_amount":0,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"authorizedotnet","client_secret":"pay_BlquUEzJXm83W4DQUIwz_secret_zusBA34KyXKcsdBU82BI","created":"2025-07-28T11:17:01.809Z","currency":"USD","customer_id":"johndoe15","customer":{"id":"johndoe15","name":"Manisha Slack","email":"[email protected]","phone":"1234567890","phone_country_code":"+1"},"description":null,"refunds":null,"disputes":null,"mandate_id":"man_c8f0DBxqidxF2ozbn7lV","mandate_data":{"update_mandate_id":null,"customer_acceptance":{"acceptance_type":"offline","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"125.0.0.1","user_agent":"amet irure esse"}},"mandate_type":{"multi_use":{"amount":1000,"currency":"USD","start_date":"2023-04-21T00:00:00.000Z","end_date":"2023-05-21T00:00:00.000Z","metadata":{"frequency":"13"}}}},"setup_future_usage":"off_session","off_session":true,"capture_on":null,"capture_method":null,"payment_method":"card","payment_method_data":{"card":{"last4":"4242","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"424242","card_extended_bin":null,"card_exp_month":"07","card_exp_year":"31","card_holder_name":"Joseph Does","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"John","last_name":"Doe"},"phone":null,"email":"[email protected]"},"order_details":null,"email":"[email protected]","name":"Manisha Slack","phone":"1234567890","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":"johndoe15","created_at":1753701421,"expires":1753705021,"secret":"epk_0d1b918768af4f7b8ee94bbbbbd336b0"},"manual_retry_allowed":false,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_gqhHNlHuk3bYhHxu7Or4","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3U25eUMykwv26k6svLyu","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-28T11:32:01.809Z","fingerprint":null,"browser_info":null,"payment_method_id":"pm_mwP8b8fWJXgvBITnw0P6","payment_method_status":"active","updated":"2025-07-28T11:17:05.551Z","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":"932042512-931323107","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. Normal payment (succeeded)
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_NArOvTgCUUPP6V2rDoKmK763cqpUdUs7F2vSbwbQbGd0VzyRnOyXJEpxALlP6W9O' \
--data-raw '{
    "amount": 6540,
    "currency": "USD",
    "amount_to_capture": 6540,
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "authentication_type": "no_three_ds",
    "setup_future_usage": "on_session", 
"customer": {
    "id": "sweta11",
    "name": "John Doe",
    "email": "[email protected]",
    "phone": "9999999999",
    "phone_country_code": "+1"
},
    "phone_country_code": "+1",
    "routing": { 
        "type": "single",
        "data": "stripe"
    },
    "description": "Its my first payment request",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": { 
        "card": {
            "card_number": "5424000000000015",
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "999"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "[email protected]"
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "[email protected]"
    },
    "merchant_order_reference_id":"order",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "order_details": [
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": 6540,
            "account_name": "transaction_processing"
        }
    ],
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "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": "128.0.0.1"
    },
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "125.0.0.1",
            "user_agent": "amet irure esse"
        }
    },
    "connector_metadata": {
        "noon": {
            "order_category": "pay"
        }
    },
    "payment_link": false,
    "payment_link_config": {
        "theme": "",
        "logo": "",
        "seller_name": "",
        "sdk_layout": "",
        "display_sdk_only": false,
        "enabled_saved_payment_method": false
    },
    "payment_type": "normal", 
    "request_incremental_authorization": false,
    "session_expiry": 900 
'

Response:

{"payment_id":"pay_RIKYKqjzmDhlh6sa2NKi","merchant_id":"merchant_1752844609","status":"succeeded","amount":6540,"net_amount":6540,"shipping_cost":null,"amount_capturable":0,"amount_received":6540,"connector":"authorizedotnet","client_secret":"pay_RIKYKqjzmDhlh6sa2NKi_secret_PH5fWmlk5wPyacehepe7","created":"2025-07-29T13:29:05.166Z","currency":"USD","customer_id":"sweta11","customer":{"id":"sweta11","name":"John Doe","email":"[email protected]","phone":"9999999999","phone_country_code":"+1"},"description":"Its my first payment request","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":"0015","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"542400","card_extended_bin":null,"card_exp_month":"10","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":{"description":"The street address and postal code matched.","avs_result_code":"Y"},"authentication_data":null},"billing":null},"payment_token":null,"shipping":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"order_details":[{"brand":null,"amount":6540,"category":null,"quantity":1,"tax_rate":null,"product_id":null,"product_name":"Apple iphone 15","product_type":null,"sub_category":null,"product_img_link":null,"product_tax_code":null,"total_tax_amount":null,"requires_shipping":null}],"email":"[email protected]","name":"John Doe","phone":"9999999999","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"sweta11","created_at":1753795745,"expires":1753799345,"secret":"epk_0c8e0546611b44488fa296574063e57c"},"manual_retry_allowed":false,"connector_transaction_id":"120067982504","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":{"apple_pay":null,"airwallex":null,"noon":{"order_category":"pay"},"braintree":null,"adyen":null},"feature_metadata":null,"reference_id":"120067982504","payment_link":null,"profile_id":"pro_gqhHNlHuk3bYhHxu7Or4","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_3U25eUMykwv26k6svLyu","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-29T13:44:05.165Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"128.0.0.1","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-29T13:29:08.640Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":"order","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}
5. Non zero CIT (succeeded)
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_NArOvTgCUUPP6V2rDoKmK763cqpUdUs7F2vSbwbQbGd0VzyRnOyXJEpxALlP6W9O' \
--data-raw '{
    "amount": 6540,
    "currency": "USD",
    "amount_to_capture": 6540,
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "authentication_type": "no_three_ds",
    "setup_future_usage": "off_session", 
    "customer": {
        "id": "sweta13",
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "9999999999",
        "phone_country_code": "+1"
    },
    "phone_country_code": "+1",
    "routing": { 
        "type": "single",
        "data": "stripe"
    },
    "description": "Its my first payment request",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": { 
        "card": {
            "card_number": "5424000000000015",
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "999"
        }
    },
    
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "[email protected]"
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "[email protected]"
    },
    "merchant_order_reference_id": "order",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "order_details": [
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": 6540,
            "account_name": "transaction_processing"
        }
    ],
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "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": "128.0.0.1"
    },
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "125.0.0.1",
            "user_agent": "amet irure esse"
        }
    },
    "connector_metadata": {
        "noon": {
            "order_category": "pay"
        }
    },
    "payment_link": false,
    "payment_link_config": {
        "theme": "",
        "logo": "",
        "seller_name": "",
        "sdk_layout": "",
        "display_sdk_only": false,
        "enabled_saved_payment_method": false
    },
    "payment_type": "normal", 
    "request_incremental_authorization": false,
    "session_expiry": 900 
}'

Response:

{"payment_id":"pay_bI18ZUVKZd6nQxbs0X0l","merchant_id":"merchant_1753802295","status":"succeeded","amount":6540,"net_amount":6540,"shipping_cost":null,"amount_capturable":0,"amount_received":6540,"connector":"authorizedotnet","client_secret":"pay_bI18ZUVKZd6nQxbs0X0l_secret_QUuBCGUHYXfrneN5DCLu","created":"2025-07-30T09:24:52.819Z","currency":"USD","customer_id":"sweta13","customer":{"id":"sweta13","name":"John Doe","email":"[email protected]","phone":"9999999999","phone_country_code":"+1"},"description":"Its my first payment request","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"off_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"0015","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"542400","card_extended_bin":null,"card_exp_month":"10","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":{"description":"The street address and postal code matched.","avs_result_code":"Y"},"authentication_data":null},"billing":null},"payment_token":null,"shipping":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"California","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"[email protected]"},"order_details":[{"brand":null,"amount":6540,"category":null,"quantity":1,"tax_rate":null,"product_id":null,"product_name":"Apple iphone 15","product_type":null,"sub_category":null,"product_img_link":null,"product_tax_code":null,"total_tax_amount":null,"requires_shipping":null}],"email":"[email protected]","name":"John Doe","phone":"9999999999","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"credit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"sweta13","created_at":1753867492,"expires":1753871092,"secret":"epk_9aaad41b3fe74384adfc9ccea61dcb06"},"manual_retry_allowed":false,"connector_transaction_id":"120068033904","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":{"apple_pay":null,"airwallex":null,"noon":{"order_category":"pay"},"braintree":null,"adyen":null},"feature_metadata":null,"reference_id":"120068033904","payment_link":null,"profile_id":"pro_7LXZcwvuxrGCwWWqFMz3","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_bCot3yUDiHEUmqNWgzMj","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-30T09:39:52.819Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"128.0.0.1","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":"pm_Atbhhrr9E9o60CpC7TPH","payment_method_status":"active","updated":"2025-07-30T09:24:55.136Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":"order","order_tax_amount":null,"connector_mandate_id":"932071488-931353121","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}
6. Corresponding non zero MIT (succeeded)

Note: use different amount than the one used in CIT

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_Ig1SMGH807BOWTGNx7hqATikO6HzoWjYGnQkQjDp2jDylJwav1e39ayvV15qMVmV' \
--data '
{
    "amount": 1001,
    "currency": "USD",
    
    "customer_id": "sweta13",
    "description": "Subsequent Mandate Test Payment (MIT from New CIT Demo)",
    "confirm": true,
    "off_session": true,
    "recurring_details": {
        "type": "payment_method_id",
        "data": "pm_Atbhhrr9E9o60CpC7TPH"
    }
    
    
}
'

Response:

{"payment_id":"pay_dBHhywr4LFjCWGMuKRWG","merchant_id":"merchant_1753802295","status":"succeeded","amount":1001,"net_amount":1001,"shipping_cost":null,"amount_capturable":0,"amount_received":1001,"connector":"authorizedotnet","client_secret":"pay_dBHhywr4LFjCWGMuKRWG_secret_K6OMSaLYEN3VuxDIgi4Z","created":"2025-07-30T09:26:07.782Z","currency":"USD","customer_id":"sweta13","customer":{"id":"sweta13","name":"John Doe","email":"[email protected]","phone":"9999999999","phone_country_code":"+1"},"description":"Subsequent Mandate Test Payment (MIT from New CIT Demo)","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":true,"capture_on":null,"capture_method":null,"payment_method":"card","payment_method_data":{"card":{"last4":"0015","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"542400","card_extended_bin":null,"card_exp_month":"10","card_exp_year":"25","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":"[email protected]","name":"John Doe","phone":"9999999999","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":"sweta13","created_at":1753867567,"expires":1753871167,"secret":"epk_29f66f59f99c4fa397250dee944df8dd"},"manual_retry_allowed":false,"connector_transaction_id":"120068033946","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"120068033946","payment_link":null,"profile_id":"pro_7LXZcwvuxrGCwWWqFMz3","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_bCot3yUDiHEUmqNWgzMj","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-30T09:41:07.782Z","fingerprint":null,"browser_info":null,"payment_method_id":"pm_Atbhhrr9E9o60CpC7TPH","payment_method_status":"active","updated":"2025-07-30T09:26:08.420Z","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":"932071488-931353121","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}
7. Zero dollar MIT corresponding to setup-mandate CIT (succeeded)
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_Ig1SMGH807BOWTGNx7hqATikO6HzoWjYGnQkQjDp2jDylJwav1e39ayvV15qMVmV' \
--data '
{
    "amount": 1000,
    "currency": "USD",
    "confirm": true,
    "customer_id": "johndoe17",
    "mandate_id": "man_Vx8TOc35YxBjsq6jn7PJ",
    "off_session": true
}'

Response:

{"payment_id":"pay_9PjTPCTcG3fdNCZSifAE","merchant_id":"merchant_1753802295","status":"succeeded","amount":1000,"net_amount":1000,"shipping_cost":null,"amount_capturable":0,"amount_received":1000,"connector":"authorizedotnet","client_secret":"pay_9PjTPCTcG3fdNCZSifAE_secret_Jv8T8xgmHXG7e8951uxj","created":"2025-07-30T09:20:56.536Z","currency":"USD","customer_id":"johndoe17","customer":{"id":"johndoe17","name":"Manisha Slack","email":"[email protected]","phone":"1234567890","phone_country_code":"+1"},"description":null,"refunds":null,"disputes":null,"mandate_id":"man_Vx8TOc35YxBjsq6jn7PJ","mandate_data":null,"setup_future_usage":null,"off_session":true,"capture_on":null,"capture_method":null,"payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"411111","card_extended_bin":null,"card_exp_month":"07","card_exp_year":"26","card_holder_name":"Joseph Does","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":"f546796f-5b16-4a14-b2cd-c8b487b9a4f0","shipping":null,"billing":null,"order_details":null,"email":"[email protected]","name":"Manisha Slack","phone":"1234567890","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":"johndoe17","created_at":1753867256,"expires":1753870856,"secret":"epk_d8dd3db064824e5e8a36255fd3cab2ab"},"manual_retry_allowed":false,"connector_transaction_id":"120068033741","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"120068033741","payment_link":null,"profile_id":"pro_7LXZcwvuxrGCwWWqFMz3","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_bCot3yUDiHEUmqNWgzMj","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-30T09:35:56.536Z","fingerprint":null,"browser_info":null,"payment_method_id":"pm_Cs7cwb8MRmFY7BSVzyKK","payment_method_status":"active","updated":"2025-07-30T09:20:58.715Z","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":"932071411-931353043","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

@swetasharma03 swetasharma03 self-assigned this Jul 28, 2025
@swetasharma03 swetasharma03 requested review from a team as code owners July 28, 2025 11:37
Copy link

semanticdiff-com bot commented Jul 28, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs  19% smaller
  crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs  8% smaller
  config/config.example.toml Unsupported file format
  config/deployments/integration_test.toml Unsupported file format
  config/deployments/production.toml Unsupported file format
  config/deployments/sandbox.toml Unsupported file format
  config/development.toml Unsupported file format
  config/docker_compose.toml Unsupported file format
  crates/hyperswitch_connectors/src/default_implementations.rs  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Authorizedotnet.js  0% smaller
  cypress-tests/cypress/utils/RequestBodyUtils.js  0% smaller
  loadtest/config/development.toml Unsupported file format

@swetasharma03 swetasharma03 force-pushed the authorizedotnet-customer-create branch 4 times, most recently from 7dcca38 to 9a775e9 Compare July 28, 2025 12:13
@swetasharma03 swetasharma03 changed the title feat(connector) : [AUTHORIZEDOTNET] create connector customer flow added feat(connector): [AUTHORIZEDOTNET] create connector customer flow added Jul 30, 2025
@swetasharma03 swetasharma03 force-pushed the authorizedotnet-customer-create branch 3 times, most recently from 4277be9 to e32c134 Compare July 30, 2025 08:13
ShankarSinghC
ShankarSinghC previously approved these changes Jul 30, 2025
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Aug 1, 2025
@Gnanasundari24 Gnanasundari24 removed this pull request from the merge queue due to a manual request Aug 1, 2025
ShankarSinghC
ShankarSinghC previously approved these changes Aug 1, 2025
@swetasharma03 swetasharma03 requested a review from a team as a code owner August 4, 2025 11:28
@swetasharma03 swetasharma03 force-pushed the authorizedotnet-customer-create branch 6 times, most recently from d03f753 to 3fec9d4 Compare August 4, 2025 12:14
likhinbopanna
likhinbopanna previously approved these changes Aug 5, 2025
@swetasharma03 swetasharma03 force-pushed the authorizedotnet-customer-create branch 2 times, most recently from 6b3205d to 16e0fd8 Compare August 5, 2025 10:24
@swetasharma03 swetasharma03 force-pushed the authorizedotnet-customer-create branch from 16e0fd8 to 8fa32b1 Compare August 5, 2025 11:11
@likhinbopanna likhinbopanna added this pull request to the merge queue Aug 5, 2025
Merged via the queue into main with commit 8818a9b Aug 5, 2025
18 of 22 checks passed
@likhinbopanna likhinbopanna deleted the authorizedotnet-customer-create branch August 5, 2025 13:26
pixincreate added a commit that referenced this pull request Aug 6, 2025
…ordea-sepa

* 'main' of github.com:juspay/hyperswitch: (89 commits)
  feat(router): [worldpayvantiv] add dispute list sync and implement dispute (#8830)
  feat(core): Add support for Void after Capture (#8839)
  fix(wasm): [FISERV] Added GooglePay Payment Method Type (#8832)
  feat(connector): [Barclaycard] Add Google Pay Payment Method (#8786)
  chore(version): 2025.08.06.0
  feat(core): Added additional authentication fields for 3ds external authentication (#8758)
  refactor(core): propagate network_transaction_id in response of payment (#8829)
  fix(core): add fix for stopping multiple event locking idempotent logs (#8034)
  feat(connector): [AUTHORIZEDOTNET] create connector customer flow added (#8774)
  feat(core): Add L2_L3 Data Support  (#8828)
  feat(connector): [NMI] Add mandates flow (#8652)
  fix(connector): [Wise] send uuid as connector_transaction_id (#8836)
  feat(core): populate UCS status_code in response headers (#8788)
  feat(external_services): Fixed Url for Unified Connector Service gRPC Client (#8587)
  chore: reorder v2 migrations folders (#8671)
  fix(router): Take merchant ID from headers in API Key - Revoke (v2) (#8808)
  fix(connector): (payload) currency auth key wasm changes (#8825)
  feat(payment-methods): add filtering logic for payment method list v2 (#8606)
  feat(router): add support for apple pay pre-decrypted token in the payments confirm call (#8815)
  chore(version): 2025.08.05.0
  ...
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.

4 participants