feat(connector): [payload] add support to split payments #13121
feat(connector): [payload] add support to split payments #13121AkshayaFoiger wants to merge 1 commit into
Conversation
Changed Files
|
|
test |
1 similar comment
|
test |
|
In pub struct PayloadLedgerItem {
pub amount: MinorUnit,
pub receiver_id: String, // <-- Should this be Secret<String>?
}Fix: If |
|
🚨 Potential correctness issue in response type mapping The // Line ~460 in common_types/src/payments.rs
pub enum ConnectorChargeResponseData {
// ... other variants
#[smithy(value_type = "PayloadSplitPaymentRequest")] // <-- Request type in response enum
PayloadSplitPayment(PayloadSplitPaymentRequest),
}Fix: Define a |
📝 Review SummaryFound 1 issue requiring attention: [should-fix] Split payments validation allows positive amountsIn if split_item.amount.get_amount_as_i64() > 0 {
return Err(errors::ApiErrorResponse::InvalidDataValue {
field_name: "split_payments.payload_split_payment.ledger.amount",
});
}Issue: The validation only rejects positive amounts, but the comment says "negative = debit from the payment". However, a zero amount would pass validation, which doesn't make sense for a split payment ledger entry. Suggestion: Consider validating This is an automated review. Please verify the findings before making changes. |
|
[should-fix] In The In
Without these validations, malformed requests could cause reconciliation issues. |
|
In the validation for // From diff: validation in helpers.rs
if item.amount > 0 { // This check implies amounts must be <= 0
return Err(...);
}Question: If this represents money being transferred out (debit), negative or zero makes sense. But if this represents received funds (credit), the constraint may be inverted. Confirm the sign convention matches Payload's API specification. Also ensure |
Type of Change
Description
Blocked on payload
Checklist
cargo +nightly fmt --allcargo clippy