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_method_data): send optional billing details in response #4569

Merged
merged 3 commits into from May 10, 2024

Conversation

Narayanbhat166
Copy link
Member

Type of Change

  • Refactoring

Description

Since the payment_method_billing has been made optional, If passed in the request, it will be present in the response too.

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 with confirm as false and with payment method billing.
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_cgBkVO7LcoXTqBEqqBRZQGfz9utfGqUFm7wBLhU5hm3oD7HHjXteBtzXVxIgpChw' \
--data '{
    "amount": 6540,
    "currency": "USD",
    "confirm": false,
    "customer_id": "cus_PAxm0MeCGM5TowgDKPc9",
    "payment_method_data": {
        "billing": {
            "address": {
                "city": "San Fransico",
                "country": "US",
                "line1": "1467",
                "line2": "Harrison Street",
                "line3": null,
                "zip": "94122",
                "state": "California",
                "first_name": "Narayan",
                "last_name": "Hegde"
            },
            "phone": null,
            "email": null
        }
    }
}'
  • Retrieve the payment and ensure that payment_method_data.billing is present
curl --location 'http://localhost:8080/payments/pay_ANYYJYUlRpU3Wpyqkm8O' \
--header 'Accept: application/json' \
--header 'api-key: dev_cgBkVO7LcoXTqBEqqBRZQGfz9utfGqUFm7wBLhU5hm3oD7HHjXteBtzXVxIgpChw'

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

@Narayanbhat166 Narayanbhat166 added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed C-refactor Category: Refactor labels May 7, 2024
@Narayanbhat166 Narayanbhat166 added this to the May 2024 Release milestone May 7, 2024
@Narayanbhat166 Narayanbhat166 self-assigned this May 7, 2024
@Narayanbhat166 Narayanbhat166 requested review from a team as code owners May 7, 2024 12:05
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue May 10, 2024
Merged via the queue into main with commit 86e0550 May 10, 2024
9 of 12 checks passed
@Gnanasundari24 Gnanasundari24 deleted the send_optional_billing_in_response branch May 10, 2024 09:49
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label May 12, 2024
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.

None yet

5 participants