Move charges to DB + fix subscription recurring payments (#971)

* Move charges to DB + fix subscription recurring payments

* Finish most + pyro integration

* Finish billing

* Run prepare

* Fix intervals

* Fix clippy

* Remove unused test
This commit is contained in:
Geometrically
2024-10-09 21:11:30 -07:00
committed by GitHub
parent 28b6bf8603
commit c88bfbb5f0
33 changed files with 1692 additions and 816 deletions

View File

@@ -259,15 +259,24 @@ pub fn app_setup(
}
let stripe_client = stripe::Client::new(dotenvy::var("STRIPE_API_KEY").unwrap());
// {
// let pool_ref = pool.clone();
// let redis_ref = redis_pool.clone();
// let stripe_client_ref = stripe_client.clone();
//
// actix_rt::spawn(async move {
// routes::internal::billing::task(stripe_client_ref, pool_ref, redis_ref).await;
// });
// }
{
let pool_ref = pool.clone();
let redis_ref = redis_pool.clone();
let stripe_client_ref = stripe_client.clone();
actix_rt::spawn(async move {
routes::internal::billing::task(stripe_client_ref, pool_ref, redis_ref).await;
});
}
{
let pool_ref = pool.clone();
let redis_ref = redis_pool.clone();
actix_rt::spawn(async move {
routes::internal::billing::subscription_task(pool_ref, redis_ref).await;
});
}
let ip_salt = Pepper {
pepper: models::ids::Base62Id(models::ids::random_base62(11)).to_string(),
@@ -456,5 +465,7 @@ pub fn check_env_vars() -> bool {
failed |= check_var::<u64>("ADITUDE_API_KEY");
failed |= check_var::<String>("PYRO_API_KEY");
failed
}