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(stripe): send billing address to stripe for card payment #3611

Conversation

Narayanbhat166
Copy link
Member

Type of Change

  • Enhancement

Description

Pass billing details to stripe in case of card payment.

Motivation and Context

This PR will pass the billing_address to stripe for card payment

How did you test it?

  • Create a payment using billing address and customer email.
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'api-key:<API-KEY>' \
--data-raw '{
    "amount": 6969,
    "currency": "USD",
    "confirm": true,
    "name": "John Dough",
    "capture_method": "automatic",
    "phone": "999999999",
    "setup_future_usage": "off_session",
    "phone_country_code": "+65",
    "customer_id": "cus_PAxm0MeCGM5TowgDKPc9",
    "email": "[email protected]",
    "description": "Its my third 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": "Harrisoff Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "Narayan",
            "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": "hola",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "key1":"hello"
    }
}'
  • Check the billing address 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 A-connector-compatibility Area: Connector compatibility label Feb 9, 2024
@Narayanbhat166 Narayanbhat166 added this to the February 2024 Release milestone Feb 9, 2024
@Narayanbhat166 Narayanbhat166 self-assigned this Feb 9, 2024
@Narayanbhat166 Narayanbhat166 requested a review from a team as a code owner February 9, 2024 07:37
@Narayanbhat166 Narayanbhat166 changed the title enhance(stripe): send billing address to stripe for card payment feat(stripe): send billing address to stripe for card payment Feb 9, 2024
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Feb 12, 2024
Merged via the queue into main with commit 67df984 Feb 12, 2024
14 of 18 checks passed
@Gnanasundari24 Gnanasundari24 deleted the 4150-refactor-send-billing-address-to-stripe-for-card-payment-method branch February 12, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-compatibility Area: Connector compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants