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): send customer_name to connectors when creating customer #3380

Merged
merged 3 commits into from
Jan 22, 2024

Conversation

Narayanbhat166
Copy link
Member

@Narayanbhat166 Narayanbhat166 commented Jan 18, 2024

Type of Change

  • Refactoring

Description

This PR adds the support for sending customer_name to the connectors when creating the customer at the connectors end.

Additional Changes

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

Motivation and Context

Passing customer name to the connector might be required for metadata scanning to evaluate the payment score and risk associated with a payment.

How did you test it?

  • Create a payment for stripe connector with customer id, email and customer name.
curl --location 'https://sandbox.hyperswitch.io/payments' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_16svHskpygTeiHAoy6RsRf3YxKlSV67FhT5P49UvfA73P1sTG1Tm6VG58a2B79Il' \
--data-raw '{
    "amount": 696969,
    "currency": "USD",
    "confirm": true,
    "name": "John Cena",
    "capture_method": "automatic",
    "phone": "999999999",
    "phone_country_code": "+65",
    "customer_id": "new_stripe_customer_7",
    "email": "[email protected]",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "4242424242424242",
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        }
    },
    "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"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "key1":"hello"
    }
}'
  • Check the customer name at stripe dashboard.
image

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code

@Narayanbhat166 Narayanbhat166 added the C-refactor Category: Refactor label Jan 18, 2024
@Narayanbhat166 Narayanbhat166 self-assigned this Jan 18, 2024
@Narayanbhat166 Narayanbhat166 requested review from a team as code owners January 18, 2024 08:58
@Narayanbhat166 Narayanbhat166 linked an issue Jan 18, 2024 that may be closed by this pull request
2 tasks
@Narayanbhat166 Narayanbhat166 changed the title refactor(core): send customer_nameto connectors when creating customer feat(core): send customer_nameto connectors when creating customer Jan 22, 2024
@Narayanbhat166 Narayanbhat166 added this to the December 2023 Release milestone Jan 22, 2024
@vspecky vspecky changed the title feat(core): send customer_nameto connectors when creating customer feat(core): send customer_name to connectors when creating customer Jan 22, 2024
@SanchithHegde SanchithHegde merged commit 7813cee into main Jan 22, 2024
9 of 10 checks passed
@SanchithHegde SanchithHegde deleted the send_customer_name_to_stripe branch January 22, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-refactor Category: Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Pass Customer name to connectors
6 participants