WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 22a9357

Browse files
authored
fix(connector): Fix Dwolla Error Handling (#10344)
1 parent 51705b7 commit 22a9357

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

crates/hyperswitch_connectors/src/connectors/dwolla.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,10 @@ impl ConnectorCommon for Dwolla {
154154
code: response.code,
155155
message: response.message,
156156
reason: response
157-
._embedded
157+
.embedded
158158
.as_ref()
159-
.and_then(|errors_vec| errors_vec.first())
160-
.and_then(|details| details.errors.first())
161-
.and_then(|err_detail| err_detail.message.clone()),
159+
.and_then(|errors_vec| errors_vec.errors.first())
160+
.and_then(|details| details.message.clone()),
162161
attempt_status: None,
163162
connector_transaction_id: None,
164163
network_advice_code: None,
@@ -466,11 +465,10 @@ impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, Pay
466465
code: response.code,
467466
message: response.message,
468467
reason: response
469-
._embedded
468+
.embedded
470469
.as_ref()
471-
.and_then(|errors_vec| errors_vec.first())
472-
.and_then(|details| details.errors.first())
473-
.and_then(|err_detail| err_detail.message.clone()),
470+
.and_then(|errors_vec| errors_vec.errors.first())
471+
.and_then(|details| details.message.clone()),
474472
attempt_status: None,
475473
connector_transaction_id: None,
476474
network_advice_code: None,

crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,8 @@ impl From<DwollaPaymentStatus> for enums::RefundStatus {
486486
pub struct DwollaErrorResponse {
487487
pub code: String,
488488
pub message: String,
489-
pub _embedded: Option<Vec<DwollaErrorDetails>>,
489+
#[serde(rename = "_embedded")]
490+
pub embedded: Option<DwollaErrorDetails>,
490491
pub reason: Option<String>,
491492
}
492493

0 commit comments

Comments
 (0)