Skip to content

Conversation

aadityaguptaa
Copy link

@aadityaguptaa aadityaguptaa commented Sep 23, 2025

Type of Change

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

Description

ADD new payment method for Trustpayments

EPS
SEPA
TRUSTLY
PAYSERA
ALIPAY

Additional Changes

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

Motivation and Context

closes #9543

How did you test it?

EPS

Payment Request
{
    "amount": 333,
    "currency": "EUR",
    "confirm": true,
    "capture_method": "automatic",
    "payment_method": "bank_redirect",
    "payment_method_type": "eps",
    "authentication_type": "no_three_ds",
    "description": "hellow world",
    "billing": {
        "address": {
            "zip": "560095",
            "first_name": "Sakil",
            "last_name": "Mostak",
            "line1": "Fasdf",
            "country": "AT",
            "line2": "Fasdf",
            "city": "Fasdf"
        }
    },
    "payment_method_data": {
        "bank_redirect": {
            "eps": {}
        }
    }
}
Payment Response
{
    "payment_id": "pay_SQxyfc16EqXs539KJpv6",
    "merchant_id": "merchant_1758702323",
    "status": "requires_customer_action",
    "amount": 333,
    "net_amount": 333,
    "shipping_cost": null,
    "amount_capturable": 333,
    "amount_received": null,
    "connector": "trustpayments",
    "client_secret": "pay_SQxyfc16EqXs539KJpv6_secret_dLz6r3Z9kjaI1ygQ2JNI",
    "created": "2025-09-24T08:25:36.876Z",
    "currency": "EUR",
    "customer_id": null,
    "customer": null,
    "description": "hellow world",
    "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": "bank_redirect",
    "payment_method_data": {
        "bank_redirect": {
            "type": "BankRedirectResponse",
            "bank_name": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "Fasdf",
            "country": "AT",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "line3": null,
            "zip": "560095",
            "state": null,
            "first_name": "Sakil",
            "last_name": "Mostak",
            "origin_zip": null
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_SQxyfc16EqXs539KJpv6/merchant_1758702323/pay_SQxyfc16EqXs539KJpv6_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "eps",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "60-86-234827",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "60-86-234827",
    "payment_link": null,
    "profile_id": "pro_lZpUeS9Id0O0s420tFfq",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_VajgNp49zogBKa50PMBV",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-09-24T08:40:36.876Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-09-24T08:25:38.792Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null
}
Confirm page Screenshot 2025-09-24 at 1 57 11 PM
Psync Response
{
    "payment_id": "pay_SQxyfc16EqXs539KJpv6",
    "merchant_id": "merchant_1758702323",
    "status": "succeeded",
    "amount": 333,
    "net_amount": 333,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 333,
    "connector": "trustpayments",
    "client_secret": "pay_SQxyfc16EqXs539KJpv6_secret_dLz6r3Z9kjaI1ygQ2JNI",
    "created": "2025-09-24T08:25:36.876Z",
    "currency": "EUR",
    "customer_id": null,
    "customer": null,
    "description": "hellow world",
    "refunds": null,
    "disputes": null,
    "attempts": [
        {
            "attempt_id": "pay_SQxyfc16EqXs539KJpv6_1",
            "status": "charged",
            "amount": 333,
            "order_tax_amount": null,
            "currency": "EUR",
            "connector": "trustpayments",
            "error_message": null,
            "payment_method": "bank_redirect",
            "connector_transaction_id": "60-86-234827",
            "capture_method": "automatic",
            "authentication_type": "no_three_ds",
            "created_at": "2025-09-24T08:25:36.879Z",
            "modified_at": "2025-09-24T08:30:10.457Z",
            "cancellation_reason": null,
            "mandate_id": null,
            "error_code": null,
            "payment_token": null,
            "connector_metadata": null,
            "payment_experience": null,
            "payment_method_type": "eps",
            "reference_id": "60-86-234827",
            "unified_code": null,
            "unified_message": null,
            "client_source": null,
            "client_version": null
        }
    ],
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "bank_redirect",
    "payment_method_data": {
        "bank_redirect": {
            "type": "BankRedirectResponse",
            "bank_name": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "Fasdf",
            "country": "AT",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "line3": null,
            "zip": "560095",
            "state": null,
            "first_name": "Sakil",
            "last_name": "Mostak",
            "origin_zip": null
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "eps",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "60-86-234827",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "60-86-234827",
    "payment_link": null,
    "profile_id": "pro_lZpUeS9Id0O0s420tFfq",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_VajgNp49zogBKa50PMBV",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-09-24T08:40:36.876Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-09-24T08:30:10.458Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null
}

Paysera

Payment Request
{
    "amount": 333,
    "currency": "EUR",
    "confirm": true,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "payment_method_type": "paysera",
    "authentication_type": "no_three_ds",
    "description": "hellow world",
    "billing": {
        "address": {
            "zip": "560095",
            "first_name": "Sakil",
            "last_name": "Mostak",
            "line1": "Fasdf",
            "country": "EE",
            "line2": "Fasdf",
            "city": "Fasdf"
        }
    },
    "payment_method_data": {
        "wallet": {
            "paysera": {}
        }
    }
}
Payment Response
{
    "payment_id": "pay_ZYrTnj2z4uHgbiIXj503",
    "merchant_id": "merchant_1758704666",
    "status": "requires_customer_action",
    "amount": 333,
    "net_amount": 333,
    "shipping_cost": null,
    "amount_capturable": 333,
    "amount_received": null,
    "connector": "trustpayments",
    "client_secret": "pay_ZYrTnj2z4uHgbiIXj503_secret_4Py4h42c0FxveeVeomUE",
    "created": "2025-09-24T09:04:46.000Z",
    "currency": "EUR",
    "customer_id": null,
    "customer": null,
    "description": "hellow world",
    "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": "wallet",
    "payment_method_data": {
        "wallet": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "Fasdf",
            "country": "EE",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "line3": null,
            "zip": "560095",
            "state": null,
            "first_name": "Sakil",
            "last_name": "Mostak",
            "origin_zip": null
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_ZYrTnj2z4uHgbiIXj503/merchant_1758704666/pay_ZYrTnj2z4uHgbiIXj503_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "paysera",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "60-86-234829",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "60-86-234829",
    "payment_link": null,
    "profile_id": "pro_JD53k6wucSlj9mAljaPD",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_zycr5P8d2W91p7pk8Rtu",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-09-24T09:19:46.000Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-09-24T09:04:47.172Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null
}
Confirm page Screenshot 2025-09-24 at 2 36 29 PM
Psync Response
{
    "payment_id": "pay_ZYrTnj2z4uHgbiIXj503",
    "merchant_id": "merchant_1758704666",
    "status": "succeeded",
    "amount": 333,
    "net_amount": 333,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 333,
    "connector": "trustpayments",
    "client_secret": "pay_ZYrTnj2z4uHgbiIXj503_secret_4Py4h42c0FxveeVeomUE",
    "created": "2025-09-24T09:04:46.000Z",
    "currency": "EUR",
    "customer_id": null,
    "customer": null,
    "description": "hellow world",
    "refunds": null,
    "disputes": null,
    "attempts": [
        {
            "attempt_id": "pay_ZYrTnj2z4uHgbiIXj503_1",
            "status": "charged",
            "amount": 333,
            "order_tax_amount": null,
            "currency": "EUR",
            "connector": "trustpayments",
            "error_message": null,
            "payment_method": "wallet",
            "connector_transaction_id": "60-86-234829",
            "capture_method": "automatic",
            "authentication_type": "no_three_ds",
            "created_at": "2025-09-24T09:04:46.000Z",
            "modified_at": "2025-09-24T09:10:04.032Z",
            "cancellation_reason": null,
            "mandate_id": null,
            "error_code": null,
            "payment_token": null,
            "connector_metadata": null,
            "payment_experience": null,
            "payment_method_type": "paysera",
            "reference_id": "60-86-234829",
            "unified_code": null,
            "unified_message": null,
            "client_source": null,
            "client_version": null
        }
    ],
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "payment_method_data": {
        "wallet": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "Fasdf",
            "country": "EE",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "line3": null,
            "zip": "560095",
            "state": null,
            "first_name": "Sakil",
            "last_name": "Mostak",
            "origin_zip": null
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "paysera",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "60-86-234829",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "60-86-234829",
    "payment_link": null,
    "profile_id": "pro_JD53k6wucSlj9mAljaPD",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_zycr5P8d2W91p7pk8Rtu",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-09-24T09:19:46.000Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-09-24T09:10:04.032Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null
}

TRUSTLY

Payment Request
{
    "amount": 333,
    "currency": "EUR",
    "confirm": true,
    "capture_method": "automatic",
    "payment_method": "bank_redirect",
    "payment_method_type": "trustly",
    "authentication_type": "no_three_ds",
    "description": "hellow world",
    "billing": {
        "address": {
            "zip": "560095",
            "first_name": "Sakil",
            "last_name": "Mostak",
            "line1": "Fasdf",
            "country": "EE",
            "line2": "Fasdf",
            "city": "Fasdf"
        }
    },
    "payment_method_data": {
        "bank_redirect": {
            "trustly": {
                "billing_details": {
                    "billing_name": "John Doe"
                },
                "bank_name": "ing",
                "preferred_language": "en",
                "country": "FI"
            }
        }
    }
}
Payment Response
{
    "payment_id": "pay_Imnm05I4H1BSQtu2zAkq",
    "merchant_id": "merchant_1758705335",
    "status": "requires_customer_action",
    "amount": 333,
    "net_amount": 333,
    "shipping_cost": null,
    "amount_capturable": 333,
    "amount_received": null,
    "connector": "trustpayments",
    "client_secret": "pay_Imnm05I4H1BSQtu2zAkq_secret_mAGOXYMi0qVWw39GZ6C9",
    "created": "2025-09-24T09:18:44.995Z",
    "currency": "EUR",
    "customer_id": null,
    "customer": null,
    "description": "hellow world",
    "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": "bank_redirect",
    "payment_method_data": {
        "bank_redirect": {
            "type": "BankRedirectResponse",
            "bank_name": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "Fasdf",
            "country": "EE",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "line3": null,
            "zip": "560095",
            "state": null,
            "first_name": "Sakil",
            "last_name": "Mostak",
            "origin_zip": null
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_Imnm05I4H1BSQtu2zAkq/merchant_1758705335/pay_Imnm05I4H1BSQtu2zAkq_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "trustly",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "58-86-236470",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "58-86-236470",
    "payment_link": null,
    "profile_id": "pro_IIaBjETi42Iq0nmqumtk",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_ti4DlsV7dW9S8Ni6fIfS",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-09-24T09:33:44.995Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-09-24T09:18:46.567Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null
}
Confirm page Screenshot 2025-09-24 at 1 57 11 PM
Psync Response
{
    "payment_id": "pay_Imnm05I4H1BSQtu2zAkq",
    "merchant_id": "merchant_1758705335",
    "status": "succeeded",
    "amount": 333,
    "net_amount": 333,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 333,
    "connector": "trustpayments",
    "client_secret": "pay_Imnm05I4H1BSQtu2zAkq_secret_mAGOXYMi0qVWw39GZ6C9",
    "created": "2025-09-24T09:18:44.995Z",
    "currency": "EUR",
    "customer_id": null,
    "customer": null,
    "description": "hellow world",
    "refunds": null,
    "disputes": null,
    "attempts": [
        {
            "attempt_id": "pay_Imnm05I4H1BSQtu2zAkq_1",
            "status": "charged",
            "amount": 333,
            "order_tax_amount": null,
            "currency": "EUR",
            "connector": "trustpayments",
            "error_message": null,
            "payment_method": "bank_redirect",
            "connector_transaction_id": "58-86-236470",
            "capture_method": "automatic",
            "authentication_type": "no_three_ds",
            "created_at": "2025-09-24T09:18:44.996Z",
            "modified_at": "2025-09-24T09:25:32.612Z",
            "cancellation_reason": null,
            "mandate_id": null,
            "error_code": null,
            "payment_token": null,
            "connector_metadata": null,
            "payment_experience": null,
            "payment_method_type": "trustly",
            "reference_id": "58-86-236470",
            "unified_code": null,
            "unified_message": null,
            "client_source": null,
            "client_version": null
        }
    ],
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "bank_redirect",
    "payment_method_data": {
        "bank_redirect": {
            "type": "BankRedirectResponse",
            "bank_name": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "Fasdf",
            "country": "EE",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "line3": null,
            "zip": "560095",
            "state": null,
            "first_name": "Sakil",
            "last_name": "Mostak",
            "origin_zip": null
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "trustly",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "58-86-236470",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "58-86-236470",
    "payment_link": null,
    "profile_id": "pro_IIaBjETi42Iq0nmqumtk",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_ti4DlsV7dW9S8Ni6fIfS",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-09-24T09:33:44.995Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-09-24T09:25:32.612Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null
}

ALIPAY

Payment Request
{
    "amount": 333,
    "currency": "EUR",
    "confirm": true,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "payment_method_type": "ali_pay",
    "authentication_type": "no_three_ds",
    "description": "hellow world",
    "billing": {
        "address": {
            "zip": "560095",
            "first_name": "Sakil",
            "last_name": "Mostak",
            "line1": "Fasdf",
            "country": "EE",
            "line2": "Fasdf",
            "city": "Fasdf"
        }
    },
    "payment_method_data": {
        "wallet": {
            "ali_pay_redirect": {
                
            }
        }
    }
}
Payment Response
{
    "payment_id": "pay_ehw19WO0wvj5Bbd7pS4I",
    "merchant_id": "merchant_1758706093",
    "status": "requires_customer_action",
    "amount": 333,
    "net_amount": 333,
    "shipping_cost": null,
    "amount_capturable": 333,
    "amount_received": null,
    "connector": "trustpayments",
    "client_secret": "pay_ehw19WO0wvj5Bbd7pS4I_secret_TqcFU7yMbyCqy3d07BBd",
    "created": "2025-09-24T09:29:13.497Z",
    "currency": "EUR",
    "customer_id": null,
    "customer": null,
    "description": "hellow world",
    "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": "wallet",
    "payment_method_data": {
        "wallet": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "Fasdf",
            "country": "EE",
            "line1": "Fasdf",
            "line2": "Fasdf",
            "line3": null,
            "zip": "560095",
            "state": null,
            "first_name": "Sakil",
            "last_name": "Mostak",
            "origin_zip": null
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_ehw19WO0wvj5Bbd7pS4I/merchant_1758706093/pay_ehw19WO0wvj5Bbd7pS4I_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "ali_pay",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "59-85-5631",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "59-85-5631",
    "payment_link": null,
    "profile_id": "pro_7UyhbC1NNcLHwHrl3XRb",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_ytxRTzaUUElTTCmmtdOu",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-09-24T09:44:13.497Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-09-24T09:29:14.277Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null
}
Confirm page Not able to test it because of alipay sandbox error

<Screenshot 2025-09-24 at 3 02 21 PM

SEPA

TODO

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

@aadityaguptaa aadityaguptaa requested review from a team as code owners September 23, 2025 10:28
Copy link

semanticdiff-com bot commented Sep 23, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs  23% smaller
  config/config.example.toml Unsupported file format
  config/development.toml Unsupported file format
  crates/connector_configs/toml/development.toml Unsupported file format
  crates/connector_configs/toml/production.toml Unsupported file format
  crates/connector_configs/toml/sandbox.toml Unsupported file format
  crates/hyperswitch_connectors/src/connectors/trustpayments.rs  0% smaller
  crates/payment_methods/src/configs/payment_connector_required_fields.rs  0% smaller

@aadityaguptaa aadityaguptaa changed the title feat(connector) integration eps sepa trustly paysera alipay feat(connector): [TRUSTPAYMENTS] Add eps sepa trustly paysera alipay payments Sep 23, 2025
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Sep 23, 2025
@aadityaguptaa aadityaguptaa force-pushed the feat/trustpayments_integration-eps-sepa-trustly-paysera-alipay branch from 2fa07d8 to 3d3e3e4 Compare September 24, 2025 06:50
@hyperswitch-bot hyperswitch-bot bot removed the M-api-contract-changes Metadata: This PR involves API contract changes label Sep 24, 2025
@aadityaguptaa aadityaguptaa changed the title feat(connector): [TRUSTPAYMENTS] Add eps sepa trustly paysera alipay payments feat(connector): [Trustpayments] Integrate EPS, TRUSTLY, PAYSERA, ALIPAY, SEPA Sep 24, 2025
@aadityaguptaa aadityaguptaa added the A-connector-integration Area: Connector integration label Sep 24, 2025
@aadityaguptaa aadityaguptaa force-pushed the feat/trustpayments_integration-eps-sepa-trustly-paysera-alipay branch from 8c83817 to 34355ff Compare September 24, 2025 12:33
@deepanshu-iiitu deepanshu-iiitu removed request for a team September 25, 2025 07:56
@deepanshu-iiitu deepanshu-iiitu added the C-feature Category: Feature request or enhancement label Sep 25, 2025
Comment on lines 344 to 345
pub billingfirstname: Option<String>,
pub billinglastname: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the PII fields secret

@juspay juspay deleted a comment from aadityaguptaa Sep 26, 2025
api_key = "API Key"

[gigadat]
[gigadat.connector_auth.HeaderKey]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this change

Comment on lines +7161 to +7162
[gigadat.connector_auth.HeaderKey]
api_key = "API Key"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

Comment on lines +332 to +336
pub pan: Option<cards::CardNumber>,
pub expirydate: Option<Secret<String>>,
pub securitycode: Option<Secret<String>>,
pub credentialsonfile: Option<String>,
pub settlestatus: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont make individual fields optional
Create a struct and add fields there, use the struct here and flatten it

Comment on lines +412 to +413
Some(common_enums::CaptureMethod::Automatic) | None => vec!["AUTH".to_string()],
Some(common_enums::CaptureMethod::Manual) => vec!["AUTH".to_string()],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we sending AUTH for both Automatic and Manual captures?

Comment on lines +373 to +396
PaymentMethodData::Card(req_card) => Self::build_card_request(item, &auth, &req_card),
PaymentMethodData::BankRedirect(bank_redirect_data) => match bank_redirect_data {
BankRedirectData::Eps { .. } => Self::build_eps_request(item, &auth),
BankRedirectData::Trustly { .. } => Self::build_trustly_request(item, &auth),
_ => Err(errors::ConnectorError::NotImplemented(
"Bank redirect method not supported".to_string(),
)
.into()),
},
PaymentMethodData::Wallet(wallet_data) => match wallet_data {
WalletData::AliPayRedirect { .. } => Self::build_alipay_request(item, &auth),
WalletData::Paysera(_) => Self::build_paysera_request(item, &auth),
_ => Err(errors::ConnectorError::NotImplemented(
"Wallet method not supported".to_string(),
)
.into()),
},
PaymentMethodData::BankTransfer(bank_transfer_data) => match &*bank_transfer_data {
BankTransferData::SepaBankTransfer { .. } => Self::build_sepa_request(item, &auth),
_ => Err(errors::ConnectorError::NotImplemented(
"Bank transfer method not supported".to_string(),
)
.into()),
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use TryFrom's instead of functions

Comment on lines +498 to +504
billingfirstname: item.router_data.get_optional_billing_first_name(),
billinglastname: item.router_data.get_optional_billing_last_name(),
billingcountryiso2a: item
.router_data
.get_optional_billing_country()
.map(|country| country.to_string()),
billingemail: item.router_data.get_optional_billing_email(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these fields are optional then why have you added them in crates/payment_methods/src/configs/payment_connector_required_fields.rs for EPS?

}
Some(TrustpaymentsSettleStatus::PendingSettlementRedirect) => {
// settlestatus "10" = Pending settlement. The initial status after a successful AUTH request, indicating funds have not yet been settled
common_enums::AttemptStatus::Authorizing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
common_enums::AttemptStatus::Authorizing
common_enums::AttemptStatus::Pending

Comment on lines +748 to +750
} else if self.authcode.is_some() {
// For card payments with authcode
self.map_settlestatus_to_attempt_status(common_enums::AttemptStatus::Authorized)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is default Authorized?

common_enums::AttemptStatus::Voided
}
Some(TrustpaymentsSettleStatus::PendingSettlementRedirect) => {
common_enums::AttemptStatus::Authorizing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
common_enums::AttemptStatus::Authorizing
common_enums::AttemptStatus::Pending

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Trustpayments - Integrate eps, sepa, trustly, paysera and alipay payments
3 participants