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(order_details): Adding order_details both inside and outside of metadata, in payments request, for backward compatibility #1344

Merged
merged 13 commits into from
Jun 14, 2023

Conversation

rishavkar
Copy link
Contributor

Adding order_details both inside and outside of metadata, in payments request, for backward compatibility

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Previously order_details was inside metadata as an object.
But we want to keep order_details outside metadata, as an array of objects.
So accepting both of these order_details, for backward compatibility.
If we accept order_details inside metadata in Payments_create, we also need to send it inside metadata for payment update and confirm, and vice versa.
Also, order_details cannot be passed both inside and outside metadata for payments request.

Additional Changes

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

DB change: field "order_details" added to payment_intent
API contract change: payments request has an extra field "order_details"

Motivation and Context

How did you test it?

https://docs.google.com/document/d/18NuXDQdSGTIjpJsVULs19XQHNFmygdJdCPA8J5_PfJw/edit

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@rishavkar rishavkar requested review from a team as code owners June 3, 2023 09:56
@github-actions github-actions bot added the S-conventions-not-followed Status: This PR does not follow contributing guidelines label Jun 3, 2023
@rishavkar rishavkar self-assigned this Jun 3, 2023
@rishavkar rishavkar added A-connector-compatibility Area: Connector compatibility C-feature Category: Feature request or enhancement M-database-changes Metadata: This PR involves database schema changes M-api-contract-changes Metadata: This PR involves API contract changes and removed S-conventions-not-followed Status: This PR does not follow contributing guidelines labels Jun 3, 2023
@rishavkar rishavkar changed the title Adding order_details both inside and outside of metadata, in payments request, for backward compatibility feat(order_details):Adding order_details both inside and outside of metadata, in payments request, for backward compatibility Jun 3, 2023
@github-actions github-actions bot added the S-conventions-not-followed Status: This PR does not follow contributing guidelines label Jun 3, 2023
@rishavkar rishavkar changed the title feat(order_details):Adding order_details both inside and outside of metadata, in payments request, for backward compatibility feat(payment_request):Adding order_details both inside and outside of metadata, in payments request, for backward compatibility Jun 3, 2023
@rishavkar rishavkar removed the S-conventions-not-followed Status: This PR does not follow contributing guidelines label Jun 5, 2023
@rishavkar rishavkar changed the title feat(payment_request):Adding order_details both inside and outside of metadata, in payments request, for backward compatibility feat(payment_request) : Adding order_details both inside and outside of metadata, in payments request, for backward compatibility Jun 5, 2023
@github-actions github-actions bot added the S-conventions-not-followed Status: This PR does not follow contributing guidelines label Jun 5, 2023
@Narayanbhat166 Narayanbhat166 added the S-needs-conflict-resolution Status: This PR needs conflicts to be resolved by the author label Jun 5, 2023
@rishavkar rishavkar changed the title feat(payment_request) : Adding order_details both inside and outside of metadata, in payments request, for backward compatibility feat(order_details): Adding order_details both inside and outside of metadata, in payments request, for backward compatibility Jun 5, 2023
@github-actions github-actions bot removed the S-conventions-not-followed Status: This PR does not follow contributing guidelines label Jun 5, 2023
crates/api_models/src/payments.rs Show resolved Hide resolved
crates/api_models/src/payments.rs Show resolved Hide resolved
crates/router/src/connector/zen/transformers.rs Outdated Show resolved Hide resolved
crates/router/src/core/payments/transformers.rs Outdated Show resolved Hide resolved
@rishavkar rishavkar added the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jun 7, 2023
crates/api_models/src/payments.rs Outdated Show resolved Hide resolved
crates/router/src/connector/adyen/transformers.rs Outdated Show resolved Hide resolved
crates/router/src/connector/zen/transformers.rs Outdated Show resolved Hide resolved
crates/router/src/core/payments/helpers.rs Outdated Show resolved Hide resolved
crates/router/src/core/payments/helpers.rs Outdated Show resolved Hide resolved
crates/router/src/core/payments/transformers.rs Outdated Show resolved Hide resolved
@Narayanbhat166 Narayanbhat166 removed the S-waiting-on-approval Status: Review completed, awaiting for approvals from code-owners label Jun 9, 2023
@Narayanbhat166
Copy link
Member

There are few files which are conflicting, please resolve them.

@Narayanbhat166
Copy link
Member

There are a lot of places where the clones can be avoided, since we are only checking if the value is present and not consuming it. You can instead use .as_ref() in those places

@rishavkar rishavkar requested a review from a team as a code owner June 12, 2023 10:59
@rishavkar rishavkar removed the S-needs-conflict-resolution Status: This PR needs conflicts to be resolved by the author label Jun 12, 2023
@jarnura jarnura added S-ready-for-merge and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Jun 13, 2023
@bernard-eugine bernard-eugine added this pull request to the merge queue Jun 14, 2023
Merged via the queue into main with commit 913b833 Jun 14, 2023
@SanchithHegde SanchithHegde deleted the order_details_for_backward_compatibility branch June 17, 2023 07:24
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 C-feature Category: Feature request or enhancement M-api-contract-changes Metadata: This PR involves API contract changes M-database-changes Metadata: This PR involves database schema changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants