mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat(connector): add authorize, capture, void, refund, psync, rsync support for Dlocal connector (#650)
Co-authored-by: Venkatesh <inventvenkat@gmail.com>
This commit is contained in:
@ -14,7 +14,12 @@ pub mod validation;
|
||||
|
||||
/// Date-time utilities.
|
||||
pub mod date_time {
|
||||
use time::{Instant, OffsetDateTime, PrimitiveDateTime};
|
||||
use std::num::NonZeroU8;
|
||||
|
||||
use time::{
|
||||
format_description::well_known::iso8601::{Config, EncodedConfig, Iso8601, TimePrecision},
|
||||
Instant, OffsetDateTime, PrimitiveDateTime,
|
||||
};
|
||||
/// Struct to represent milliseconds in time sensitive data fields
|
||||
#[derive(Debug)]
|
||||
pub struct Milliseconds(i32);
|
||||
@ -43,6 +48,16 @@ pub mod date_time {
|
||||
let result = block().await;
|
||||
(result, start.elapsed().as_seconds_f64() * 1000f64)
|
||||
}
|
||||
|
||||
/// Return the current date and time in UTC with the format [year]-[month]-[day]T[hour]:[minute]:[second].mmmZ Eg: 2023-02-15T13:33:18.898Z
|
||||
pub fn date_as_yyyymmddthhmmssmmmz() -> Result<String, time::error::Format> {
|
||||
const ISO_CONFIG: EncodedConfig = Config::DEFAULT
|
||||
.set_time_precision(TimePrecision::Second {
|
||||
decimal_digits: NonZeroU8::new(3),
|
||||
})
|
||||
.encode();
|
||||
now().assume_utc().format(&Iso8601::<ISO_CONFIG>)
|
||||
}
|
||||
}
|
||||
|
||||
/// Generate a nanoid with the given prefix and length
|
||||
|
||||
Reference in New Issue
Block a user