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

feat(connector): [Hipay] Add Card Payments Flow #7475

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

awasthi21
Copy link
Contributor

@awasthi21 awasthi21 commented Mar 10, 2025

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Added 3DS /No-3ds Card flows
Mandates Not added

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Added Cypress Tests
Screenshot 2025-03-11 at 5 13 10 AM
Screenshot 2025-03-11 at 5 13 02 AM
Screenshot 2025-03-11 at 5 12 53 AM
Screenshot 2025-03-11 at 5 12 43 AM
Screenshot 2025-03-11 at 5 07 50 AM

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@awasthi21 awasthi21 self-assigned this Mar 10, 2025
@awasthi21 awasthi21 requested review from a team as code owners March 10, 2025 15:32
Copy link

semanticdiff-com bot commented Mar 10, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/hipay/transformers.rs  15% smaller
  crates/hyperswitch_connectors/src/connectors/hipay.rs  4% smaller
  config/config.example.toml Unsupported file format
  config/deployments/integration_test.toml Unsupported file format
  config/deployments/production.toml Unsupported file format
  config/deployments/sandbox.toml Unsupported file format
  config/development.toml Unsupported file format
  config/docker_compose.toml Unsupported file format
  crates/common_enums/src/connector_enums.rs  0% smaller
  crates/connector_configs/src/connector.rs  0% smaller
  crates/connector_configs/toml/development.toml Unsupported file format
  crates/connector_configs/toml/production.toml Unsupported file format
  crates/connector_configs/toml/sandbox.toml Unsupported file format
  crates/hyperswitch_interfaces/src/configs.rs  0% smaller
  crates/router/src/core/admin.rs  0% smaller
  crates/router/src/types/api.rs  0% smaller
  crates/router/src/types/transformers.rs  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Hipay.js  0% smaller
  cypress-tests/cypress/e2e/configs/Payment/Utils.js  0% smaller
  loadtest/config/development.toml Unsupported file format

@deepanshu-iiitu deepanshu-iiitu changed the title feat(connector) : [Hipay] Add Card Payments Flow feat(connector): [Hipay] Add Card Payments Flow Mar 11, 2025
_connectors: &Connectors,
) -> CustomResult<RequestContent, errors::ConnectorError> {
let connector_req = transformers::HiPayTokenRequest::try_from(req)?;
router_env::logger::info!(raw_connector_request=?connector_req);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this logger as it contains sensitive card info

@@ -194,7 +307,10 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData

let connector_router_data = hipay::HipayRouterData::from((amount, req));
let connector_req = hipay::HipayPaymentsRequest::try_from(&connector_router_data)?;
Ok(RequestContent::Json(Box::new(connector_req)))
router_env::logger::info!(raw_connector_request=?connector_req);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this logger


let connector_router_data = hipay::HipayRouterData::from((capture_amount, req));
let connector_req = hipay::HipayMaintenanceRequest::try_from(&connector_router_data)?;
router_env::logger::info!(raw_connector_request=?connector_req);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this logger if not needed

_connectors: &Connectors,
) -> CustomResult<RequestContent, errors::ConnectorError> {
let connector_req = hipay::HipayMaintenanceRequest::try_from(req)?;
router_env::logger::info!(raw_connector_request=?connector_req);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this logger if not needed

let connector_req = hipay::HipayRefundRequest::try_from(&connector_router_data)?;
Ok(RequestContent::Json(Box::new(connector_req)))
let connector_req = hipay::HipayMaintenanceRequest::try_from(&connector_router_data)?;
router_env::logger::info!(raw_connector_request=?connector_req);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this logger if not needed

| HipayPaymentStatus::Refused
| HipayPaymentStatus::Expired
| HipayPaymentStatus::Denied => Self::Failure,
HipayPaymentStatus::AuthorizedAndPending => Self::Authorizing,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When do we get AuthorizedAndPending status?

HipayPaymentStatus::AwaitingTerminal => Self::Pending,
HipayPaymentStatus::AuthorizationCancellationRequested => Self::VoidInitiated,
HipayPaymentStatus::ChallengeRequested => Self::AuthenticationPending,
HipayPaymentStatus::SoftDeclined => Self::AuthorizationFailed,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark this as Failure

HipayPaymentStatus::Authenticated => Self::AuthenticationSuccessful,
HipayPaymentStatus::AcquirerNotFound => Self::Failure,
HipayPaymentStatus::RiskAccepted => Self::Pending,
HipayPaymentStatus::AuthorizationRefused => Self::AuthorizationFailed,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark this as Failure

Comment on lines +524 to +533
#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, Clone)]
#[serde(rename_all = "lowercase")]
pub enum HipaySyncState {
Completed,
Waiting,
Pending,
Declined,
Forwarding,
Error,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this being used?

Comment on lines +600 to +603
Ok(Self {
response,
..item.data
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should mark status as Failure here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants