feat(api_models/connector): [SANTANDER] Add boleto related fields in feature metadata #12683
Conversation
Changed Files
|
XyneSpaces
left a comment
There was a problem hiding this comment.
Automated Review Summary
PR: feat(api_models/connector): [SANTANDER] Add boleto related fields in feature metadata
Team: connector + baseline
Findings Overview
✅ Clean implementation — API contract extension follows established patterns. One observation on deprecation handling.
Verification Passed
1. API Models (crates/api_models/src/payments.rs)
- ✅ New boleto fields properly added to
BoletoAdditionalDetailswith#[serde(default)]for backward compatibility - ✅
mergefunction updated to combine new fields from both instances - ✅
#[schema(value_type = ...)]attributes present for proper OpenAPI spec generation
2. Diesel Models (crates/diesel_models/src/types.rs)
- ✅ Storage types mirror API types with proper field mapping
- ✅
StringMajorUnitused appropriately for monetary values (amount, percentages) - ✅ Custom serialization for
PrimitiveDateTimefields viadate_only_optionalmodule
3. Connector Transformers (crates/hyperswitch_connectors/src/connectors/santander/transformers.rs)
- ✅ Source changed from
connector_intent_metadatatofeature_metadata— aligns with architectural direction - ✅
qr_code_urlnow properly set toSome(image_data_url)matching the actual QR code source
4. Domain Model Converters (crates/hyperswitch_domain_models/src/lib.rs)
- ✅ Bidirectional conversions (
convert_from/convert_back) implemented for all new types - ✅ Enum variants exhaustively matched (Standard, FixedDate, DailyCalendar, DailyBusiness, etc.)
5. OpenAPI Specs
- ✅ Both v1 and v2 specs updated with new schema references
Observation (Non-blocking)
Deprecation removal on document_kind:
The #[schema(deprecated)] attribute was removed from document_kind. The PR description notes these fields moved to connector_metadata — verify this removal is intentional and coordinated with any consumer migration.
// Before:
#[schema(value_type = Option<BoletoDocumentKind>, example="commercial_invoice", deprecated)]
// After:
#[schema(value_type = Option<BoletoDocumentKind>, example="commercial_invoice")]Verdict: ✅ Approve — Well-structured API extension following patterns. Verify deprecation removal is intentional before merge.
XyneSpaces
left a comment
There was a problem hiding this comment.
Automated Review Summary
PR: feat(api_models/connector): [SANTANDER] Add boleto related fields in feature metadata
Team: connector + baseline
Reviewer: XyneSpaces Automation
Findings Overview
No blocking issues found. This is a clean connector feature addition extending the boleto payment method metadata structure for Santander.
Verification Passed
✅ Type consistency — New SantanderPaymentDiscountRules, PenaltyRules, CollectionActions, BoletoPaymentTypeConstraints, and BeneficiaryDetails types properly mirror API model structure in diesel models
✅ Bidirectional conversion — All 16 new ApiModelToDieselModelConvertor implementations in hyperswitch_domain_models/src/lib.rs follow the established pattern with proper From/TryFrom bounds
✅ Connector transformer update — santander/transformers.rs correctly updated to read from feature_metadata instead of connector_intent_metadata, fixing the field path alignment
✅ OpenAPI spec sync — Both v1 and v2 specs updated with new nullable fields, maintaining API contract consistency
✅ Deprecated field cleanup — Removal of #[deprecated] from document_kind is intentional as the field is actively used in the boleto flow
Observations
ℹ️ Field richness — The new metadata structure supports sophisticated boleto configurations (discount tiers, penalty rules, protest actions, flexible amounts). Ensure these are documented in the connector setup guides so merchants can leverage the full feature set.
ℹ️ QR code fix — The change from populating qr_code_url from transaction_data.image_data_url is noted as a fix. This aligns with the connector's response structure.
Verdict: ✅ Approve — Clean feature addition with proper type modeling and conversion implementations.
8740c69 to
03cdc99
Compare
deepanshu-iiitu
left a comment
There was a problem hiding this comment.
Connector changes look good
Type of Change
Description
This PR contains two changes :
image_data_urlwith the base64 encoded data of qr code for pixAdditional Changes
Motivation and Context
How did you test it?
cURL
Response
Checklist
cargo +nightly fmt --allcargo clippy