refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template#8681
Conversation
| pub feature_metadata: Option<PaymentAttemptFeatureMetadata>, | ||
|
|
||
| /// payment method data | ||
| pub payment_method_data: Option<PaymentMethodDataResponseWithBilling>, |
There was a problem hiding this comment.
Instead of the entire struct can we just populate the additional_payment_method_Data here
There was a problem hiding this comment.
This seemed a better choice since it is being used in struct PaymentsResponse v2 too
crates/api_models/src/payments.rs
Outdated
| /// Additional data that might be required by hyperswitch, to enable some specific features. | ||
| pub feature_metadata: Option<PaymentAttemptFeatureMetadata>, | ||
|
|
||
| /// payment method data |
There was a problem hiding this comment.
Add more descriptive comment. You can refer to the other places where PaymentMethodDataResponseWithBilling` is being used.
| > = attempt | ||
| .payment_method_data | ||
| .clone() | ||
| .and_then(|data| serde_json::from_value(data.expose().clone()).ok()); |
There was a problem hiding this comment.
Do we want to log the error message ?
There was a problem hiding this comment.
No we dont want to log we will just ignore the error here
There was a problem hiding this comment.
Why are we ignoring the error here?
There was a problem hiding this comment.
Thought of ForeignFrom expects a self not result. Instead of propagating the error could have logged the error. Will pick it up in next pr.
swangi-kumari
left a comment
There was a problem hiding this comment.
Connector changes looks good
3cf95df
There was a problem hiding this comment.
Rename this file to custombilling.rs and move it to crates/router/tests/connectors
| } | ||
|
|
||
| default_imp_for_authorize_session_token!( | ||
| connectors::Custombilling, |
There was a problem hiding this comment.
Please follow alphabetical order in this file
| } | ||
|
|
||
| default_imp_for_new_connector_integration_payment!( | ||
| connectors::Custombilling, |
There was a problem hiding this comment.
Please follow alphabetical order in this file
| > = attempt | ||
| .payment_method_data | ||
| .clone() | ||
| .and_then(|data| serde_json::from_value(data.expose().clone()).ok()); |
There was a problem hiding this comment.
Why the .expose().clone()? Isn't .expose() sufficient?
| > = attempt | ||
| .payment_method_data | ||
| .clone() | ||
| .and_then(|data| serde_json::from_value(data.expose().clone()).ok()); |
There was a problem hiding this comment.
Why are we ignoring the error here?
…ordea-sepa * 'main' of github.com:juspay/hyperswitch: refactor(connector): [Adyen] map ssn and session validity for Pix (#8702) feat(core): Implement UCS kill switch for emergency fallback (#8651) fix(openapi): Added Error Response Schema for Status Code 400 (#8684) feat(connector): Add template code for breadpay (#8655) chore(version): 2025.07.21.1 refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template (#8681) fix(router): Make v2 endpoints follow standard naming conventions (#8630) fix(connector): [Cybersource] Add type_selection_indicator as 1 for all cards (#8663) feat(routing): Add API key auth for decision engine endpoints (#8640) feat(authentication): Added eligibility flow for modular authentication (#8431) feat(connector): [BLACKHAWKNETWORK] Add Template Code (#8632) fix: remove straight through routing from routing approach (#8695) fix(connector): [Access Worldpay] correct enum deserialization for payment responses for (#8689) chore(version): 2025.07.21.0
…ayload-recurring * 'main' of github.com:juspay/hyperswitch: (48 commits) fix(connector): Add Trustpay in Authentication Providers Config (#8622) refactor(connector): [Adyen] map ssn and session validity for Pix (#8702) feat(core): Implement UCS kill switch for emergency fallback (#8651) fix(openapi): Added Error Response Schema for Status Code 400 (#8684) feat(connector): Add template code for breadpay (#8655) chore(version): 2025.07.21.1 refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template (#8681) fix(router): Make v2 endpoints follow standard naming conventions (#8630) fix(connector): [Cybersource] Add type_selection_indicator as 1 for all cards (#8663) feat(routing): Add API key auth for decision engine endpoints (#8640) feat(authentication): Added eligibility flow for modular authentication (#8431) feat(connector): [BLACKHAWKNETWORK] Add Template Code (#8632) fix: remove straight through routing from routing approach (#8695) fix(connector): [Access Worldpay] correct enum deserialization for payment responses for (#8689) chore(version): 2025.07.21.0 feat(debit_routing): add debit routing support for apple pay (#8673) refactor(router): decrypt the wallet token before the debit routing call (#8598) chore: update org retrieve api response to include org type (#8660) feat(routing): Add routing evaluation rule endpoint and related flow (#8656) fix(connector): [AUTHORIZEDOTNET] Added Invoice Number Fix (#8685) ...
…acilitapay-mca-metadata * 'main' of github.com:juspay/hyperswitch: fix(connector): Add Trustpay in Authentication Providers Config (#8622) refactor(connector): [Adyen] map ssn and session validity for Pix (#8702) feat(core): Implement UCS kill switch for emergency fallback (#8651) fix(openapi): Added Error Response Schema for Status Code 400 (#8684) feat(connector): Add template code for breadpay (#8655) chore(version): 2025.07.21.1 refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template (#8681) fix(router): Make v2 endpoints follow standard naming conventions (#8630) fix(connector): [Cybersource] Add type_selection_indicator as 1 for all cards (#8663) feat(routing): Add API key auth for decision engine endpoints (#8640) feat(authentication): Added eligibility flow for modular authentication (#8431) feat(connector): [BLACKHAWKNETWORK] Add Template Code (#8632) fix: remove straight through routing from routing approach (#8695) fix(connector): [Access Worldpay] correct enum deserialization for payment responses for (#8689)
Type of Change
Description
This pr adds fetches payment method data in payment attempt list v2 api.
Additional Changes
Motivation and Context
How did you test it?
Request:
Response
Checklist
cargo +nightly fmt --allcargo clippy