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): Added support for pm_auth_connector field in pm list response #2667

Merged
merged 12 commits into from
Nov 21, 2023

Conversation

Sarthak1799
Copy link
Contributor

@Sarthak1799 Sarthak1799 commented Oct 23, 2023

Type of Change

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

Description

Added pm_auth_connector in pm merchant list response as to check the existence of a configured pm_auth connector for a particular payment method type.

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?

  1. create payment -
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_o4ny6FlvTw42CCakP0WmODrBwHRBGA7dT6HFu8IcopsR0Ji41fEr9gnxYDSk22ky' \
--data-raw '{
    "amount": 2000,
    "currency": "USD",
    "confirm": false,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "StripeCustomer1",
    "business_country": "US",
    "business_label": "default",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "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"
            }
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "john",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594430",
            "country_code": "+91"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'
  1. Hit pm list -
curl --location --request GET 'http://localhost:8080/account/payment_methods?client_secret=pay_xHs0dDRaIVtZw2Xa2eAx_secret_VNhu22HNPIATZ9Z3cEEu' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_2f006d520a77471a84f0d69a34e15124'
image

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
  • I added a CHANGELOG entry if applicable

@Sarthak1799 Sarthak1799 requested review from a team as code owners October 23, 2023 11:19
@Sarthak1799 Sarthak1799 self-assigned this Oct 23, 2023
@Sarthak1799 Sarthak1799 added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed A-payment-methods Area: Payment Methods C-refactor Category: Refactor labels Oct 23, 2023
Chethan-rao
Chethan-rao previously approved these changes Oct 25, 2023
vspecky
vspecky previously approved these changes Oct 27, 2023
@vspecky vspecky added the M-api-contract-changes Metadata: This PR involves API contract changes label Oct 27, 2023
@Sarthak1799 Sarthak1799 dismissed stale reviews from Chethan-rao and vspecky via f156bfb October 27, 2023 11:20
@Sarthak1799 Sarthak1799 requested a review from a team as a code owner October 27, 2023 11:20
@preetamrevankar preetamrevankar added this pull request to the merge queue Nov 21, 2023
Merged via the queue into main with commit be4aa3b Nov 21, 2023
10 of 12 checks passed
@preetamrevankar preetamrevankar deleted the pm-auth-response branch November 21, 2023 09:41
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Nov 27, 2023
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.

6 participants