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:H105-L3 : Refunds implementation for bambora #1

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

Conversation

BharatKJain
Copy link
Owner

Added

  • New feature

Description

Implemented refunds usecase for Bambora gateway, testcases were running in postman.

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

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,

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,

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!()

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!()

Choose a reason for hiding this comment

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

remove this todo

Comment on lines +436 to +438
// Connector dependent test cases goes here

// [#478]: add unit tests for non 3DS, wallets & webhooks in connector tests

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")

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"

Choose a reason for hiding this comment

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

remove this secret key

Comment on lines -447 to 452
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()),
})

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 =

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(),

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

Copy link

@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.

Run clippy comment and fix all the warnings
Run tests and attach screenshot of the test results

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