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(connector): [Deutschebank] Implement Card 3ds #6844

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Debarshi-Gupta
Copy link

@Debarshi-Gupta Debarshi-Gupta commented Dec 16, 2024

Type of Change

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

Description

Implement Card 3ds for Deutschebank

Additional Changes

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

Motivation and Context

https://testmerch.directpos.de/rest-api/apidoc/v2.1/index.html#creditCard3DSecureInitializingThePaymentSsteps1_4

How did you test it?

Cypress Tests

1. No3DSManualCapture

image

2. 3DSAutoCapture

image

3. 3DSManualCapture

image

4. No3DSAutoCapture

image

5. VoidPayment

image

6. SyncPayment

image

7. RefundPayment

image

8. SyncRefund

image

Note: Currently, no 3ds for card payments are not being supported for Deutschebank. Hence, no 3ds flows are expected to return an error message saying that the payment method type is not supported, and has been handled in the cypress tests accordingly.

Postman Tests

1. Authorize (Manual)

  • Request
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_o6c9H4UPb00h8hMpjOww9sHv5IWOqwTuJrNC45fOVdUdPOs0sjRQ7peoX7KgqRWp' \
--data-raw '{
    "amount": 6540,
    "currency": "USD",
    "confirm": true,
    "business_country": "US",
    "business_label": "default",
    "capture_method": "manual",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 6540,
    "customer_id": "cybersourcecustomer",
    "email": "[email protected]",
    "name": "Cardholder",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "authentication_type": "three_ds",
    "return_url": "https://duck.com",
    "payment_method": "card",
    "payment_method_type": "debit",
    "payment_method_data": {
        "card": {
            "card_number": "4761739090000088",
            "card_exp_month": "12",
            "card_exp_year": "34",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        }
    },
    "customer_acceptance": {
        "acceptance_type": "online"
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "sundari",
            "last_name": "sundari"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "sundari",
            "last_name": "sundari"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "count_tickets": 1,
        "transaction_number": "5590045"
    }
}'
  • Response
{
    "payment_id": "pay_PS9a7QNMXDs1Qr3GjLSV",
    "merchant_id": "postman_merchant_GHAction_89b212fc-9f25-469f-ba4b-1a3288efcdd6",
    "status": "requires_customer_action",
    "amount": 6540,
    "net_amount": 6540,
    "shipping_cost": null,
    "amount_capturable": 6540,
    "amount_received": null,
    "connector": "deutschebank",
    "client_secret": "pay_PS9a7QNMXDs1Qr3GjLSV_secret_dfXLVVwCzeorfBNuOGCD",
    "created": "2024-12-16T11:36:46.533Z",
    "currency": "USD",
    "customer_id": "cybersourcecustomer",
    "customer": {
        "id": "cybersourcecustomer",
        "name": "Cardholder",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "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": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0088",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "476173",
            "card_extended_bin": null,
            "card_exp_month": "12",
            "card_exp_year": "34",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "sundari",
            "last_name": "sundari"
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "sundari",
            "last_name": "sundari"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "Cardholder",
    "phone": "999999999",
    "return_url": "https://duck.com/",
    "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_PS9a7QNMXDs1Qr3GjLSV/postman_merchant_GHAction_89b212fc-9f25-469f-ba4b-1a3288efcdd6/pay_PS9a7QNMXDs1Qr3GjLSV_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "debit",
    "connector_label": "deutschebank_US_default",
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "cybersourcecustomer",
        "created_at": 1734349006,
        "expires": 1734352606,
        "secret": "epk_0036b25eb0ef4d599e0b2957ff64beb3"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "count_tickets": 1,
        "transaction_number": "5590045"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_hwz1M9UiyP6KcFovaoe2",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_tQJBbQeTqAOBfStOjwz6",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-12-16T11:51:46.533Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-12-16T11:36:49.083Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null
}

2. Capture (Manual)

  • Request
curl --location 'http://localhost:8080/payments/pay_PS9a7QNMXDs1Qr3GjLSV/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_o6c9H4UPb00h8hMpjOww9sHv5IWOqwTuJrNC45fOVdUdPOs0sjRQ7peoX7KgqRWp' \
--data '{
    "amount_to_capture": 6540,
    "statement_descriptor_name": "Joseph",
    "statement_descriptor_suffix": "JS"
}'
  • Response
{
    "payment_id": "pay_PS9a7QNMXDs1Qr3GjLSV",
    "merchant_id": "postman_merchant_GHAction_89b212fc-9f25-469f-ba4b-1a3288efcdd6",
    "status": "succeeded",
    "amount": 6540,
    "net_amount": 6540,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 6540,
    "connector": "deutschebank",
    "client_secret": "pay_PS9a7QNMXDs1Qr3GjLSV_secret_dfXLVVwCzeorfBNuOGCD",
    "created": "2024-12-16T11:36:46.533Z",
    "currency": "USD",
    "customer_id": "cybersourcecustomer",
    "customer": {
        "id": "cybersourcecustomer",
        "name": "Cardholder",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "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": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0088",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "476173",
            "card_extended_bin": null,
            "card_exp_month": "12",
            "card_exp_year": "34",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "sundari",
            "last_name": "sundari"
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "sundari",
            "last_name": "sundari"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "Cardholder",
    "phone": "999999999",
    "return_url": "https://duck.com/",
    "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": "debit",
    "connector_label": "deutschebank_US_default",
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "nAYkZmc4a3I6pxU53fJzNP",
    "frm_message": null,
    "metadata": {
        "count_tickets": 1,
        "transaction_number": "5590045"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_hwz1M9UiyP6KcFovaoe2",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_tQJBbQeTqAOBfStOjwz6",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-12-16T11:51:46.533Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_RncRqkyYbJrKGoU8Ywnr",
    "payment_method_status": null,
    "updated": "2024-12-16T11:37:16.619Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null
}

3. Authorize + Capture

  • Request
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_o6c9H4UPb00h8hMpjOww9sHv5IWOqwTuJrNC45fOVdUdPOs0sjRQ7peoX7KgqRWp' \
--data-raw '{
    "amount": 6540,
    "currency": "USD",
    "confirm": true,
    "business_country": "US",
    "business_label": "default",
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 6540,
    "customer_id": "cybersourcecustomer",
    "email": "[email protected]",
    "name": "Cardholder",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "authentication_type": "three_ds",
    "return_url": "https://duck.com",
    "payment_method": "card",
    "payment_method_type": "debit",
    "payment_method_data": {
        "card": {
            "card_number": "4761739090000088",
            "card_exp_month": "12",
            "card_exp_year": "34",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        }
    },
    "customer_acceptance": {
        "acceptance_type": "online"
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "sundari",
            "last_name": "sundari"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "sundari",
            "last_name": "sundari"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "count_tickets": 1,
        "transaction_number": "5590045"
    }
}'
  • Response
{
    "payment_id": "pay_4ueYRDmGUyI31AuqI0ea",
    "merchant_id": "postman_merchant_GHAction_89b212fc-9f25-469f-ba4b-1a3288efcdd6",
    "status": "requires_customer_action",
    "amount": 6540,
    "net_amount": 6540,
    "shipping_cost": null,
    "amount_capturable": 6540,
    "amount_received": null,
    "connector": "deutschebank",
    "client_secret": "pay_4ueYRDmGUyI31AuqI0ea_secret_IixVMy93O7YiEP4JJGpN",
    "created": "2024-12-16T11:43:10.558Z",
    "currency": "USD",
    "customer_id": "cybersourcecustomer",
    "customer": {
        "id": "cybersourcecustomer",
        "name": "Cardholder",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "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": "0088",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "476173",
            "card_extended_bin": null,
            "card_exp_month": "12",
            "card_exp_year": "34",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "sundari",
            "last_name": "sundari"
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "sundari",
            "last_name": "sundari"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "Cardholder",
    "phone": "999999999",
    "return_url": "https://duck.com/",
    "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_4ueYRDmGUyI31AuqI0ea/postman_merchant_GHAction_89b212fc-9f25-469f-ba4b-1a3288efcdd6/pay_4ueYRDmGUyI31AuqI0ea_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "debit",
    "connector_label": "deutschebank_US_default",
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "cybersourcecustomer",
        "created_at": 1734349390,
        "expires": 1734352990,
        "secret": "epk_df66b67348a9425dabef0cf41381d6f4"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "count_tickets": 1,
        "transaction_number": "5590045"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_hwz1M9UiyP6KcFovaoe2",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_tQJBbQeTqAOBfStOjwz6",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-12-16T11:58:10.558Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-12-16T11:43:14.008Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null
}

4. PSync

  • Request
curl --location 'http://localhost:8080/payments/pay_4ueYRDmGUyI31AuqI0ea?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_o6c9H4UPb00h8hMpjOww9sHv5IWOqwTuJrNC45fOVdUdPOs0sjRQ7peoX7KgqRWp'
  • Response
{
    "payment_id": "pay_4ueYRDmGUyI31AuqI0ea",
    "merchant_id": "postman_merchant_GHAction_89b212fc-9f25-469f-ba4b-1a3288efcdd6",
    "status": "succeeded",
    "amount": 6540,
    "net_amount": 6540,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 6540,
    "connector": "deutschebank",
    "client_secret": "pay_4ueYRDmGUyI31AuqI0ea_secret_IixVMy93O7YiEP4JJGpN",
    "created": "2024-12-16T11:43:10.558Z",
    "currency": "USD",
    "customer_id": "cybersourcecustomer",
    "customer": {
        "id": "cybersourcecustomer",
        "name": "Cardholder",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "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": "0088",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "476173",
            "card_extended_bin": null,
            "card_exp_month": "12",
            "card_exp_year": "34",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "sundari",
            "last_name": "sundari"
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "sundari",
            "last_name": "sundari"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "Cardholder",
    "phone": "999999999",
    "return_url": "https://duck.com/",
    "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": "debit",
    "connector_label": "deutschebank_US_default",
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "nVHvIf4P3jcAovFh4yPRTj",
    "frm_message": null,
    "metadata": {
        "count_tickets": 1,
        "transaction_number": "5590045"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_hwz1M9UiyP6KcFovaoe2",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_tQJBbQeTqAOBfStOjwz6",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-12-16T11:58:10.558Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_nsOk8a7WMuZY0WZfZaNb",
    "payment_method_status": "active",
    "updated": "2024-12-16T11:45:26.008Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null
}

5. Refund

  • Request
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_o6c9H4UPb00h8hMpjOww9sHv5IWOqwTuJrNC45fOVdUdPOs0sjRQ7peoX7KgqRWp' \
--data '{
    "payment_id": "pay_ySLbJ4uxZJbOwybYIOxJ",
    "amount": 6540,
    "reason": "Customer returned product",
    "refund_type": "instant",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'
  • Response
{
    "refund_id": "ref_UbPDiWkAlJ3YXxAVydkh",
    "payment_id": "pay_ySLbJ4uxZJbOwybYIOxJ",
    "amount": 6540,
    "currency": "USD",
    "status": "succeeded",
    "reason": "Customer returned product",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "error_message": null,
    "error_code": null,
    "created_at": "2024-12-16T11:47:19.520Z",
    "updated_at": "2024-12-16T11:47:21.373Z",
    "connector": "deutschebank",
    "profile_id": "pro_hwz1M9UiyP6KcFovaoe2",
    "merchant_connector_id": "mca_tQJBbQeTqAOBfStOjwz6",
    "split_refunds": null
}

6. RSync

  • Request
curl --location 'http://localhost:8080/refunds/ref_UbPDiWkAlJ3YXxAVydkh' \
--header 'Accept: application/json' \
--header 'api-key: dev_o6c9H4UPb00h8hMpjOww9sHv5IWOqwTuJrNC45fOVdUdPOs0sjRQ7peoX7KgqRWp'
  • Response
{
    "refund_id": "ref_UbPDiWkAlJ3YXxAVydkh",
    "payment_id": "pay_ySLbJ4uxZJbOwybYIOxJ",
    "amount": 6540,
    "currency": "USD",
    "status": "succeeded",
    "reason": "Customer returned product",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "error_message": null,
    "error_code": null,
    "created_at": "2024-12-16T11:47:19.520Z",
    "updated_at": "2024-12-16T11:47:21.373Z",
    "connector": "deutschebank",
    "profile_id": "pro_hwz1M9UiyP6KcFovaoe2",
    "merchant_connector_id": "mca_tQJBbQeTqAOBfStOjwz6",
    "split_refunds": null
}

7. Cancel/Void

  • Request
curl --location 'http://localhost:8080/payments/pay_jtzc7sPBlQ6sNNgoPG7D/cancel' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_o6c9H4UPb00h8hMpjOww9sHv5IWOqwTuJrNC45fOVdUdPOs0sjRQ7peoX7KgqRWp' \
--data '{
    "cancellation_reason": "requested_by_customer"
}'
  • Response
{
    "payment_id": "pay_jtzc7sPBlQ6sNNgoPG7D",
    "merchant_id": "postman_merchant_GHAction_89b212fc-9f25-469f-ba4b-1a3288efcdd6",
    "status": "cancelled",
    "amount": 6540,
    "net_amount": 6540,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": "deutschebank",
    "client_secret": "pay_jtzc7sPBlQ6sNNgoPG7D_secret_nRyINaFU4g6pBbm8id0r",
    "created": "2024-12-16T11:51:03.676Z",
    "currency": "USD",
    "customer_id": "cybersourcecustomer",
    "customer": {
        "id": "cybersourcecustomer",
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "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": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0088",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "476173",
            "card_extended_bin": null,
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "likhin",
            "last_name": "bopanna"
        },
        "phone": null,
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "likhin",
            "last_name": "bopanna"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://duck.com/",
    "authentication_type": "three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": "requested_by_customer",
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": 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": "pZEtlCeAsWQZqLpBNhZto5",
    "frm_message": null,
    "metadata": {
        "count_tickets": 1,
        "transaction_number": "5590045"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_hwz1M9UiyP6KcFovaoe2",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_tQJBbQeTqAOBfStOjwz6",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-12-16T12:06:03.676Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_lbLyNoKaCcTRjxwQKYON",
    "payment_method_status": null,
    "updated": "2024-12-16T11:51:35.365Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_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

@Debarshi-Gupta Debarshi-Gupta added the A-connector-integration Area: Connector integration label Dec 16, 2024
@Debarshi-Gupta Debarshi-Gupta requested review from a team as code owners December 16, 2024 08:25
@Debarshi-Gupta Debarshi-Gupta linked an issue Dec 16, 2024 that may be closed by this pull request
2 tasks
@Debarshi-Gupta Debarshi-Gupta requested a review from a team as a code owner December 18, 2024 04:24
AkshayaFoiger
AkshayaFoiger previously approved these changes Dec 19, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] [Deutschebank] : Implement 3ds Card Flow
4 participants