Skip to content
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

feat(router): [cybersource] add connector_customer_id to TransactionResponse #5549

Closed

Conversation

AkshayaFoiger
Copy link
Contributor

@AkshayaFoiger AkshayaFoiger commented Aug 7, 2024

Type of Change

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

Description

This PR handles storing connector_customer_id after the payment and re-use it for recurring payments.

How did you test it?

  1. Create a non mandate payment with any connector - sanity
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ZYmjlFOTK1YErzE6OCiFHhDxjhvoE7vGg0VSTE62lOiVUWc8iO6g6zHfoMzaIUux' \
--data-raw '{
    "amount": 100,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "testCus_2",
    "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": "https://duck.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number":  "4242424242424242", 
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        }
    },
    "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": "9123456789",
            "country_code": "+91"
        }
    },
    "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": "9123456789",
            "country_code": "+91"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS"  
}'

Response

{
    "payment_id": "pay_jOVgabQ2xC8LLBAuYHWg",
    "merchant_id": "postman_merchant_GHAction_e582a371-8d52-46f9-96c5-5676c6a619a0",
    "status": "succeeded",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 0,
    "amount_received": 100,
    "connector": "bankofamerica",
    "client_secret": "pay_jOVgabQ2xC8LLBAuYHWg_secret_MRz8iPs3LPuR5SSk36q9",
    "created": "2024-08-07T09:21:33.075Z",
    "currency": "USD",
    "customer_id": "testCus_2",
    "customer": {
        "id": "testCus_2",
        "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": "4242",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "424242",
            "card_extended_bin": null,
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": {
                "eci": null,
                "cavv": null,
                "eci_raw": null,
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "approval_code": "831000",
                "card_verification": null,
                "consumer_authentication_response": null
            },
            "authentication_data": {
                "acs_transaction_id": null,
                "system_trace_audit_number": null,
                "retrieval_reference_number": null
            }
        },
        "billing": null
    },
    "payment_token": "token_JLRftCKGTnUD0Uajea69",
    "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": "9123456789",
            "country_code": "+91"
        },
        "email": null
    },
    "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": "9123456789",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://duck.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": "testCus_2",
        "created_at": 1723022493,
        "expires": 1723026093,
        "secret": "epk_2217c99a345641e8bbea8aa29efa1c84"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7230224935126872404951",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_jOVgabQ2xC8LLBAuYHWg_1",
    "payment_link": null,
    "profile_id": "pro_OGAKyhNOvHYtPSh0xW2G",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_GNs56M88WJgBDYvihFsk",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-08-07T09:36:33.075Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-08-07T09:21:34.295Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}
  1. Create a zero Auth mandate payment with Cybersource/BOA and do a recurring payment - in the dashboard check if the customer for recurring payment is valid.
    BOA
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ZYmjlFOTK1YErzE6OCiFHhDxjhvoE7vGg0VSTE62lOiVUWc8iO6g6zHfoMzaIUux' \
--data-raw '{
    "amount": 0,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "testCus_3",
    "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": "https://duck.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number":  "4242424242424242", 
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        }
    },
    "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": "9123456789",
            "country_code": "+91"
        }
    },
    "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": "9123456789",
            "country_code": "+91"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS"
    ,"setup_future_usage": "off_session",
    "payment_type": "setup_mandate",
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "13.232.74.226",
            "user_agent": "amet irure esse"
        }
    }
}'

Response

{
    "payment_id": "pay_fPYErRF8QgAoz3vyluaq",
    "merchant_id": "postman_merchant_GHAction_e582a371-8d52-46f9-96c5-5676c6a619a0",
    "status": "succeeded",
    "amount": 0,
    "net_amount": 0,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": "bankofamerica",
    "client_secret": "pay_fPYErRF8QgAoz3vyluaq_secret_2a2wUZb9BnMBslBBMPG6",
    "created": "2024-08-07T09:24:34.308Z",
    "currency": "USD",
    "customer_id": "testCus_3",
    "customer": {
        "id": "testCus_3",
        "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": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "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": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": {
                "eci": null,
                "cavv": null,
                "eci_raw": null,
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "approval_code": "831000",
                "card_verification": null,
                "consumer_authentication_response": null
            },
            "authentication_data": {
                "acs_transaction_id": null,
                "system_trace_audit_number": null,
                "retrieval_reference_number": null
            }
        },
        "billing": null
    },
    "payment_token": "token_1Jgm7BpiJwFAi4Esb4F4",
    "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": "9123456789",
            "country_code": "+91"
        },
        "email": null
    },
    "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": "9123456789",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://duck.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": "testCus_3",
        "created_at": 1723022674,
        "expires": 1723026274,
        "secret": "epk_0a6b2e325b9049108e369021fc98fa10"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7230226758826983504951",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_fPYErRF8QgAoz3vyluaq_1",
    "payment_link": null,
    "profile_id": "pro_OGAKyhNOvHYtPSh0xW2G",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_GNs56M88WJgBDYvihFsk",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-08-07T09:39:34.308Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_nREGI7oJNeed1AyqHdGP",
    "payment_method_status": null,
    "updated": "2024-08-07T09:24:37.402Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}

Recurring Payment

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ZYmjlFOTK1YErzE6OCiFHhDxjhvoE7vGg0VSTE62lOiVUWc8iO6g6zHfoMzaIUux' \
--data '{
    "amount": 999,
    "currency": "USD",
    "confirm": true,
    "customer_id": "testCus_3",
    "return_url": "https://google.com",
    "recurring_details": {
        "type": "payment_method_id",
        "data": "pm_nREGI7oJNeed1AyqHdGP"
    },
    "off_session": true 
}'

Response

{
    "payment_id": "pay_pll3McnwRQ0hBHPte28X",
    "merchant_id": "postman_merchant_GHAction_e582a371-8d52-46f9-96c5-5676c6a619a0",
    "status": "succeeded",
    "amount": 999,
    "net_amount": 999,
    "amount_capturable": 0,
    "amount_received": 999,
    "connector": "bankofamerica",
    "client_secret": "pay_pll3McnwRQ0hBHPte28X_secret_kCL93ZSgck16jLeZXnCJ",
    "created": "2024-08-07T09:25:28.221Z",
    "currency": "USD",
    "customer_id": "testCus_3",
    "customer": {
        "id": "testCus_3",
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "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": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": {
                "eci": null,
                "cavv": null,
                "eci_raw": null,
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "approval_code": "831000",
                "card_verification": null,
                "consumer_authentication_response": null
            },
            "authentication_data": {
                "acs_transaction_id": null,
                "system_trace_audit_number": null,
                "retrieval_reference_number": null
            }
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "testCus_3",
        "created_at": 1723022728,
        "expires": 1723026328,
        "secret": "epk_eebd3af0b46d4d91b98a93586c435021"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7230227286236993704951",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_pll3McnwRQ0hBHPte28X_1",
    "payment_link": null,
    "profile_id": "pro_OGAKyhNOvHYtPSh0xW2G",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_GNs56M88WJgBDYvihFsk",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-08-07T09:40:28.221Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_nREGI7oJNeed1AyqHdGP",
    "payment_method_status": "active",
    "updated": "2024-08-07T09:25:29.510Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}
  1. Create a mandate with Cybersource/BOA and do a recurring payment - in the dashboard check if the customer for recurring payment is valid.
    BOA
    Customer Initiated
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ZYmjlFOTK1YErzE6OCiFHhDxjhvoE7vGg0VSTE62lOiVUWc8iO6g6zHfoMzaIUux' \
--data-raw '{
    "amount": 1000,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "testCus_3",
    "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": "https://duck.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number":  "4242424242424242", 
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        }
    },
    "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": "9123456789",
            "country_code": "+91"
        }
    },
    "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": "9123456789",
            "country_code": "+91"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS"
    ,"setup_future_usage": "off_session",
    
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "13.232.74.226",
            "user_agent": "amet irure esse"
        }
    }
}'

Response

{
    "payment_id": "pay_M1ApVTc31Rq376hFVRDh",
    "merchant_id": "postman_merchant_GHAction_e582a371-8d52-46f9-96c5-5676c6a619a0",
    "status": "succeeded",
    "amount": 1000,
    "net_amount": 1000,
    "amount_capturable": 0,
    "amount_received": 1000,
    "connector": "bankofamerica",
    "client_secret": "pay_M1ApVTc31Rq376hFVRDh_secret_SkfBP15P5b20MyWcRyYe",
    "created": "2024-08-07T09:26:31.873Z",
    "currency": "USD",
    "customer_id": "testCus_3",
    "customer": {
        "id": "testCus_3",
        "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": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "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": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": {
                "eci": null,
                "cavv": null,
                "eci_raw": null,
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "approval_code": "831000",
                "card_verification": null,
                "consumer_authentication_response": null
            },
            "authentication_data": {
                "acs_transaction_id": null,
                "system_trace_audit_number": null,
                "retrieval_reference_number": null
            }
        },
        "billing": null
    },
    "payment_token": "token_BU18UprDKVHvEZERFzYl",
    "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": "9123456789",
            "country_code": "+91"
        },
        "email": null
    },
    "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": "9123456789",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://duck.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": "testCus_3",
        "created_at": 1723022791,
        "expires": 1723026391,
        "secret": "epk_bc6643c961194025a3ac351e4c25543f"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7230227923096060504953",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_M1ApVTc31Rq376hFVRDh_1",
    "payment_link": null,
    "profile_id": "pro_OGAKyhNOvHYtPSh0xW2G",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_GNs56M88WJgBDYvihFsk",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-08-07T09:41:31.873Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_t25MlHwU3DOBMJueyapG",
    "payment_method_status": null,
    "updated": "2024-08-07T09:26:33.314Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}

Merachant Initiated Transaction

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ZYmjlFOTK1YErzE6OCiFHhDxjhvoE7vGg0VSTE62lOiVUWc8iO6g6zHfoMzaIUux' \
--data '{
    "amount": 999,
    "currency": "USD",
    "confirm": true,
    "customer_id": "testCus_3",
    "return_url": "https://google.com",
    "recurring_details": {
        "type": "payment_method_id",
        "data": "pm_t25MlHwU3DOBMJueyapG"
    },
    "off_session": true    
}'

Response

{
    "payment_id": "pay_Ad46Ljk1lKJby5cuBwcQ",
    "merchant_id": "postman_merchant_GHAction_e582a371-8d52-46f9-96c5-5676c6a619a0",
    "status": "succeeded",
    "amount": 999,
    "net_amount": 999,
    "amount_capturable": 0,
    "amount_received": 999,
    "connector": "bankofamerica",
    "client_secret": "pay_Ad46Ljk1lKJby5cuBwcQ_secret_HEfA7Q0oDWxiYCBJ2ztm",
    "created": "2024-08-07T09:27:26.435Z",
    "currency": "USD",
    "customer_id": "testCus_3",
    "customer": {
        "id": "testCus_3",
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "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": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": {
                "eci": null,
                "cavv": null,
                "eci_raw": null,
                "avs_response": {
                    "code": "Y",
                    "codeRaw": "Y"
                },
                "approval_code": "831000",
                "card_verification": null,
                "consumer_authentication_response": null
            },
            "authentication_data": {
                "acs_transaction_id": null,
                "system_trace_audit_number": null,
                "retrieval_reference_number": null
            }
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "testCus_3",
        "created_at": 1723022846,
        "expires": 1723026446,
        "secret": "epk_9dc846e2477f45fe9cee51af27a54714"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7230228468276025404951",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_Ad46Ljk1lKJby5cuBwcQ_1",
    "payment_link": null,
    "profile_id": "pro_OGAKyhNOvHYtPSh0xW2G",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_GNs56M88WJgBDYvihFsk",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-08-07T09:42:26.435Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_t25MlHwU3DOBMJueyapG",
    "payment_method_status": "active",
    "updated": "2024-08-07T09:27:27.570Z",
    "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

@AkshayaFoiger AkshayaFoiger requested review from a team as code owners August 7, 2024 06:17
@AkshayaFoiger AkshayaFoiger linked an issue Aug 7, 2024 that may be closed by this pull request
2 tasks
@AkshayaFoiger AkshayaFoiger self-assigned this Aug 7, 2024
@AkshayaFoiger AkshayaFoiger added A-connector-integration Area: Connector integration A-core Area: Core flows A-customers Area: Customer Flow/API's A-mandates Area: Mandate Flows labels Aug 7, 2024
@AkshayaFoiger
Copy link
Contributor Author

Closing this PR as it no more solves the issue and induces complexity

@SanchithHegde SanchithHegde deleted the store-connector-customer-id/transactionRespons branch September 1, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration A-core Area: Core flows A-customers Area: Customer Flow/API's A-mandates Area: Mandate Flows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]: add connector_customer_id to TransactionResponse
1 participant