-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: added client_source, client_version in payment_attempt from payments confirm request headers #4657
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vsrivatsa-juspay
force-pushed
the
feat/client_cols_in_payment_attempts
branch
from
May 15, 2024 15:39
2b9bb55
to
476166f
Compare
vsrivatsa-juspay
changed the title
feat: added client_source, client_version in payment_attempt from PaymentsConfirm request headers
feat: added client_source, client_version in payment_attempt from payments confirm request headers
May 15, 2024
14 tasks
vsrivatsa-juspay
force-pushed
the
feat/client_cols_in_payment_attempts
branch
from
May 16, 2024 13:37
0526edf
to
b6718d2
Compare
…ments confirm request headers
vsrivatsa-juspay
force-pushed
the
feat/client_cols_in_payment_attempts
branch
from
May 16, 2024 13:53
b6718d2
to
64fc200
Compare
…t/client_cols_in_payment_attempts
hrithikesh026
approved these changes
May 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Narayanbhat166
added
C-feature
Category: Feature request or enhancement
M-database-changes
Metadata: This PR involves database schema changes
labels
May 17, 2024
Narayanbhat166
approved these changes
May 17, 2024
apoorvdixit88
approved these changes
May 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dashboard specific changes look fine!
SanchithHegde
approved these changes
May 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-feature
Category: Feature request or enhancement
M-database-changes
Metadata: This PR involves database schema changes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
Added
client_source
,client_version
in payment_attempt from PaymentsConfirm request headersBoth the above columns are of Option type.
Can be used to collect information from client request headers - X-Client-Source and X-Client-Version
Additional Changes
Motivation and Context
closes #4656
How did you test it?
Create a payment intent. Pass confirm: false
curl --location 'localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: some_api_key' \ --data-raw '{ "amount": 6540, "currency": "USD", "confirm" : false, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 6540, "customer_id": "cus_udst2tfldj6upmye2reztkmm4i", "email": "guest@example.com", "name": "John Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "no_three_ds", "payment_method": "card", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "10", "card_exp_year": "35", "card_holder_name": "John Doe", "card_cvc": "123" } }, "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }'
Confirm the payment, pass the X_CLIENT_VERSION and X_CLIENT_SOURCE headers
curl --location 'localhost:8080/payments/pay_YleHqfzluDmuEX7394l7/confirm' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: some_api_key' \ --data '{}'
Check the values in the client_version and client_source columns for the payment
Checklist
cargo +nightly fmt --all
cargo clippy