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): [ACI] implement Card Mandates for ACI #1174

Merged
merged 29 commits into from
Jun 30, 2023

Conversation

Sakilmostak
Copy link
Contributor

Type of Change

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

Description

Additional Changes

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

Motivation and Context

In ACI connector Card Mandates were not implemented, but it is important payment method which is needed in market so I implemented it.

How did you test it?

I tested it using Postman
Screen Shot 2023-05-16 at 3 36 59 PM
Screen Shot 2023-05-16 at 3 37 40 PM
Screen Shot 2023-05-16 at 3 39 27 PM
Screen Shot 2023-05-16 at 3 45 43 PM

Checklist

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

@Sakilmostak Sakilmostak added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement labels May 16, 2023
@Sakilmostak Sakilmostak self-assigned this May 16, 2023
@Sakilmostak Sakilmostak requested a review from a team as a code owner May 16, 2023 11:40
@Sakilmostak Sakilmostak added the R-waiting-on-L1 Review: Waiting on L1 reviewer label May 16, 2023
Copy link
Contributor

@ArjunKarthik ArjunKarthik left a comment

Choose a reason for hiding this comment

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

@Sakilmostak as discussed lets have the try_from for the payment methods

crates/router/src/connector/aci/transformers.rs Outdated Show resolved Hide resolved
@ArjunKarthik ArjunKarthik added S-waiting-on-author Status: This PR is incomplete or needs to address review comments and removed R-waiting-on-L1 Review: Waiting on L1 reviewer labels May 17, 2023
@Sakilmostak Sakilmostak added R-waiting-on-L1 Review: Waiting on L1 reviewer and removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels May 19, 2023
@ArjunKarthik ArjunKarthik added the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label May 19, 2023
@Sakilmostak Sakilmostak requested a review from a team as a code owner May 19, 2023 09:21
@Sakilmostak Sakilmostak requested a review from a team as a code owner May 31, 2023 08:02
@Sakilmostak Sakilmostak removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments S-needs-conflict-resolution Status: This PR needs conflicts to be resolved by the author labels May 31, 2023
crates/router/src/connector/aci.rs Outdated Show resolved Hide resolved
let payment_data = match wallet_data {
api_models::payments::WalletData::MbWay(data) => Self::Wallet(Box::new(WalletPMData {
payment_brand: PaymentBrand::Mbway,
account_id: Some(data.telephone_number.clone()),
Copy link
Contributor

Choose a reason for hiding this comment

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

why account_id is mapped with telephone_number?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For MBway, the account Id is accepting in the telephone number format i.e telephone number is the account id for MBway in ACI

@jagan-jaya jagan-jaya added the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label Jun 13, 2023
@Sakilmostak Sakilmostak removed the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label Jun 29, 2023
@SanchithHegde SanchithHegde added the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jun 29, 2023
Comment on lines +42 to +47
#[serde(flatten)]
pub txn_details: TransactionDetails,
#[serde(flatten)]
pub payment_method: PaymentDetails,
#[serde(flatten)]
pub instruction: Option<Instruction>,
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason why #[serde(flatten)] is being used here? Are these types being reused anywhere else?

Comment on lines +302 to +309
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "UPPERCASE")]
pub enum InstructionSource {
// Cardholder initiated transaction
Cit,
// Merchant initiated transaction
Mit,
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "UPPERCASE")]
pub enum InstructionSource {
// Cardholder initiated transaction
Cit,
// Merchant initiated transaction
Mit,
}
#[derive(Debug, Clone, Serialize)]
pub enum InstructionSource {
#[serde(rename = "CIT")]
CardholderInitiatedTransaction,
#[serde(rename = "MIT")]
MerchantInitiatedTransaction,
}

This can be done instead, to keep it readable and achieve the desired result. You can take this up on a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, resolving this in a seperate PR

@ArjunKarthik ArjunKarthik added this pull request to the merge queue Jun 30, 2023
Merged via the queue into main with commit 15c2a70 Jun 30, 2023
@ArjunKarthik ArjunKarthik deleted the feat/aci_cards_mandates branch June 30, 2023 08:04
@SanchithHegde SanchithHegde removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed R-waiting-on-L1 Review: Waiting on L1 reviewer labels Jul 1, 2023
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.

4 participants