Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into connector_events_v3
Browse files Browse the repository at this point in the history
  • Loading branch information
lsampras committed Dec 12, 2023
2 parents 17c1126 + 62a7c30 commit aab2e0f
Show file tree
Hide file tree
Showing 358 changed files with 12,179 additions and 5,319 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 1.99.0 (2023-12-12)

### Features

- **connector:** [Placetopay] Add Connector Template Code ([#3084](https://github.com/juspay/hyperswitch/pull/3084)) ([`a7b688a`](https://github.com/juspay/hyperswitch/commit/a7b688aac72e15f782046b9d108aca12f43a9994))
- Add utility to convert TOML configuration file to list of environment variables ([#3096](https://github.com/juspay/hyperswitch/pull/3096)) ([`2c4599a`](https://github.com/juspay/hyperswitch/commit/2c4599a1cd7e244b6fb11948c88c55c5b8faad76))

### Bug Fixes

- **router:** Make `request_incremental_authorization` optional in payment_intent ([#3086](https://github.com/juspay/hyperswitch/pull/3086)) ([`f7da59d`](https://github.com/juspay/hyperswitch/commit/f7da59d06af11707e210b58a875c013d31c3ee17))

### Refactors

- **email:** Create client every time of sending email ([#3105](https://github.com/juspay/hyperswitch/pull/3105)) ([`fc2f163`](https://github.com/juspay/hyperswitch/commit/fc2f16392148cd66b3c3e67e3e0c782910e37e1f))

### Testing

- **postman:** Update postman collection files ([`aa97821`](https://github.com/juspay/hyperswitch/commit/aa9782164fb7846fe533c5057a17756dc82ede54))

### Miscellaneous Tasks

- **deps:** Update fred and moka ([#3088](https://github.com/juspay/hyperswitch/pull/3088)) ([`129b1e5`](https://github.com/juspay/hyperswitch/commit/129b1e55bd1cbad0243030fd25379f1400eb170c))

**Full Changelog:** [`v1.98.0...v1.99.0`](https://github.com/juspay/hyperswitch/compare/v1.98.0...v1.99.0)

- - -


## 1.98.0 (2023-12-11)

### Features
Expand Down
1 change: 1 addition & 0 deletions config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ payeezy.base_url = "https://api-cert.payeezy.com/"
payme.base_url = "https://sandbox.payme.io/"
paypal.base_url = "https://api-m.sandbox.paypal.com/"
payu.base_url = "https://secure.snd.payu.com/"
placetopay.base_url = "https://api-co-dev.placetopay.ws/gateway"
powertranz.base_url = "https://staging.ptranz.com/api/"
prophetpay.base_url = "https://ccm-thirdparty.cps.golf/"
rapyd.base_url = "https://sandboxapi.rapyd.net"
Expand Down
2 changes: 2 additions & 0 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ cards = [
"payme",
"paypal",
"payu",
"placetopay",
"powertranz",
"prophetpay",
"shift4",
Expand Down Expand Up @@ -202,6 +203,7 @@ payeezy.base_url = "https://api-cert.payeezy.com/"
payme.base_url = "https://sandbox.payme.io/"
paypal.base_url = "https://api-m.sandbox.paypal.com/"
payu.base_url = "https://secure.snd.payu.com/"
placetopay.base_url = "https://api-co-dev.placetopay.ws/gateway"
powertranz.base_url = "https://staging.ptranz.com/api/"
prophetpay.base_url = "https://ccm-thirdparty.cps.golf/"
rapyd.base_url = "https://sandboxapi.rapyd.net"
Expand Down
2 changes: 2 additions & 0 deletions config/docker_compose.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ payeezy.base_url = "https://api-cert.payeezy.com/"
payme.base_url = "https://sandbox.payme.io/"
paypal.base_url = "https://api-m.sandbox.paypal.com/"
payu.base_url = "https://secure.snd.payu.com/"
placetopay.base_url = "https://api-co-dev.placetopay.ws/gateway"
powertranz.base_url = "https://staging.ptranz.com/api/"
prophetpay.base_url = "https://ccm-thirdparty.cps.golf/"
rapyd.base_url = "https://sandboxapi.rapyd.net"
Expand Down Expand Up @@ -201,6 +202,7 @@ cards = [
"payme",
"paypal",
"payu",
"placetopay",
"powertranz",
"prophetpay",
"shift4",
Expand Down
2 changes: 0 additions & 2 deletions connector-template/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ pub struct {{project-name | downcase | pascal_case}}PaymentsRequest {

#[derive(Default, Debug, Serialize, Eq, PartialEq)]
pub struct {{project-name | downcase | pascal_case}}Card {
name: Secret<String>,
number: cards::CardNumber,
expiry_month: Secret<String>,
expiry_year: Secret<String>,
Expand All @@ -56,7 +55,6 @@ impl TryFrom<&{{project-name | downcase | pascal_case}}RouterData<&types::Paymen
match item.router_data.request.payment_method_data.clone() {
api::PaymentMethodData::Card(req_card) => {
let card = {{project-name | downcase | pascal_case}}Card {
name: req_card.card_holder_name,
number: req_card.card_number,
expiry_month: req_card.card_exp_month,
expiry_year: req_card.card_exp_year,
Expand Down
1 change: 1 addition & 0 deletions crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ pub enum Connector {
Payme,
Paypal,
Payu,
Placetopay,
Powertranz,
Prophetpay,
Rapyd,
Expand Down
1 change: 1 addition & 0 deletions crates/common_enums/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ pub enum RoutableConnectors {
Payme,
Paypal,
Payu,
Placetopay,
Powertranz,
Prophetpay,
Rapyd,
Expand Down
2 changes: 1 addition & 1 deletion crates/data_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub struct PaymentIntent {

pub updated_by: String,
pub surcharge_applicable: Option<bool>,
pub request_incremental_authorization: storage_enums::RequestIncrementalAuthorization,
pub request_incremental_authorization: Option<storage_enums::RequestIncrementalAuthorization>,
pub incremental_authorization_allowed: Option<bool>,
pub authorization_count: Option<i32>,
}
2 changes: 1 addition & 1 deletion crates/data_models/src/payments/payment_intent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub struct PaymentIntentNew {

pub updated_by: String,
pub surcharge_applicable: Option<bool>,
pub request_incremental_authorization: storage_enums::RequestIncrementalAuthorization,
pub request_incremental_authorization: Option<storage_enums::RequestIncrementalAuthorization>,
pub incremental_authorization_allowed: Option<bool>,
pub authorization_count: Option<i32>,
}
Expand Down
4 changes: 2 additions & 2 deletions crates/diesel_models/src/payment_intent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub struct PaymentIntent {

pub updated_by: String,
pub surcharge_applicable: Option<bool>,
pub request_incremental_authorization: RequestIncrementalAuthorization,
pub request_incremental_authorization: Option<RequestIncrementalAuthorization>,
pub incremental_authorization_allowed: Option<bool>,
pub authorization_count: Option<i32>,
}
Expand Down Expand Up @@ -109,7 +109,7 @@ pub struct PaymentIntentNew {
pub payment_confirm_source: Option<storage_enums::PaymentSource>,
pub updated_by: String,
pub surcharge_applicable: Option<bool>,
pub request_incremental_authorization: RequestIncrementalAuthorization,
pub request_incremental_authorization: Option<RequestIncrementalAuthorization>,
pub incremental_authorization_allowed: Option<bool>,
pub authorization_count: Option<i32>,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/diesel_models/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ diesel::table! {
#[max_length = 32]
updated_by -> Varchar,
surcharge_applicable -> Nullable<Bool>,
request_incremental_authorization -> RequestIncrementalAuthorization,
request_incremental_authorization -> Nullable<RequestIncrementalAuthorization>,
incremental_authorization_allowed -> Nullable<Bool>,
authorization_count -> Nullable<Int4>,
}
Expand Down
28 changes: 13 additions & 15 deletions crates/external_services/src/email/ses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ use error_stack::{report, IntoReport, ResultExt};
use hyper::Uri;
use masking::PeekInterface;
use router_env::logger;
use tokio::sync::OnceCell;

use crate::email::{EmailClient, EmailError, EmailResult, EmailSettings, IntermediateString};

/// Client for AWS SES operation
#[derive(Debug, Clone)]
pub struct AwsSes {
ses_client: OnceCell<Client>,
sender: String,
settings: EmailSettings,
}
Expand Down Expand Up @@ -70,13 +68,13 @@ pub enum AwsSesError {
impl AwsSes {
/// Constructs a new AwsSes client
pub async fn create(conf: &EmailSettings, proxy_url: Option<impl AsRef<str>>) -> Self {
// Build the client initially which will help us know if the email configuration is correct
Self::create_client(conf, proxy_url)
.await
.map_err(|error| logger::error!(?error, "Failed to initialize SES Client"))
.ok();

Self {
ses_client: OnceCell::new_with(
Self::create_client(conf, proxy_url)
.await
.map_err(|error| logger::error!(?error, "Failed to initialize SES Client"))
.ok(),
),
sender: conf.sender_email.clone(),
settings: conf.clone(),
}
Expand Down Expand Up @@ -222,13 +220,13 @@ impl EmailClient for AwsSes {
body: Self::RichText,
proxy_url: Option<&String>,
) -> EmailResult<()> {
self.ses_client
.get_or_try_init(|| async {
Self::create_client(&self.settings, proxy_url)
.await
.change_context(EmailError::ClientBuildingFailure)
})
.await?
// Not using the same email client which was created at startup as the role session would expire
// Create a client every time when the email is being sent
let email_client = Self::create_client(&self.settings, proxy_url)
.await
.change_context(EmailError::ClientBuildingFailure)?;

email_client
.send_email()
.from_email_address(self.sender.to_owned())
.destination(
Expand Down
1 change: 1 addition & 0 deletions crates/router/src/configs/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ pub struct Connectors {
pub payme: ConnectorParams,
pub paypal: ConnectorParams,
pub payu: ConnectorParams,
pub placetopay: ConnectorParams,
pub powertranz: ConnectorParams,
pub prophetpay: ConnectorParams,
pub rapyd: ConnectorParams,
Expand Down
9 changes: 5 additions & 4 deletions crates/router/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub mod payeezy;
pub mod payme;
pub mod paypal;
pub mod payu;
pub mod placetopay;
pub mod powertranz;
pub mod prophetpay;
pub mod rapyd;
Expand Down Expand Up @@ -63,8 +64,8 @@ pub use self::{
globalpay::Globalpay, globepay::Globepay, gocardless::Gocardless, helcim::Helcim,
iatapay::Iatapay, klarna::Klarna, mollie::Mollie, multisafepay::Multisafepay,
nexinets::Nexinets, nmi::Nmi, noon::Noon, nuvei::Nuvei, opayo::Opayo, opennode::Opennode,
payeezy::Payeezy, payme::Payme, paypal::Paypal, payu::Payu, powertranz::Powertranz,
prophetpay::Prophetpay, rapyd::Rapyd, shift4::Shift4, signifyd::Signifyd, square::Square,
stax::Stax, stripe::Stripe, trustpay::Trustpay, tsys::Tsys, volt::Volt, wise::Wise,
worldline::Worldline, worldpay::Worldpay, zen::Zen,
payeezy::Payeezy, payme::Payme, paypal::Paypal, payu::Payu, placetopay::Placetopay,
powertranz::Powertranz, prophetpay::Prophetpay, rapyd::Rapyd, shift4::Shift4,
signifyd::Signifyd, square::Square, stax::Stax, stripe::Stripe, trustpay::Trustpay, tsys::Tsys,
volt::Volt, wise::Wise, worldline::Worldline, worldpay::Worldpay, zen::Zen,
};
Loading

0 comments on commit aab2e0f

Please sign in to comment.