Skip to content
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

test(connector): [Globalpay] Fix unit tests #1217

Merged
merged 19 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 28 additions & 90 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions crates/router/src/connector/globalpay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use self::{
GlobalpayRefreshTokenResponse,
},
};
use super::utils::RefundsRequestData;
use crate::{
configs::settings,
connector::utils as conn_utils,
Expand All @@ -29,7 +30,7 @@ use crate::{
api::{self, ConnectorCommon, ConnectorCommonExt, PaymentsCompleteAuthorize},
ErrorResponse,
},
utils::{self, crypto, BytesExt, OptionExt},
utils::{self, crypto, BytesExt},
};

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -738,13 +739,7 @@ impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponse
req: &types::RefundSyncRouterData,
connectors: &settings::Connectors,
) -> CustomResult<String, errors::ConnectorError> {
let refund_id = req
.response
.clone()
.ok()
.get_required_value("response")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?
.connector_refund_id;
let refund_id = req.request.get_connector_refund_id()?;
Ok(format!(
"{}transactions/{}",
self.base_url(connectors),
Expand Down
4 changes: 2 additions & 2 deletions crates/router/src/connector/globalpay/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use super::{
response::{GlobalpayPaymentStatus, GlobalpayPaymentsResponse, GlobalpayRefreshTokenResponse},
};
use crate::{
connector::utils::{self, PaymentsAuthorizeRequestData, RouterData, WalletData},
connector::utils::{self, CardData, PaymentsAuthorizeRequestData, RouterData, WalletData},
consts,
core::errors,
services::{self, RedirectForm},
Expand Down Expand Up @@ -340,7 +340,7 @@ fn get_payment_method_data(
api::PaymentMethodData::Card(ccard) => Ok(PaymentMethodData::Card(requests::Card {
number: ccard.card_number.clone(),
expiry_month: ccard.card_exp_month.clone(),
expiry_year: ccard.card_exp_year.clone(),
expiry_year: ccard.get_card_expiry_year_2_digit(),
cvv: ccard.card_cvc.clone(),
account_type: None,
authcode: None,
Expand Down
2 changes: 1 addition & 1 deletion crates/router/tests/connectors/connector_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub(crate) struct ConnectorAuthentication {
pub dummyconnector: Option<HeaderKey>,
pub fiserv: Option<SignatureKey>,
pub forte: Option<MultiAuthKey>,
pub globalpay: Option<HeaderKey>,
pub globalpay: Option<BodyKey>,
pub iatapay: Option<SignatureKey>,
pub mollie: Option<HeaderKey>,
pub multisafepay: Option<HeaderKey>,
Expand Down
Loading