-
Notifications
You must be signed in to change notification settings - Fork 0
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:H105-L3 : Refunds implementation for bambora #1
base: main
Are you sure you want to change the base?
Conversation
@@ -519,6 +519,7 @@ pub enum Connector { | |||
Cybersource, | |||
#[default] | |||
Dummy, | |||
Bambora, |
There was a problem hiding this comment.
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
@@ -153,6 +153,7 @@ pub struct Connectors { | |||
|
|||
// Keep this field separate from the remaining fields | |||
pub supported: SupportedConnectors, | |||
pub bambora: ConnectorParams, |
There was a problem hiding this comment.
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
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, | ||
bambora::Bambora, |
There was a problem hiding this comment.
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
_req: &types::RouterData<Flow, Request, Response>, | ||
_connectors: &settings::Connectors, | ||
) -> CustomResult<Vec<(String, String)>, errors::ConnectorError> { | ||
// todo!() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this todo
} | ||
|
||
fn common_get_content_type(&self) -> &'static str { | ||
// todo!() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this todo
// Connector dependent test cases goes here | ||
|
||
// [#478]: add unit tests for non 3DS, wallets & webhooks in connector tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove these comments
@@ -22,7 +23,7 @@ impl ConnectorAuthentication { | |||
pub(crate) fn new() -> Self { | |||
#[allow(clippy::expect_used)] | |||
toml::from_str( | |||
&std::fs::read_to_string("tests/connectors/auth.toml") | |||
&std::fs::read_to_string("tests/connectors/sample_auth.toml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo this change
|
||
[bambora] | ||
api_key = "MzAwMjEzMTkzOkQwMDIwODkyRjViMjQxZUVhMGIxODA1Rjk5NjgyMGU1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this secret key
card_number: Secret::new("4200000000000000".to_string()), | ||
card_exp_month: Secret::new("10".to_string()), | ||
card_exp_year: Secret::new("2025".to_string()), | ||
card_number: Secret::new("4030000010001234".to_string()), | ||
card_exp_month: Secret::new("02".to_string()), | ||
card_exp_year: Secret::new("14".to_string()), | ||
card_holder_name: Secret::new("John Doe".to_string()), | ||
card_cvc: Secret::new("999".to_string()), | ||
card_cvc: Secret::new("123".to_string()), | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not change any value in utils.rs as it is used by default for other connectors
@@ -84,6 +84,9 @@ base_url = "https://apple-pay-gateway.apple.com/" | |||
[connectors.klarna] | |||
base_url = "https://api-na.playground.klarna.com/" | |||
|
|||
[connectors.bambora] | |||
base_url = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add base_url
fn try_from(_item: &types::PaymentsAuthorizeRouterData) -> Result<Self,Self::Error> { | ||
let card_details:InputCardDetails = match _item.request.payment_method_data { | ||
api::PaymentMethod::Card(ref ccard) => InputCardDetails{ | ||
name:ccard.card_holder_name.peek().clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't peek the Secrets, Instead use Secret for the fields in BamboraPaymentsRequest
wherever necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run clippy comment and fix all the warnings
Run tests and attach screenshot of the test results
Added
Description
Implemented refunds usecase for Bambora gateway, testcases were running in postman.