Payments/subscriptions support (#943)

* [wip] Payments/subscriptions support

* finish

* working payment flow

* finish subscriptions, lint, clippy, etc

* docker compose
This commit is contained in:
Geometrically
2024-08-14 17:14:52 -07:00
committed by GitHub
parent 60edbcd5f0
commit 1d0d8d7fbe
71 changed files with 4009 additions and 1101 deletions

View File

@@ -1,5 +1,5 @@
use crate::validate::{filter_out_packs, SupportedGameVersions, ValidationError, ValidationResult};
use chrono::{DateTime, NaiveDateTime, Utc};
use chrono::DateTime;
use std::io::Cursor;
use zip::ZipArchive;
@@ -16,10 +16,7 @@ impl super::Validator for ForgeValidator {
fn get_supported_game_versions(&self) -> SupportedGameVersions {
// Time since release of 1.13, the first forge version which uses the new TOML system
SupportedGameVersions::PastDate(DateTime::<Utc>::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(1540122067, 0).unwrap(),
Utc,
))
SupportedGameVersions::PastDate(DateTime::from_timestamp(1540122067, 0).unwrap())
}
fn validate(
@@ -55,14 +52,8 @@ impl super::Validator for LegacyForgeValidator {
fn get_supported_game_versions(&self) -> SupportedGameVersions {
// Times between versions 1.5.2 to 1.12.2, which all use the legacy way of defining mods
SupportedGameVersions::Range(
DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(0, 0).unwrap(),
Utc,
),
DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(1540122066, 0).unwrap(),
Utc,
),
DateTime::from_timestamp(0, 0).unwrap(),
DateTime::from_timestamp(1540122066, 0).unwrap(),
)
}

View File

@@ -1,5 +1,5 @@
use crate::validate::{filter_out_packs, SupportedGameVersions, ValidationError, ValidationResult};
use chrono::{DateTime, NaiveDateTime, Utc};
use chrono::DateTime;
use std::io::Cursor;
use zip::ZipArchive;
@@ -15,10 +15,7 @@ impl super::Validator for QuiltValidator {
}
fn get_supported_game_versions(&self) -> SupportedGameVersions {
SupportedGameVersions::PastDate(DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(1646070100, 0).unwrap(),
Utc,
))
SupportedGameVersions::PastDate(DateTime::from_timestamp(1646070100, 0).unwrap())
}
fn validate(

View File

@@ -1,5 +1,5 @@
use crate::validate::{SupportedGameVersions, ValidationError, ValidationResult};
use chrono::{DateTime, NaiveDateTime, Utc};
use chrono::DateTime;
use std::io::Cursor;
use zip::ZipArchive;
@@ -16,10 +16,7 @@ impl super::Validator for PackValidator {
fn get_supported_game_versions(&self) -> SupportedGameVersions {
// Time since release of 13w24a which replaced texture packs with resource packs
SupportedGameVersions::PastDate(DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(1371137542, 0).unwrap(),
Utc,
))
SupportedGameVersions::PastDate(DateTime::from_timestamp(1371137542, 0).unwrap())
}
fn validate(
@@ -50,14 +47,8 @@ impl super::Validator for TexturePackValidator {
fn get_supported_game_versions(&self) -> SupportedGameVersions {
// a1.2.2a to 13w23b
SupportedGameVersions::Range(
DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(1289339999, 0).unwrap(),
Utc,
),
DateTime::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(1370651522, 0).unwrap(),
Utc,
),
DateTime::from_timestamp(1289339999, 0).unwrap(),
DateTime::from_timestamp(1370651522, 0).unwrap(),
)
}