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(core): [Stripe] add bank debits payment method to stripe #906

Merged
merged 17 commits into from
Apr 21, 2023

Conversation

Narayanbhat166
Copy link
Member

@Narayanbhat166 Narayanbhat166 commented Apr 18, 2023

Type of Change

  • New feature

Description

This PR will add support for creating payments using bank_debits payment method. This has been implemented for stripe.
Mandate details have to passed for all the payment methods.

  • Sample mandate data
{
"mandate_data": {
        "customer_acceptance": {
            "acceptance_type": "online",
            "accepted_at": "2022-09-10T10:11:12Z",
            "online": {
                "ip_address": "123.32.25.123",
                "user_agent": "Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36"
            }
        },
        "mandate_type": {
            "single_use": {
                "amount": 6540,
                "currency": "USD"
            }
        }
    },
}
  • Ach Bank debit in US. Create a merchant_connector_account with business_country as US.
{
"currency":"USD",
"business_country": "US",
"payment_method": "bank_debit",
    "payment_method_type": "ach",
    "payment_method_data": {
        "bank_debit": {
            "ach_bank_debit": {
                "billing_details": {
                    "name": "John Doe",
                    "email": "[email protected]"
                },
                "account_number": "000123456789",
                "routing_number": "110000000"
            }
        }
    }
}
  • Sepa. Create a merchant_connector_account in any country of the EU region, example "FR".
{
"currency":"EUR",
"business_country":"FR",
"payment_method": "bank_debit",
    "payment_method_type": "sepa",
    "payment_method_data": {
        "bank_debit": {
            "sepa_bank_debit": {
                "billing_details": {
                    "name": "John Doe",
                    "email": "[email protected]"
                },
                "iban": "DE89370400440532013000"
            }
        }
    }
}
  • Becs. Create a merchant_connector_account in AU region.
{
"currency":"AUD",
"payment_method": "bank_debit",
    "payment_method_type": "becs",
    "payment_method_data": {
        "bank_debit": {
            "becs_bank_debit": {
                "billing_details": {
                    "name": "John Doe",
                    "email": "[email protected]"
                },
                "account_number": "000123456",
                "bsb_number": "000000"
            }
        }
    }
}
  • Bacs
{
"payment_method_type": "bacs",
    "payment_method_data": {
        "bank_debit": {
            "bacs_bank_debit": {
                "billing_details": {
                    "name": "John Doe",
                    "email": "[email protected]",
                    "address": {
                        "line1": "Street",
                        "line2": "Area",
                        "city": "LDN",
                        "zip": "SW1A",
                        "country": "GB"
                    }
                },
                "account_number": "00012345",
                "sort_code": "108800"
            }
        }
    }
}

Motivation and Context

To support bank_debits payment method for anyone to use. Closes #838

How did you test it?

  • ACH bank debit

Screenshot 2023-04-18 at 12 43 41 PM

- Microdeposit verification for ACH

Screenshot 2023-04-18 at 12 45 26 PM

  • Sepa bank debit

Screenshot 2023-04-18 at 12 56 24 PM

  • Bacs bank debit
    The payment goes to requires_action. This requires some options to be enabled in stripe account.

  • Becs bank debit

Screenshot 2023-04-19 at 12 50 14 PM

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@Narayanbhat166 Narayanbhat166 added A-connector-compatibility Area: Connector compatibility A-core Area: Core flows M-api-contract-changes Metadata: This PR involves API contract changes labels Apr 18, 2023
@Narayanbhat166 Narayanbhat166 self-assigned this Apr 18, 2023
@Narayanbhat166 Narayanbhat166 requested review from a team as code owners April 18, 2023 07:35
@Narayanbhat166 Narayanbhat166 requested review from jagan-jaya and Abhicodes-crypto and removed request for Abhicodes-crypto April 19, 2023 07:20
@Narayanbhat166 Narayanbhat166 added the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Apr 19, 2023
Copy link
Contributor

@Abhicodes-crypto Abhicodes-crypto left a comment

Choose a reason for hiding this comment

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

LGTM

@jarnura jarnura added the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label Apr 20, 2023
@Narayanbhat166 Narayanbhat166 added A-payment-methods Area: Payment Methods and removed A-connector-compatibility Area: Connector compatibility A-core Area: Core flows labels Apr 20, 2023
@Narayanbhat166 Narayanbhat166 added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed and removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels Apr 20, 2023
@jarnura jarnura added S-ready-for-merge and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Apr 20, 2023
jarnura
jarnura previously approved these changes Apr 20, 2023
@jarnura jarnura enabled auto-merge April 21, 2023 07:07
@jarnura jarnura added the S-waiting-on-approval Status: Review completed, awaiting for approvals from code-owners label Apr 21, 2023
Copy link
Contributor

@Abhicodes-crypto Abhicodes-crypto left a comment

Choose a reason for hiding this comment

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

LGTM

@jarnura jarnura added this pull request to the merge queue Apr 21, 2023
@jarnura jarnura removed the S-waiting-on-approval Status: Review completed, awaiting for approvals from code-owners label Apr 21, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Apr 21, 2023
@SanchithHegde SanchithHegde added this pull request to the merge queue Apr 21, 2023
Merged via the queue into main with commit f624eb5 Apr 21, 2023
@SanchithHegde SanchithHegde deleted the feat/bank_debits branch April 21, 2023 17:32
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 M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add support for Bank Debits payment method
5 participants