-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
refactor: add encryption support to payment attempt domain model #5882
Merged
Gnanasundari24
merged 11 commits into
main
from
add-encryption-support-payment-attempt-domain-model
Sep 17, 2024
Merged
refactor: add encryption support to payment attempt domain model #5882
Gnanasundari24
merged 11 commits into
main
from
add-encryption-support-payment-attempt-domain-model
Sep 17, 2024
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
…ion` implementation to correct module
…ent attempt to allow usage of encrypted fields
…hich call `Conversion` impls
…e which calls `Conversion` impls
SanchithHegde
added
A-framework
Area: Framework
S-waiting-on-review
Status: This PR has been implemented and needs to be reviewed
C-refactor
Category: Refactor
api-v2
labels
Sep 13, 2024
SanchithHegde
requested review from
jarnura,
Narayanbhat166,
Aprabhat19 and
ThisIsMani
September 13, 2024 10:28
SanchithHegde
changed the title
Add encryption support payment attempt domain model
refactor: add encryption support to payment attempt domain model
Sep 13, 2024
jarnura
requested changes
Sep 16, 2024
jarnura
approved these changes
Sep 16, 2024
Chethan-rao
approved these changes
Sep 17, 2024
ThisIsMani
approved these changes
Sep 17, 2024
Narayanbhat166
approved these changes
Sep 17, 2024
conn, | ||
dsl::attempt_id | ||
.eq(self.attempt_id.to_owned()) | ||
.and(dsl::merchant_id.eq(self.merchant_id.to_owned())), |
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.
later this would be only based on attempt id
async fn find_payment_attempt_by_attempt_id_merchant_id( | ||
&self, | ||
attempt_id: &str, | ||
merchant_id: &id_type::MerchantId, | ||
storage_scheme: storage_enums::MerchantStorageScheme, | ||
) -> error_stack::Result<PaymentAttempt, errors::StorageError>; | ||
|
||
#[cfg(all(feature = "v2", feature = "payment_v2"))] | ||
async fn find_payment_attempt_by_attempt_id_merchant_id( |
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.
TODO: remove merchant_id
from here. Just to confirm, if id
is a global id then we do not need merchant_id
in the query right @jarnura?
Gnanasundari24
deleted the
add-encryption-support-payment-attempt-domain-model
branch
September 17, 2024 11:21
SanchithHegde
removed
the
S-waiting-on-review
Status: This PR has been implemented and needs to be reviewed
label
Sep 18, 2024
cookieg13
pushed a commit
that referenced
this pull request
Sep 19, 2024
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
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
This PR introduces encryption support for the payment attempt domain model by adding implementations for the
Conversion
andReverseConversion
traits, and adds new methods in thePaymentAttemptInterface
trait for v2 insert, update and find operations which internally call theConversion
/ReverseConversion
implementations. For now, I've ignored the KV implementations for the new v2PaymentAttemptInterface
methods, they just call the underlying PSQL based implementations.In addition, this PR involves the following changes:
Conversion
/ReverseConversion
traits onPaymentIntent
to the correct file.MinorUnit
instead ofi64
for amount values.todo!()
for the v2 implementations.Motivation and Context
This allows for adding new fields in payment attempt types for payments v2, which may need encryption support.
How did you test it?
The new code added in this PR cannot be tested via any APIs, since there are no payments v2 APIs. As for the existing code that was modified, it must be ensured that the existing Postman / Cypress tests should not be affected.
Checklist
cargo +nightly fmt --all
cargo clippy