Skip to content

Conversation

ShankarSinghC
Copy link
Contributor

@ShankarSinghC ShankarSinghC commented Aug 28, 2024

Type of Change

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

Description

If the customer is deleted after the payment is done the payments retrieve will fail as the customer details are redacted. But we should be able to retrieve a payment even is the customer details are redacted.

This pr contains the changes that will set the customer details to None if the customer details are redacted during the Psync.

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?

-> Make a card payment

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_RPC8caLJDX8s4AFPVxr0KCy6UOTSJNs7IjbfK9WmkDddIBTfibFPBuQxM4A1nKu0' \
--data-raw '{
    "amount": 100,
    "amount_to_capture": 100,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "customer_id": "cu_1725352557",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "http://127.0.0.1:4040",
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "in sit",
            "user_agent": "amet irure esse"
        }
    },
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "card_number": "4000000000000119",
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "card_cvc": "838"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX",
            "last_name": "ss"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX"
        }
    },
    "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": "125.0.0.1"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'
{
    "payment_id": "pay_5zhIYYmNTX8Tt5aBhh9L",
    "merchant_id": "merchant_1725352456",
    "status": "succeeded",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 0,
    "amount_received": 100,
    "connector": "cybersource",
    "client_secret": "pay_5zhIYYmNTX8Tt5aBhh9L_secret_7ZVEnylnSEZT4hzpqmWS",
    "created": "2024-09-03T08:37:35.629Z",
    "currency": "USD",
    "customer_id": "cu_1725352656",
    "customer": {
        "id": "cu_1725352656",
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0119",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": null,
            "payment_checks": {
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "card_verification": null
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_XPgomv4iZkbxp4PX9Jrt",
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": null
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": "San",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": "ss"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "http://127.0.0.1:4040/",
    "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": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "cu_1725352656",
        "created_at": 1725352655,
        "expires": 1725356255,
        "secret": "epk_11de191943614d18b24ffda26474d9eb"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7253526568986196003955",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_5zhIYYmNTX8Tt5aBhh9L_1",
    "payment_link": null,
    "profile_id": "pro_pCmVCFH8Jh9CRAOq71tG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HLz5UXL0F35JM3QsRh6f",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-03T08:52:35.629Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "125.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": "2024-09-03T08:37:38.445Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}

-> Delete the customer

curl --location --request DELETE 'http://localhost:8080/customers/cu_1725352656' \
--header 'Accept: application/json' \
--header 'api-key: dev_RPC8caLJDX8s4AFPVxr0KCy6UOTSJNs7IjbfK9WmkDddIBTfibFPBuQxM4A1nKu0'
{
    "customer_id": "cu_1725352656",
    "customer_deleted": true,
    "address_deleted": true,
    "payment_methods_deleted": true
}

-> force sync

curl --location 'http://localhost:8080/payments/pay_5zhIYYmNTX8Tt5aBhh9L?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_RPC8caLJDX8s4AFPVxr0KCy6UOTSJNs7IjbfK9WmkDddIBTfibFPBuQxM4A1nKu0'
{
    "payment_id": "pay_5zhIYYmNTX8Tt5aBhh9L",
    "merchant_id": "merchant_1725352456",
    "status": "succeeded",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 0,
    "amount_received": 100,
    "connector": "cybersource",
    "client_secret": "pay_5zhIYYmNTX8Tt5aBhh9L_secret_7ZVEnylnSEZT4hzpqmWS",
    "created": "2024-09-03T08:37:35.629Z",
    "currency": "USD",
    "customer_id": "cu_1725352656",
    "customer": {
        "id": "cu_1725352656",
        "name": "Redacted",
        "email": "Redacted",
        "phone": "Redacted",
        "phone_country_code": "Redacted"
    },
    "description": "Its my first payment request",
    "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": "0119",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": null,
            "payment_checks": {
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "card_verification": null
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_XPgomv4iZkbxp4PX9Jrt",
    "shipping": {
        "address": {
            "city": "Redacted",
            "country": "US",
            "line1": "Redacted",
            "line2": "Redacted",
            "line3": "Redacted",
            "zip": "Redacted",
            "state": "Redacted",
            "first_name": "Redacted",
            "last_name": "Redacted"
        },
        "phone": {
            "number": "Redacted",
            "country_code": "Redacted"
        },
        "email": "Redacted"
    },
    "billing": {
        "address": {
            "city": "Redacted",
            "country": "US",
            "line1": "Redacted",
            "line2": "Redacted",
            "line3": "Redacted",
            "zip": "Redacted",
            "state": "Redacted",
            "first_name": "Redacted",
            "last_name": "Redacted"
        },
        "phone": {
            "number": "Redacted",
            "country_code": "Redacted"
        },
        "email": "Redacted"
    },
    "order_details": null,
    "email": "Redacted",
    "name": "Redacted",
    "phone": "Redacted",
    "return_url": "http://127.0.0.1:4040/",
    "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": 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": "7253526568986196003955",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_5zhIYYmNTX8Tt5aBhh9L_1",
    "payment_link": null,
    "profile_id": "pro_pCmVCFH8Jh9CRAOq71tG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HLz5UXL0F35JM3QsRh6f",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-03T08:52:35.629Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "125.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_2HS0C3hN1bhCisZRiHRB",
    "payment_method_status": null,
    "updated": "2024-09-03T08:37:38.445Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}

-> sync

curl --location 'http://localhost:8080/payments/pay_5zhIYYmNTX8Tt5aBhh9L' \
--header 'Accept: application/json' \
--header 'api-key: dev_RPC8caLJDX8s4AFPVxr0KCy6UOTSJNs7IjbfK9WmkDddIBTfibFPBuQxM4A1nKu0'
{
    "payment_id": "pay_5zhIYYmNTX8Tt5aBhh9L",
    "merchant_id": "merchant_1725352456",
    "status": "succeeded",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 0,
    "amount_received": 100,
    "connector": "cybersource",
    "client_secret": "pay_5zhIYYmNTX8Tt5aBhh9L_secret_7ZVEnylnSEZT4hzpqmWS",
    "created": "2024-09-03T08:37:35.629Z",
    "currency": "USD",
    "customer_id": "cu_1725352656",
    "customer": {
        "id": "cu_1725352656",
        "name": "Redacted",
        "email": "Redacted",
        "phone": "Redacted",
        "phone_country_code": "Redacted"
    },
    "description": "Its my first payment request",
    "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": "0119",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": null,
            "payment_checks": {
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "card_verification": null
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_XPgomv4iZkbxp4PX9Jrt",
    "shipping": {
        "address": {
            "city": "Redacted",
            "country": "US",
            "line1": "Redacted",
            "line2": "Redacted",
            "line3": "Redacted",
            "zip": "Redacted",
            "state": "Redacted",
            "first_name": "Redacted",
            "last_name": "Redacted"
        },
        "phone": {
            "number": "Redacted",
            "country_code": "Redacted"
        },
        "email": "Redacted"
    },
    "billing": {
        "address": {
            "city": "Redacted",
            "country": "US",
            "line1": "Redacted",
            "line2": "Redacted",
            "line3": "Redacted",
            "zip": "Redacted",
            "state": "Redacted",
            "first_name": "Redacted",
            "last_name": "Redacted"
        },
        "phone": {
            "number": "Redacted",
            "country_code": "Redacted"
        },
        "email": "Redacted"
    },
    "order_details": null,
    "email": "Redacted",
    "name": "Redacted",
    "phone": "Redacted",
    "return_url": "http://127.0.0.1:4040/",
    "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": 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": "7253526568986196003955",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_5zhIYYmNTX8Tt5aBhh9L_1",
    "payment_link": null,
    "profile_id": "pro_pCmVCFH8Jh9CRAOq71tG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HLz5UXL0F35JM3QsRh6f",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-03T08:52:35.629Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "125.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_2HS0C3hN1bhCisZRiHRB",
    "payment_method_status": null,
    "updated": "2024-09-03T08:37:38.445Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}

-> Create a 3DS payment

{
    "amount": 100,
    "amount_to_capture": 100,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "cu_{{$timestamp}}",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "three_ds",
    "setup_future_usage": "on_session",
    "return_url": "http://127.0.0.1:4040",
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "in sit",
            "user_agent": "amet irure esse"
        }
    },
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "card_number": "4000000000000119",
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "card_cvc": "838"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX",
            "last_name": "ss"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX"
        }
    },
    "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": "125.0.0.1"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}
{
    "payment_id": "pay_41DjpxBAJQivxfQeKPv8",
    "merchant_id": "merchant_1725352456",
    "status": "requires_customer_action",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 100,
    "amount_received": null,
    "connector": "cybersource",
    "client_secret": "pay_41DjpxBAJQivxfQeKPv8_secret_3smf34QBXKWJtCauS4jm",
    "created": "2024-09-03T08:40:44.643Z",
    "currency": "USD",
    "customer_id": "cu_1725352845",
    "customer": {
        "id": "cu_1725352845",
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0119",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": null,
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_QQOmOKb72IHX9oc0V6pi",
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": null
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": "San",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": "ss"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "http://127.0.0.1:4040/",
    "authentication_type": "three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_41DjpxBAJQivxfQeKPv8/merchant_1725352456/pay_41DjpxBAJQivxfQeKPv8_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": "cu_1725352845",
        "created_at": 1725352844,
        "expires": 1725356444,
        "secret": "epk_1a74a81a985a417fbcea5ec3740c3945"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_41DjpxBAJQivxfQeKPv8_1",
    "payment_link": null,
    "profile_id": "pro_pCmVCFH8Jh9CRAOq71tG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HLz5UXL0F35JM3QsRh6f",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-03T08:55:44.643Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "125.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": "2024-09-03T08:40:46.043Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}

-> Perform the 3DS action
-> Delete the customer
-> Retrieve the payment

curl --location 'http://localhost:8080/payments/pay_41DjpxBAJQivxfQeKPv8' \
--header 'Accept: application/json' \
--header 'api-key: dev_RPC8caLJDX8s4AFPVxr0KCy6UOTSJNs7IjbfK9WmkDddIBTfibFPBuQxM4A1nKu0'
{
    "payment_id": "pay_41DjpxBAJQivxfQeKPv8",
    "merchant_id": "merchant_1725352456",
    "status": "succeeded",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 0,
    "amount_received": 100,
    "connector": "cybersource",
    "client_secret": "pay_41DjpxBAJQivxfQeKPv8_secret_3smf34QBXKWJtCauS4jm",
    "created": "2024-09-03T08:40:44.643Z",
    "currency": "USD",
    "customer_id": "cu_1725352845",
    "customer": {
        "id": "cu_1725352845",
        "name": "Redacted",
        "email": "Redacted",
        "phone": "Redacted",
        "phone_country_code": "Redacted"
    },
    "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": "0119",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": null,
            "payment_checks": {
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "card_verification": null
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_QQOmOKb72IHX9oc0V6pi",
    "shipping": {
        "address": {
            "city": "Redacted",
            "country": "US",
            "line1": "Redacted",
            "line2": "Redacted",
            "line3": "Redacted",
            "zip": "Redacted",
            "state": "Redacted",
            "first_name": "Redacted",
            "last_name": "Redacted"
        },
        "phone": {
            "number": "Redacted",
            "country_code": "Redacted"
        },
        "email": "Redacted"
    },
    "billing": {
        "address": {
            "city": "Redacted",
            "country": "US",
            "line1": "Redacted",
            "line2": "Redacted",
            "line3": "Redacted",
            "zip": "Redacted",
            "state": "Redacted",
            "first_name": "Redacted",
            "last_name": "Redacted"
        },
        "phone": {
            "number": "Redacted",
            "country_code": "Redacted"
        },
        "email": "Redacted"
    },
    "order_details": null,
    "email": "Redacted",
    "name": "Redacted",
    "phone": "Redacted",
    "return_url": "http://127.0.0.1:4040/",
    "authentication_type": "three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": 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": "7253528712066298603955",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_41DjpxBAJQivxfQeKPv8_1",
    "payment_link": null,
    "profile_id": "pro_pCmVCFH8Jh9CRAOq71tG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HLz5UXL0F35JM3QsRh6f",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-03T08:55:44.643Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "125.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_wxeK1LrwVZaeHOYeMqYu",
    "payment_method_status": null,
    "updated": "2024-09-03T08:41:12.583Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}
curl --location 'http://localhost:8080/payments/pay_41DjpxBAJQivxfQeKPv8?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_RPC8caLJDX8s4AFPVxr0KCy6UOTSJNs7IjbfK9WmkDddIBTfibFPBuQxM4A1nKu0'
{
    "payment_id": "pay_41DjpxBAJQivxfQeKPv8",
    "merchant_id": "merchant_1725352456",
    "status": "succeeded",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 0,
    "amount_received": 100,
    "connector": "cybersource",
    "client_secret": "pay_41DjpxBAJQivxfQeKPv8_secret_3smf34QBXKWJtCauS4jm",
    "created": "2024-09-03T08:40:44.643Z",
    "currency": "USD",
    "customer_id": "cu_1725352845",
    "customer": {
        "id": "cu_1725352845",
        "name": "Redacted",
        "email": "Redacted",
        "phone": "Redacted",
        "phone_country_code": "Redacted"
    },
    "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": "0119",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": null,
            "payment_checks": {
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "card_verification": null
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_QQOmOKb72IHX9oc0V6pi",
    "shipping": {
        "address": {
            "city": "Redacted",
            "country": "US",
            "line1": "Redacted",
            "line2": "Redacted",
            "line3": "Redacted",
            "zip": "Redacted",
            "state": "Redacted",
            "first_name": "Redacted",
            "last_name": "Redacted"
        },
        "phone": {
            "number": "Redacted",
            "country_code": "Redacted"
        },
        "email": "Redacted"
    },
    "billing": {
        "address": {
            "city": "Redacted",
            "country": "US",
            "line1": "Redacted",
            "line2": "Redacted",
            "line3": "Redacted",
            "zip": "Redacted",
            "state": "Redacted",
            "first_name": "Redacted",
            "last_name": "Redacted"
        },
        "phone": {
            "number": "Redacted",
            "country_code": "Redacted"
        },
        "email": "Redacted"
    },
    "order_details": null,
    "email": "Redacted",
    "name": "Redacted",
    "phone": "Redacted",
    "return_url": "http://127.0.0.1:4040/",
    "authentication_type": "three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": 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": "7253528712066298603955",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_41DjpxBAJQivxfQeKPv8_1",
    "payment_link": null,
    "profile_id": "pro_pCmVCFH8Jh9CRAOq71tG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HLz5UXL0F35JM3QsRh6f",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-03T08:55:44.643Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "125.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_wxeK1LrwVZaeHOYeMqYu",
    "payment_method_status": null,
    "updated": "2024-09-03T08:41:12.583Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}

-> Create a payment with manual capture

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_0GFABoDSJOBz6xazfsPttF4srDNXV6bFjsg9u5Uyt0z2hNGnyluDlVHf0GjU7qUm' \
--data-raw '{
    "amount": 100,
    "amount_to_capture": 100,
    "currency": "USD",
    "confirm": true,
    "capture_method": "manual",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "cu_1724853507",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "setup_future_usage": "on_session",
    "return_url": "http://127.0.0.1:4040",
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "in sit",
            "user_agent": "amet irure esse"
        }
    },
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "card_number": "4000000000000119",
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "card_cvc": "838"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX",
            "last_name": "ss"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX"
        }
    },
    "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": "125.0.0.1"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'
{
    "payment_id": "pay_AwRQSrjv0N7tQEYzZnQ1",
    "merchant_id": "merchant_1725352456",
    "status": "requires_capture",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 100,
    "amount_received": null,
    "connector": "cybersource",
    "client_secret": "pay_AwRQSrjv0N7tQEYzZnQ1_secret_VGJkIXf0NncMLVeXfMcX",
    "created": "2024-09-03T08:45:14.448Z",
    "currency": "USD",
    "customer_id": "cu_1724853507",
    "customer": {
        "id": "cu_1724853507",
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0119",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": null,
            "payment_checks": {
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "card_verification": null
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_rs2SpEaYBN0nGtwNEyGa",
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": null
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": "San",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": "ss"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "http://127.0.0.1:4040/",
    "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": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "cu_1724853507",
        "created_at": 1725353114,
        "expires": 1725356714,
        "secret": "epk_a1e4edaf5d4d4db986de6299d40e2c1d"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7253531155796565703954",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_AwRQSrjv0N7tQEYzZnQ1_1",
    "payment_link": null,
    "profile_id": "pro_pCmVCFH8Jh9CRAOq71tG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HLz5UXL0F35JM3QsRh6f",
    "incremental_authorization_allowed": true,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-03T09:00:14.448Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "125.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": "2024-09-03T08:45:16.897Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}

-> Delete the customer

curl --location --request DELETE 'http://localhost:8080/customers/cu_1724853507' \
--header 'Accept: application/json' \
--header 'api-key: dev_RPC8caLJDX8s4AFPVxr0KCy6UOTSJNs7IjbfK9WmkDddIBTfibFPBuQxM4A1nKu0'
{
    "customer_id": "cu_1724853507",
    "customer_deleted": true,
    "address_deleted": true,
    "payment_methods_deleted": true
}

-> Retrieve payment

curl --location 'http://localhost:8080/payments/pay_AwRQSrjv0N7tQEYzZnQ1' \
--header 'Accept: application/json' \
--header 'api-key: dev_RPC8caLJDX8s4AFPVxr0KCy6UOTSJNs7IjbfK9WmkDddIBTfibFPBuQxM4A1nKu0'
{
    "payment_id": "pay_AwRQSrjv0N7tQEYzZnQ1",
    "merchant_id": "merchant_1725352456",
    "status": "requires_capture",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 100,
    "amount_received": null,
    "connector": "cybersource",
    "client_secret": "pay_AwRQSrjv0N7tQEYzZnQ1_secret_VGJkIXf0NncMLVeXfMcX",
    "created": "2024-09-03T08:45:14.448Z",
    "currency": "USD",
    "customer_id": "cu_1724853507",
    "customer": {
        "id": "cu_1724853507",
        "name": "Redacted",
        "email": "Redacted",
        "phone": "Redacted",
        "phone_country_code": "Redacted"
    },
    "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": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0119",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": null,
            "payment_checks": {
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "card_verification": null
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_rs2SpEaYBN0nGtwNEyGa",
    "shipping": {
        "address": {
            "city": "Redacted",
            "country": "US",
            "line1": "Redacted",
            "line2": "Redacted",
            "line3": "Redacted",
            "zip": "Redacted",
            "state": "Redacted",
            "first_name": "Redacted",
            "last_name": "Redacted"
        },
        "phone": {
            "number": "Redacted",
            "country_code": "Redacted"
        },
        "email": "Redacted"
    },
    "billing": {
        "address": {
            "city": "Redacted",
            "country": "US",
            "line1": "Redacted",
            "line2": "Redacted",
            "line3": "Redacted",
            "zip": "Redacted",
            "state": "Redacted",
            "first_name": "Redacted",
            "last_name": "Redacted"
        },
        "phone": {
            "number": "Redacted",
            "country_code": "Redacted"
        },
        "email": "Redacted"
    },
    "order_details": null,
    "email": "Redacted",
    "name": "Redacted",
    "phone": "Redacted",
    "return_url": "http://127.0.0.1:4040/",
    "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": 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": "7253531155796565703954",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_AwRQSrjv0N7tQEYzZnQ1_1",
    "payment_link": null,
    "profile_id": "pro_pCmVCFH8Jh9CRAOq71tG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HLz5UXL0F35JM3QsRh6f",
    "incremental_authorization_allowed": true,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-03T09:00:14.448Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "125.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_ZLuJJO15IFfb9jvoHjIb",
    "payment_method_status": null,
    "updated": "2024-09-03T08:45:16.897Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}
curl --location 'http://localhost:8080/payments/pay_AwRQSrjv0N7tQEYzZnQ1?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_RPC8caLJDX8s4AFPVxr0KCy6UOTSJNs7IjbfK9WmkDddIBTfibFPBuQxM4A1nKu0'
{
    "payment_id": "pay_AwRQSrjv0N7tQEYzZnQ1",
    "merchant_id": "merchant_1725352456",
    "status": "requires_capture",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 100,
    "amount_received": null,
    "connector": "cybersource",
    "client_secret": "pay_AwRQSrjv0N7tQEYzZnQ1_secret_VGJkIXf0NncMLVeXfMcX",
    "created": "2024-09-03T08:45:14.448Z",
    "currency": "USD",
    "customer_id": "cu_1724853507",
    "customer": {
        "id": "cu_1724853507",
        "name": "Redacted",
        "email": "Redacted",
        "phone": "Redacted",
        "phone_country_code": "Redacted"
    },
    "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": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0119",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": null,
            "payment_checks": {
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "card_verification": null
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_rs2SpEaYBN0nGtwNEyGa",
    "shipping": {
        "address": {
            "city": "Redacted",
            "country": "US",
            "line1": "Redacted",
            "line2": "Redacted",
            "line3": "Redacted",
            "zip": "Redacted",
            "state": "Redacted",
            "first_name": "Redacted",
            "last_name": "Redacted"
        },
        "phone": {
            "number": "Redacted",
            "country_code": "Redacted"
        },
        "email": "Redacted"
    },
    "billing": {
        "address": {
            "city": "Redacted",
            "country": "US",
            "line1": "Redacted",
            "line2": "Redacted",
            "line3": "Redacted",
            "zip": "Redacted",
            "state": "Redacted",
            "first_name": "Redacted",
            "last_name": "Redacted"
        },
        "phone": {
            "number": "Redacted",
            "country_code": "Redacted"
        },
        "email": "Redacted"
    },
    "order_details": null,
    "email": "Redacted",
    "name": "Redacted",
    "phone": "Redacted",
    "return_url": "http://127.0.0.1:4040/",
    "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": 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": "7253531155796565703954",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "7253531155796565703954",
    "payment_link": null,
    "profile_id": "pro_pCmVCFH8Jh9CRAOq71tG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HLz5UXL0F35JM3QsRh6f",
    "incremental_authorization_allowed": true,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-03T09:00:14.448Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "125.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_ZLuJJO15IFfb9jvoHjIb",
    "payment_method_status": null,
    "updated": "2024-09-03T08:47:14.334Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}

-> Guest customer
Create a payment

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_RPC8caLJDX8s4AFPVxr0KCy6UOTSJNs7IjbfK9WmkDddIBTfibFPBuQxM4A1nKu0' \
--data-raw '{
    "amount": 100,
    "amount_to_capture": 100,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",

    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "http://127.0.0.1:4040",
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "in sit",
            "user_agent": "amet irure esse"
        }
    },
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "card_number": "4000000000000119",
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "card_cvc": "838"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX",
            "last_name": "ss"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX"
        }
    },
    "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": "125.0.0.1"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'
{
    "payment_id": "pay_v5429vfsJdjtaQqhhNMB",
    "merchant_id": "merchant_1725352456",
    "status": "succeeded",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 0,
    "amount_received": 100,
    "connector": "cybersource",
    "client_secret": "pay_v5429vfsJdjtaQqhhNMB_secret_G7epyOKsACfNDr0Sgivo",
    "created": "2024-09-03T08:48:12.266Z",
    "currency": "USD",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0119",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": null,
            "payment_checks": {
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "card_verification": null
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_2LY32nDUPNvVLcg6hDiu",
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": null
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": "San",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": "ss"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "http://127.0.0.1:4040/",
    "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": 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": "7253532925156616403954",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_v5429vfsJdjtaQqhhNMB_1",
    "payment_link": null,
    "profile_id": "pro_pCmVCFH8Jh9CRAOq71tG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HLz5UXL0F35JM3QsRh6f",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-03T09:03:12.266Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "125.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": "2024-09-03T08:48:13.596Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}

Payments retrieve

curl --location 'http://localhost:8080/payments/pay_v5429vfsJdjtaQqhhNMB?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_RPC8caLJDX8s4AFPVxr0KCy6UOTSJNs7IjbfK9WmkDddIBTfibFPBuQxM4A1nKu0'
{
    "payment_id": "pay_v5429vfsJdjtaQqhhNMB",
    "merchant_id": "merchant_1725352456",
    "status": "succeeded",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 0,
    "amount_received": 100,
    "connector": "cybersource",
    "client_secret": "pay_v5429vfsJdjtaQqhhNMB_secret_G7epyOKsACfNDr0Sgivo",
    "created": "2024-09-03T08:48:12.266Z",
    "currency": "USD",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0119",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": null,
            "payment_checks": {
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "card_verification": null
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_2LY32nDUPNvVLcg6hDiu",
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": null
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": "San",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": "ss"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "http://127.0.0.1:4040/",
    "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": 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": "7253532925156616403954",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_v5429vfsJdjtaQqhhNMB_1",
    "payment_link": null,
    "profile_id": "pro_pCmVCFH8Jh9CRAOq71tG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HLz5UXL0F35JM3QsRh6f",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-03T09:03:12.266Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "125.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": "2024-09-03T08:48:13.596Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}

-> Customer details are sent in the customer object

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_RPC8caLJDX8s4AFPVxr0KCy6UOTSJNs7IjbfK9WmkDddIBTfibFPBuQxM4A1nKu0' \
--data-raw '{
    "amount": 100,
    "amount_to_capture": 100,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
"customer": {
        "id": "cu_1725353517",
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "http://127.0.0.1:4040",
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "in sit",
            "user_agent": "amet irure esse"
        }
    },
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "card_number": "4000000000000119",
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "card_cvc": "838"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX",
            "last_name": "ss"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX"
        }
    },
    "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": "125.0.0.1"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'
{
    "payment_id": "pay_RJBqVC4xSMkv9YqojScT",
    "merchant_id": "merchant_1725352456",
    "status": "succeeded",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 0,
    "amount_received": 100,
    "connector": "cybersource",
    "client_secret": "pay_RJBqVC4xSMkv9YqojScT_secret_OpoEIrC5SEX8D1lejuya",
    "created": "2024-09-03T08:51:51.753Z",
    "currency": "USD",
    "customer_id": "cu_1725353512",
    "customer": {
        "id": "cu_1725353512",
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0119",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": null,
            "payment_checks": {
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "card_verification": null
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_UNh5IWViTJSnR6DmWnMi",
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": null
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": "San",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": "ss"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "http://127.0.0.1:4040/",
    "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": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "cu_1725353512",
        "created_at": 1725353511,
        "expires": 1725357111,
        "secret": "epk_c5c3bbc2a43b4effb8b7af30f23c8119"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7253535128366701403954",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_RJBqVC4xSMkv9YqojScT_1",
    "payment_link": null,
    "profile_id": "pro_pCmVCFH8Jh9CRAOq71tG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HLz5UXL0F35JM3QsRh6f",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-03T09:06:51.753Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "125.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": "2024-09-03T08:51:53.907Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}

-> Delete a customer and retrieve a payment

{
    "payment_id": "pay_RJBqVC4xSMkv9YqojScT",
    "merchant_id": "merchant_1725352456",
    "status": "succeeded",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 0,
    "amount_received": 100,
    "connector": "cybersource",
    "client_secret": "pay_RJBqVC4xSMkv9YqojScT_secret_OpoEIrC5SEX8D1lejuya",
    "created": "2024-09-03T08:51:51.753Z",
    "currency": "USD",
    "customer_id": "cu_1725353512",
    "customer": {
        "id": "cu_1725353512",
        "name": "Redacted",
        "email": "Redacted",
        "phone": "Redacted",
        "phone_country_code": "Redacted"
    },
    "description": "Its my first payment request",
    "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": "0119",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "400000",
            "card_extended_bin": null,
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_holder_name": null,
            "payment_checks": {
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "card_verification": null
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_UNh5IWViTJSnR6DmWnMi",
    "shipping": {
        "address": {
            "city": "Redacted",
            "country": "US",
            "line1": "Redacted",
            "line2": "Redacted",
            "line3": "Redacted",
            "zip": "Redacted",
            "state": "Redacted",
            "first_name": "Redacted",
            "last_name": "Redacted"
        },
        "phone": {
            "number": "Redacted",
            "country_code": "Redacted"
        },
        "email": "Redacted"
    },
    "billing": {
        "address": {
            "city": "Redacted",
            "country": "US",
            "line1": "Redacted",
            "line2": "Redacted",
            "line3": "Redacted",
            "zip": "Redacted",
            "state": "Redacted",
            "first_name": "Redacted",
            "last_name": "Redacted"
        },
        "phone": {
            "number": "Redacted",
            "country_code": "Redacted"
        },
        "email": "Redacted"
    },
    "order_details": null,
    "email": "Redacted",
    "name": "Redacted",
    "phone": "Redacted",
    "return_url": "http://127.0.0.1:4040/",
    "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": 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": "7253535128366701403954",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_RJBqVC4xSMkv9YqojScT_1",
    "payment_link": null,
    "profile_id": "pro_pCmVCFH8Jh9CRAOq71tG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HLz5UXL0F35JM3QsRh6f",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-03T09:06:51.753Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "125.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_jzj3gJnY1vfjSBWttyeg",
    "payment_method_status": null,
    "updated": "2024-09-03T08:51:53.907Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": 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

@ShankarSinghC ShankarSinghC added A-core Area: Core flows C-bug Category: Bug A-payments Area: payments labels Aug 28, 2024
@ShankarSinghC ShankarSinghC self-assigned this Aug 28, 2024
@ShankarSinghC ShankarSinghC requested a review from a team as a code owner August 28, 2024 10:40
Copy link

semanticdiff-com bot commented Aug 28, 2024

Review changes with SemanticDiff.

Analyzed 5 of 5 files.

Overall, the semantic diff is 17% smaller than the GitHub diff.

Filename Status
✔️ crates/router/src/db/customers.rs Analyzed
✔️ crates/router/src/db/kafka_store.rs Analyzed
✔️ crates/router/src/core/payments/helpers.rs Analyzed
✔️ crates/router/src/core/payments/operations.rs Analyzed
✔️ crates/router/src/core/payments/transformers.rs 75.6% smaller

Narayanbhat166
Narayanbhat166 previously approved these changes Aug 29, 2024
@Narayanbhat166
Copy link
Contributor

should we send the customer details ( which are redacted ). This behaviour, where we are saying that the customer id is null is not consistent. If customer_id was passed in the request, it should be in the response too.

@likhinbopanna likhinbopanna added this pull request to the merge queue Sep 3, 2024
Merged via the queue into main with commit 98cfc13 Sep 3, 2024
22 checks passed
@likhinbopanna likhinbopanna deleted the fix-customer/psync-flow branch September 3, 2024 11:09
pixincreate added a commit that referenced this pull request Sep 5, 2024
* 'main' of github.com:juspay/hyperswitch:
  feat(customer_v2): Add customer V2 delete api (#5518)
  chore(version): 2024.09.05.0
  feat(user_roles): get user role details (#5777)
  feat(users): Add profile level invites (#5793)
  refactor(router): profile based routes for payouts (#5794)
  Feat(connector): [Fiuu] Add Card Flows (#5786)
  fix(cypress): fix fiservemea configs for cypress (#5772)
  fix(cypress): `api_key` check in cypress (#5787)
  feat(payment_methods_v2): Implemented Diesel and Domain models for v2 (#5700)
  fix(payout): query for getting a list of active payout IDs (#5771)
  refactor(router): remove admin v2 intermediate features (#5780)
  feat(revert): populate payment method details in payments response (#5785)
  chore(version): 2024.09.04.0
  fix(connector): skip 3DS in `network_transaction_id` flow for cybersource (#5781)
  refactor(euclid): check the authenticity of profile_id being used (#5647)
  feat(analytics): refactor and introduce analytics APIs to accommodate OrgLevel, MerchantLevel and ProfileLevel authentication (#5729)
  fix(router): make customer details None in the `Psync` flow if the customer is deleted (#5732)
  feat(connector): [DEUTSCHE] Add template code (#5774)
  chore(version): 2024.09.03.1
  fix(router): send post message to window.parent instead of window.top in external 3ds flow (#5778)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows A-payments Area: payments C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make customer details None in the Psync flow if the customer is deleted
4 participants