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

refactor(payment_methods): Unify bank types across payment methods/payouts #5099

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

Conversation

Sarthak1799
Copy link
Contributor

…d payouts

Type of Change

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

Description

Unified bank types across payment methods and payouts.

Additional Changes

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

Motivation and Context

How did you test it?

Create a payment method with the new bank type

curl --location --request POST 'http:https://localhost:8080/payment_methods' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_cHN6hMdCFUUrNWjYSxnwhiuMsg83rXTX9jBmtHmCL6sq9a43PswY304MSt3a9blR' \
--data-raw '{
    "customer_id": "cus_LALaPcTuxxmCBORKevPC",
    "payment_method": "bank_transfer",
    "bank_transfer": {
        "bank_account_data": {
            "ach": {
                "bank_account_number": "000123456",
                "bank_routing_number": "110000000"
            }
        }
    }
}'

Response -

{
    "merchant_id": "sarthak1",
    "customer_id": "cus_LALaPcTuxxmCBORKevPC",
    "payment_method_id": "pm_fvuJyhwwOdSYjkv3xXV5",
    "payment_method": "bank_transfer",
    "payment_method_type": null,
    "card": null,
    "recurring_enabled": false,
    "installment_payment_enabled": false,
    "payment_experience": [
        "redirect_to_url"
    ],
    "metadata": null,
    "created": "2024-06-24T10:07:09.264Z",
    "bank_transfer": {
        "bank_name": null,
        "bank_country_code": null,
        "bank_city": null,
        "bank_branch": null,
        "bank_account_data": {
            "ach": {
                "bank_account_number": "000123456",
                "bank_routing_number": "110000000"
            }
        }
    },
    "last_used_at": "2024-06-24T10:07:09.264Z",
    "client_secret": "pm_fvuJyhwwOdSYjkv3xXV5_secret_sxRtjLR6g2sgPErCOg8P"
}

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

@Sarthak1799 Sarthak1799 requested review from a team as code owners June 24, 2024 11:02
@Sarthak1799 Sarthak1799 linked an issue Jun 24, 2024 that may be closed by this pull request
@Sarthak1799 Sarthak1799 self-assigned this Jun 24, 2024
@Sarthak1799 Sarthak1799 added A-payment-methods Area: Payment Methods C-refactor Category: Refactor labels Jun 24, 2024
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jun 24, 2024
Copy link
Member

@vspecky vspecky left a comment

Choose a reason for hiding this comment

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

@Sarthak1799 Are we sure this is backwards compatible with what we have currently? If not, what is our migration strategy?

@Sarthak1799 Sarthak1799 requested a review from a team as a code owner July 3, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-payment-methods Area: Payment Methods C-refactor Category: Refactor M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor payment methods to have a unified Bank type
2 participants