mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 09:28:11 +00:00
about to test new crate to isolate new version of async-stripe
This commit is contained in:
1 parent
3c89cf595e
commit
cec81bfb8e
4 files changed
+60
-5
No files matched your search
@@ -0,0 +1,54 @@
|
||||
[package]
|
||||
publish = false
|
||||
name = "billing_component"
|
||||
edition = "2018"
|
||||
version = "0.0.1"
|
||||
authors = [
|
||||
"Brandon Thomas <bt@brand.io>",
|
||||
"Brandon Thomas <echelon@gmail.com>",
|
||||
]
|
||||
|
||||
[lib]
|
||||
# NB: This might be necessitated because of stripe API versions vs. async-stripe crate versions
|
||||
name = "billing_artcraft"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[package.metadata.cargo-udeps.ignore]
|
||||
normal = ["workspace-build-acceleration"]
|
||||
|
||||
[dependencies]
|
||||
# Workspace hack (faster compile times)
|
||||
workspace-build-acceleration.workspace = true
|
||||
|
||||
# Internal
|
||||
errors.workspace = true
|
||||
mysql_queries.workspace = true
|
||||
#http_server_common = { path = "../../../lib/deprecated/http_server_common" }
|
||||
#mysql_queries = { path = "../../../schema/database/mysql_queries" }
|
||||
#reusable_types = { path = "../../../schema/public/reusable_types" }
|
||||
#url_config = { path = "../../../lib/url_config" }
|
||||
#user_traits_component = { path = "../user_traits_component" }
|
||||
|
||||
# External
|
||||
actix-http.workspace = true
|
||||
actix-web.workspace = true
|
||||
anyhow.workspace = true
|
||||
chrono.workspace = true
|
||||
log.workspace = true
|
||||
once_cell.workspace = true
|
||||
serde.workspace = true
|
||||
serde_derive.workspace = true
|
||||
serde_json.workspace = true
|
||||
|
||||
# Money
|
||||
async-stripe = { version = "1.0.0-alpha.2", features = ["runtime-tokio-hyper"] }
|
||||
async-stripe-core = { version = "1.0.0-alpha.2", features = ["customer"] }
|
||||
|
||||
#sqlx = { version = "0.7.4", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] }
|
||||
#utoipa = { version = "4", features = ["chrono","actix_extras"] }
|
||||
|
||||
[dev-dependencies]
|
||||
mockall = "0.12.1"
|
||||
|
||||
# NB: Tokio version matches `async-stripe` transitive dep; features are for testing
|
||||
tokio = { version = "1.38.0", features = ["rt", "macros"] }
|
||||
Whitespace-only changes.
@@ -101,6 +101,11 @@ url.workspace = true
|
||||
|
||||
# Stripe for ArtCraft
|
||||
async_stripe_artcraft = { package = "async-stripe", version = "0.41.0", default-features = false, features = ["runtime-tokio-hyper", "connect", "billing", "checkout", "webhook-events"] }
|
||||
#async_stripe_artcraft = { git = "https://github.com/arlyon/async-stripe", branch = "openapi-1720743905", default-features = false, features = ["runtime-tokio-hyper", "connect", "billing", "checkout", "webhook-events"] }
|
||||
#async_stripe_artcraft = { git = "https://github.com/arlyon/async-stripe", branch = "next", default-features = false, features = ["runtime-tokio-hyper", "connect", "billing", "checkout", "webhook-events"] }
|
||||
|
||||
# Money
|
||||
async-stripe = { version = "0.26.0", default-features = false, features = ["runtime-tokio-hyper", "connect", "billing", "checkout", "webhook-events"] }
|
||||
|
||||
# Language tag parsing
|
||||
# TODO: Move to language support crate
|
||||
@@ -145,9 +150,6 @@ actix-web.workspace = true
|
||||
actix-web-actors.workspace = true
|
||||
actix-web-lab.workspace = true
|
||||
|
||||
# Money
|
||||
async-stripe = { version = "0.26.0", default-features = false, features = ["runtime-tokio-hyper", "connect", "billing", "checkout", "webhook-events"] }
|
||||
|
||||
# Crypto
|
||||
magic-crypt = "3.1.13" # encrypting sort IDs for the frontend so we don't leak info
|
||||
md-5 = "0.10.6" # gravatar
|
||||
|
||||
+1
-2
@@ -13,8 +13,6 @@ use mysql_queries::queries::billing::stripe::insert_stripe_webhook_event_log::In
|
||||
use sqlx::pool::PoolConnection;
|
||||
use sqlx::{MySql, MySqlConnection, MySqlPool};
|
||||
use std::sync::Arc;
|
||||
// TODO: Webhook signing key
|
||||
// Mysql connector
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct StripeArtcraftWebhookSuccessResponse {
|
||||
@@ -62,6 +60,7 @@ pub async fn stripe_artcraft_webhook_handler(
|
||||
.map_err(|e| {
|
||||
let reason = format!("Could not construct Stripe webhook event: {:?}", e);
|
||||
error!("{}", &reason);
|
||||
println!("{:?}", webhook_payload);
|
||||
CommonWebError::BadInputWithSimpleMessage(reason)
|
||||
})?;
|
||||
|
||||
|
||||
Reference in new issue
Block a user