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

Hackathon h1016 l3 #3

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

Hackathon h1016 l3 #3

wants to merge 5 commits into from

Conversation

umangj28
Copy link
Owner

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates

Description

Additional Changes

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

Motivation and Context

How did you test it?

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

@@ -152,6 +152,9 @@ base_url = "https://try.access.worldpay.com/"
base_url = "https://apis.sandbox.globalpay.com/ucp/"

# This data is used to call respective connectors for wallets and cards
[connectors.forte]
base_url = "https://sandbox.forte.net/api/v3/organizations/org_436911/locations/loc_314200/transactions"

Choose a reason for hiding this comment

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

do not hardcode org id and location. save it in connector_meta while Payment Connector Create

@@ -519,6 +519,7 @@ pub enum Connector {
Cybersource,
#[default]
Dummy,
Forte,

Choose a reason for hiding this comment

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

run cargo clippy --all-features --all-targets && cargo +nightly fmt --all and fix the formatting issues

@@ -153,6 +153,7 @@ pub struct Connectors {

// Keep this field separate from the remaining fields
pub supported: SupportedConnectors,
pub forte: ConnectorParams,

Choose a reason for hiding this comment

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

run cargo clippy --all-features --all-targets && cargo +nightly fmt --all and fix the formatting issues and fix clippy warning if any

pub use self::{
aci::Aci, adyen::Adyen, applepay::Applepay, authorizedotnet::Authorizedotnet,
braintree::Braintree, checkout::Checkout, cybersource::Cybersource, fiserv::Fiserv,
globalpay::Globalpay, klarna::Klarna, payu::Payu, rapyd::Rapyd, shift4::Shift4, stripe::Stripe,
worldline::Worldline, worldpay::Worldpay,
forte::Forte,

Choose a reason for hiding this comment

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

run cargo clippy --all-features --all-targets && cargo +nightly fmt --all and fix clippy warnings if any

Comment on lines +35 to +51
// todo!()
// let mut headers = vec![(
// headers::CONTENT_TYPE.to_string(),
// self.get_content_type().to_string(),
// )];
// let access_token = _req
// .access_token
// .clone()
// .ok_or(errors::ConnectorError::FailedToObtainAuthType)?;

// let auth_header = (
// headers::AUTHORIZATION.to_string(),
// format!("Basic {}", access_token.token),
// );

// headers.push(auth_header);
// Ok(headers)\

Choose a reason for hiding this comment

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

Suggested change
// todo!()
// let mut headers = vec![(
// headers::CONTENT_TYPE.to_string(),
// self.get_content_type().to_string(),
// )];
// let access_token = _req
// .access_token
// .clone()
// .ok_or(errors::ConnectorError::FailedToObtainAuthType)?;
// let auth_header = (
// headers::AUTHORIZATION.to_string(),
// format!("Basic {}", access_token.token),
// );
// headers.push(auth_header);
// Ok(headers)\

remove commented section

Comment on lines +119 to +120
// status: FortePaymentStatus,
// id: String,

Choose a reason for hiding this comment

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

remove commented lines

cvv_result: String
}

//TODO: Fill the struct with respective fields

Choose a reason for hiding this comment

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

remove todo

@@ -166,6 +166,7 @@ where
let response = call_connector_api(state, request).await;
match response {
Ok(body) => {
logger::debug!(response_response=?body);

Choose a reason for hiding this comment

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

remove this log

);
}

/*Commented the below test case because the forte pg doesn't work for the expiry year, they are sending it as approved itself,

Choose a reason for hiding this comment

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

remove all the commented testcases below

@@ -84,6 +84,9 @@ base_url = "https://apple-pay-gateway.apple.com/"
[connectors.klarna]
base_url = "https://api-na.playground.klarna.com/"

[connectors.forte]
base_url = "https://sandbox.forte.net/api/v3/organizations/org_436911/locations/loc_314200/transactions"

Choose a reason for hiding this comment

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

remove the harcoded values and move it to connector meta

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