-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat(core): Add L2_L3 Data Support #8828
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
Conversation
c38d999
to
2f72ec6
Compare
router_data: &PaymentsAuthorizeRouterData, | ||
) -> Result<Option<EnhancedData>, error_stack::Report<errors::ConnectorError>> { | ||
let l2_l3_data = router_data.l2_l3_data.clone(); | ||
router_env::logger::info!("WorldpayVantiv l2_l3_data: {:?}", l2_l3_data); |
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.
logger
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.
removed
@@ -1243,6 +1243,9 @@ dynamic_routing_enabled = false | |||
static_routing_enabled = false | |||
url = "http://localhost:8080" | |||
|
|||
[l2_l3_data_config] |
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.
we enabling for every merchant in a env or should we go with for few merchant accounts in an env ?
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.
We shouldn't store merchant details in the application config
@@ -1229,6 +1235,68 @@ where | |||
.as_ref() | |||
.and_then(|detail| detail.get_connector_mandate_request_reference_id()); | |||
|
|||
let l2_l3_data = if state.conf.l2_l3_data_config.enabled { |
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.
https://doc.rust-lang.org/std/primitive.bool.html#method.then
we can use this to avoid else {None}
block at the end.
@@ -0,0 +1,9 @@ | |||
-- Your SQL goes here | |||
CREATE TYPE "TaxStatus" AS ENUM ('taxable', 'exempt'); |
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.
any reason for this to be db enum ? can this be enum in application but text in pg.
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.
Yes we can make it text.
@@ -31,6 +31,7 @@ diesel::table! { | |||
#[max_length = 32] | |||
updated_by -> Varchar, | |||
email -> Nullable<Bytea>, | |||
origin_zip -> Nullable<Bytea>, |
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.
should this be encrypted field?
@@ -31,6 +31,7 @@ diesel::table! { | |||
#[max_length = 32] | |||
updated_by -> Varchar, | |||
email -> Nullable<Bytea>, | |||
origin_zip -> Nullable<Bytea>, |
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.
should this be encrypted field?
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.
Yes
Even zip was
zip -> Nullable<Bytea>,
Payment Method changes looks good to me |
/// Description for the item | ||
pub description: Option<String>, | ||
/// Stock Keeping Unit (SKU) or the item identifier for this item. | ||
pub sku: Option<String>, |
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.
can we please verify, whether this 'sku' is different from the product_id which we are already having? If its same we can map it to it and we dont need addtional field, and change the description comment for it, if not then this is fine.
crates/api_models/src/payments.rs
Outdated
pub unit_of_measure: Option<String>, | ||
/// Cost price for the item. | ||
#[schema(value_type = Option<i64>)] | ||
pub unit_price: Option<MinorUnit>, |
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.
current amount in this type is same as 'unit_price' no need to introduce a new field. Can we please omit this? And map this unit_price to our existing amount
Also there is no field for total_amount in this type OrderDetailsWithAmount
, can we please introduce it as well. So that unit amount and total_amount scenarios can be handled.
pub unit_price: Option<MinorUnit>, | ||
/// Discount amount applied to this item. | ||
#[schema(value_type = Option<i64>)] | ||
pub unit_discount_amount: Option<MinorUnit>, |
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.
Can we please rename it to discount_amount and have corresponding descriptive comment for it? Mostly all other processors are saying it discount_amount if it is present in line items
Edit: can be changed in sheet.
crates/api_models/src/payments.rs
Outdated
|
||
/// Date the payer placed the order. | ||
#[serde(default, with = "common_utils::custom_serde::iso8601::option")] | ||
pub customer_order_date: Option<PrimitiveDateTime>, |
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.
can we please call it order_date
?
Edit: we can rename it in sheet
|
||
/// Your tax status for this order or transaction. | ||
#[schema(value_type = Option<TaxStatus>)] | ||
pub tax_status: Option<api_enums::TaxStatus>, |
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.
can we please call it tax_exempt?
Or we can just change in the SOP sheet, so that it should not get confusing to the people who are trying to integrate l2 & l3 data.
Edit: We can change in the sheet, its fine.
/// Stock Keeping Unit (SKU) or the item identifier for this item. | ||
pub sku: Option<String>, | ||
/// Universal Product Code for the item. | ||
pub upc: Option<String>, |
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.
need to change in doc*
crates/diesel_models/src/types.rs
Outdated
/// unit of measure of the product | ||
pub unit_of_measure: Option<String>, | ||
/// unit price of the product | ||
pub unit_price: Option<MinorUnit>, |
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.
can we please change it here, i guess current amount is unit price for now.
}), | ||
metadata: None, | ||
tax_registration_id: None, |
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.
will it be none here?
ALTER TABLE address | ||
DROP COLUMN origin_zip; |
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.
ALTER TABLE address DROP COLUMN IF EXISTS origin_zip;
Can we please keep it consistent with up.sql?
35d4a4f
@@ -6649,9 +6649,9 @@ pub struct OrderDetailsWithAmount { | |||
pub commodity_code: Option<String>, | |||
/// Unit of measure used for the item quantity. | |||
pub unit_of_measure: Option<String>, | |||
/// Cost price for the item. | |||
/// Total amount for the item. |
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.
nitpick: items*
cf92f75
…ordea-sepa * 'main' of github.com:juspay/hyperswitch: (89 commits) feat(router): [worldpayvantiv] add dispute list sync and implement dispute (#8830) feat(core): Add support for Void after Capture (#8839) fix(wasm): [FISERV] Added GooglePay Payment Method Type (#8832) feat(connector): [Barclaycard] Add Google Pay Payment Method (#8786) chore(version): 2025.08.06.0 feat(core): Added additional authentication fields for 3ds external authentication (#8758) refactor(core): propagate network_transaction_id in response of payment (#8829) fix(core): add fix for stopping multiple event locking idempotent logs (#8034) feat(connector): [AUTHORIZEDOTNET] create connector customer flow added (#8774) feat(core): Add L2_L3 Data Support (#8828) feat(connector): [NMI] Add mandates flow (#8652) fix(connector): [Wise] send uuid as connector_transaction_id (#8836) feat(core): populate UCS status_code in response headers (#8788) feat(external_services): Fixed Url for Unified Connector Service gRPC Client (#8587) chore: reorder v2 migrations folders (#8671) fix(router): Take merchant ID from headers in API Key - Revoke (v2) (#8808) fix(connector): (payload) currency auth key wasm changes (#8825) feat(payment-methods): add filtering logic for payment method list v2 (#8606) feat(router): add support for apple pay pre-decrypted token in the payments confirm call (#8815) chore(version): 2025.08.05.0 ...
Type of Change
Description
Database Changes
Payment Intent: Added tax_status, discount_amount, shipping_amount_tax, duty_amount, customer_order_date
Customer: Added tax_registration_id for tax information
Address: Added origin_zip
API Models
Extended OrderDetailsWithAmount with SKU, UPC, commodity codes, unit prices
Configuration: Added l2_l3_data_config.enabled setting
WorldpayVantiv Integration: Added L2_L3 Support
Additional Changes
Motivation and Context
How did you test it?
Request
Response:
Checklist
cargo +nightly fmt --all
cargo clippy