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): [VOLT] Implement payment flows and bank redirect payment method #2582

Merged
merged 22 commits into from
Oct 30, 2023

Conversation

swangi-kumari
Copy link
Contributor

@swangi-kumari swangi-kumari commented Oct 13, 2023

Type of Change

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

Description

Implement payment flows and bank redirect payment method for Volt Connnector
This PR resolve the problem in 2859

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?

Screenshot 2023-10-27 at 7 45 06 PM Screenshot 2023-10-13 at 6 39 58 PM Screenshot 2023-10-13 at 6 40 13 PM

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
  • I added a CHANGELOG entry if applicable

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@swangi-kumari swangi-kumari added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement labels Oct 13, 2023
@swangi-kumari swangi-kumari self-assigned this Oct 13, 2023
@swangi-kumari swangi-kumari requested review from a team as code owners October 13, 2023 13:11
crates/router/src/connector/volt.rs Outdated Show resolved Hide resolved
crates/router/src/connector/volt/transformers.rs Outdated Show resolved Hide resolved
crates/router/src/connector/volt/transformers.rs Outdated Show resolved Hide resolved
crates/router/src/connector/volt/transformers.rs Outdated Show resolved Hide resolved
crates/router/src/connector/volt/transformers.rs Outdated Show resolved Hide resolved
crates/router/src/connector/volt/transformers.rs Outdated Show resolved Hide resolved
VoltPaymentStatus::Completed => Self::Charged,
VoltPaymentStatus::NewPayment
| VoltPaymentStatus::Processing
| VoltPaymentStatus::Received => Self::AuthenticationPending,
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the definition of Received here?? if it is funds received then it should be mapped to Charged. Please confirm this.

Copy link
Contributor Author

@swangi-kumari swangi-kumari Oct 17, 2023

Choose a reason for hiding this comment

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

In Completed and Received Status payment will get Charged.

VoltPaymentStatus::NewPayment
| VoltPaymentStatus::Processing
| VoltPaymentStatus::Received => Self::AuthenticationPending,
VoltPaymentStatus::AbandonedByUser => Self::AuthenticationFailed,
}
}
}

#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)]
Copy link
Contributor

Choose a reason for hiding this comment

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

same here.

Completed,
Received,
AbandonedByUser,
#[default]
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not use default

Comment on lines +954 to +958
ConnectorAuthType::MultiAuthKey { api_key, key1, .. } => Ok(Self {
app_id: api_key,
id: Some(key1),
}),

Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this added if you are not using this in Accesstoken tryFrom?

@ArjunKarthik ArjunKarthik added the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label Oct 16, 2023
@swangi-kumari swangi-kumari removed the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label Oct 18, 2023
pub struct VoltPaymentsRequest {
amount: i64,
card: VoltCard,
currency_code: String,
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Currency enum instead of string

mandate_reference: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: None,
Copy link
Contributor

Choose a reason for hiding this comment

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

populate connector_response_reference_id

@@ -183,7 +363,7 @@ impl From<RefundStatus> for enums::RefundStatus {
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
pub struct RefundResponse {
id: String,
status: RefundStatus,
status: Option<RefundStatus>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Use separate struct for Refund & RSync

Comment on lines 239 to 244
VoltPaymentStatus::Completed => Self::Charged,
VoltPaymentStatus::Processing => Self::Pending,
VoltPaymentStatus::NewPayment | VoltPaymentStatus::Received => {
Self::AuthenticationPending
}
VoltPaymentStatus::AbandonedByUser => Self::AuthenticationFailed,
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we have failure status ?

@ArjunKarthik ArjunKarthik added the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label Oct 19, 2023
@ArjunKarthik
Copy link
Contributor

@swangi-kumari Since we are not clear with all Payment status and Error response structure, Let's raise this with connector.

VoltPaymentStatus::Received
| VoltPaymentStatus::NotReceived
| VoltPaymentStatus::DelayedAtBank
| VoltPaymentStatus::AwaitingCheckoutAuthorisation => Self::Pending,
Copy link
Contributor

Choose a reason for hiding this comment

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

AwaitingCheckoutAuthorisation should be mapped to AuthenticationPending

prasunna09
prasunna09 previously approved these changes Oct 26, 2023
@swangi-kumari swangi-kumari dismissed stale reviews from prasunna09 and ArjunKarthik via 37c54b0 October 27, 2023 11:41
ArjunKarthik
ArjunKarthik previously approved these changes Oct 27, 2023
prasunna09
prasunna09 previously approved these changes Oct 27, 2023
@swangi-kumari swangi-kumari removed the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label Oct 27, 2023
@swangi-kumari swangi-kumari dismissed stale reviews from prasunna09 and ArjunKarthik via e51802f October 27, 2023 14:16
@swangi-kumari swangi-kumari requested a review from a team as a code owner October 27, 2023 14:16
@pixincreate
Copy link
Member

@swangi-kumari, please update base branch to latest main to get spell-checks to pass.

@swangi-kumari
Copy link
Contributor Author

@swangi-kumari, please update base branch to latest main to get spell-checks to pass.

Done👍🏻

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Oct 30, 2023
Merged via the queue into main with commit 23bd364 Oct 30, 2023
@Gnanasundari24 Gnanasundari24 deleted the volt branch October 30, 2023 08:03
Abhicodes-crypto pushed a commit that referenced this pull request Nov 6, 2023
…ment method (#2582)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Prasunna Soppa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement
Projects
No open projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

None yet

6 participants