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

fix(connector): [DEUTSCHE] Trim spaces in IBAN #5978

Merged
merged 1 commit into from
Sep 22, 2024

Conversation

deepanshu-iiitu
Copy link
Contributor

Type of Change

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

Description

Trim the spaces in IBAN before sending it in SEPA Mandate Post and Direct Debit requests for Deutsche Bank.

Additional Changes

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

Motivation and Context

#5976

How did you test it?

Request:

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_2QpEeK0ByPRkb2DPBxHfad4i1WxQO3hZSuVzlFcg9mTrLFUHRpGfE0SCuQwZjGEb' \
--data '{
    "amount": 9000,
    "currency": "EUR",
    "confirm": true,
    "profile_id": "pro_EuXuxP2KVO0m1tlDWSau",
    "customer_id": "customer123",
    "payment_method": "bank_debit",
    "payment_method_type": "sepa",
    "payment_method_data": {
        "bank_debit": {
            "sepa_bank_debit": {
                "iban": "DE87 1234 5678 1234 5678 90"
            }
        }
    },
    "billing": {
        "address": {
            "first_name": "joseph",
            "last_name": "doe"
        }
    },
    "customer_acceptance": {
        "acceptance_type": "offline"
    },
    "setup_future_usage": "off_session"
}'

Response:

{
    "payment_id": "pay_THxTbiKwV1xv7Tmkqe8I",
    "merchant_id": "merchant_1725539597",
    "status": "requires_customer_action",
    "amount": 9000,
    "net_amount": 9000,
    "amount_capturable": 9000,
    "amount_received": null,
    "connector": "deutschebank",
    "client_secret": "pay_THxTbiKwV1xv7Tmkqe8I_secret_hx91jywe0lywBW5UrLb0",
    "created": "2024-09-20T11:05:32.884Z",
    "currency": "EUR",
    "customer_id": "customer123",
    "customer": {
        "id": "customer123",
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "9999999999",
        "phone_country_code": "+1"
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": null,
    "payment_method": "bank_debit",
    "payment_method_data": {
        "bank_debit": {
            "sepa": {
                "iban": "DE87 **** **** **** **78 90",
                "bank_account_holder_name": null
            }
        },
        "billing": null
    },
    "payment_token": "token_LBU2etjaOq7pdJhAPHMk",
    "shipping": null,
    "billing": {
        "address": {
            "city": null,
            "country": null,
            "line1": null,
            "line2": null,
            "line3": null,
            "zip": null,
            "state": null,
            "first_name": "joseph",
            "last_name": "doe"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "9999999999",
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_THxTbiKwV1xv7Tmkqe8I/merchant_1725539597/pay_THxTbiKwV1xv7Tmkqe8I_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "sepa",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "customer123",
        "created_at": 1726830332,
        "expires": 1726833932,
        "secret": "epk_fb2f1bbac4204fc2841fd2b74a295fa0"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_EuXuxP2KVO0m1tlDWSau",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_MZAsrTowXuzpeXl4DMj2",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-09-20T11:20:32.884Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_R9MnbGoavSYoxTmxMiS2",
    "payment_method_status": null,
    "updated": "2024-09-20T11:05:35.073Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": 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

Copy link

semanticdiff-com bot commented Sep 20, 2024

Review changes with SemanticDiff.

Analyzed 1 of 1 files.

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

Filename Status
✔️ crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs 12.09% smaller

@deepanshu-iiitu deepanshu-iiitu linked an issue Sep 20, 2024 that may be closed by this pull request
2 tasks
@deepanshu-iiitu deepanshu-iiitu added A-connector-integration Area: Connector integration C-bug Category: Bug labels Sep 20, 2024
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Sep 22, 2024
Merged via the queue into main with commit 6d8992f Sep 22, 2024
12 of 14 checks passed
@Gnanasundari24 Gnanasundari24 deleted the deutsche-space-trim branch September 22, 2024 18:35
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-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] [DEUTSCHEBANK] Trim the spaces in IBAN
4 participants