-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
refactor(connector): [Klarna] Refactor Authorize call and configs for prod #4750
Conversation
#[serde(rename = "")] | ||
Europe, | ||
#[serde(rename = "-na")] | ||
NorthAmerica, | ||
#[serde(rename = "-oc")] | ||
Oceania, |
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 renames
#[serde(rename = "")] | ||
Europe, | ||
#[serde(rename = "-na")] | ||
NorthAmerica, | ||
#[serde(rename = "-oc")] | ||
Oceania, |
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 renames
let region_based_endpoint = klarna_metadata_object.region_based_endpoint.ok_or( | ||
errors::ConnectorError::InvalidConnectorConfig { | ||
config: "metadata.region_based_endpoint", | ||
}, | ||
)?; | ||
Ok(base_url.replace("{{region_based_endpoint}}", ®ion_based_endpoint)) |
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.
Match over metadata object and then construct all the different urls
#[derive(Debug, Serialize)] | ||
pub struct OrderLines { | ||
name: String, | ||
quantity: u16, | ||
quantity: i64, |
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.
Dont modify it
let endpoint = | ||
build_region_specific_endpoint(self.base_url(connectors), &req.connector_meta_data)?; | ||
|
||
println!("###session{:?}", endpoint); |
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 println
let endpoint = | ||
build_region_specific_endpoint(self.base_url(connectors), &req.connector_meta_data)?; | ||
|
||
println!("###authorize{:?}", endpoint); |
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 println
@@ -70,10 +104,13 @@ impl TryFrom<&types::PaymentsSessionRouterData> for KlarnaSessionRequest { | |||
match request.order_details.clone() { | |||
Some(order_details) => Ok(Self { | |||
intent: KlarnaSessionIntent::Buy, | |||
purchase_country: "US".to_string(), | |||
purchase_country: request.country.ok_or( |
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.
Which country is this?
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.
It is PaymentsSessionData country.
…actor * 'main' of github.com:juspay/hyperswitch: (39 commits) Fix(Cypress): Fixing 3DS payment failure in headless mode (#4807) feat(users): Add redis in Begin and Verify TOTP and create a new API that updates TOTP (#4765) refactor(connector): [Klarna] Refactor Authorize call and configs for prod (#4750) fix: implement StrongEq for Vec<u8> (#4795) refactor(core): move router data response and request models to hyperswitch domain models crate (#4789) chore(version): 2024.05.29.0 refactor: retrieve extended card info config during business profile get call (#4784) refactor(payment_methods): add support for passing ttl to locker entries (#4690) feat(connector): [CRYPTOPAY] Pass network details in payment request (#4779) fix: include client columns in payment attempts response struct (#4761) fix(docker-compose): fix docker compose syntax (#4782) feat(connector): [Iatapay] add upi qr support (#4728) docs(analytics): Add documentation for setting up data services and enabling data features in control center (#4741) chore(version): 2024.05.28.0 feat(connector): [AUTHORIZEDOTNET] Implement non-zero mandates (#4758) feat(core): [Paypal] Add session_token flow for Paypal sdk (#4697) chore(version): 2024.05.27.0 chore: add missing migrations for recently added currencies (#4760) Refactor(core): Inclusion of constraint graph for merchant Payment Method list (#4626) chore(version): 2024.05.24.1 ...
Type of Change
Description
Additional Changes
Motivation and Context
How did you test it?
In metadata try 3 values and do a Klarna Payment via SDK for Klarna Connector for each
klarna_region
i.
ii.
iii.
Create a payment via sdk with capture_method =
manual
Create a payment via sdk with capture_method =
automatic
Checklist
cargo +nightly fmt --all
cargo clippy