Remove stripe duplicate endpoint (#186)
This commit is contained in:
parent
2b1829a882
commit
c1a3a2dfbb
@ -181,8 +181,7 @@ pub async fn serve(
|
|||||||
)
|
)
|
||||||
.route(
|
.route(
|
||||||
"/user/balance/stripe",
|
"/user/balance/stripe",
|
||||||
get(users::payment_stripe::user_stripe_deposits_get)
|
post(users::payment_stripe::user_balance_stripe_post),
|
||||||
.post(users::payment_stripe::user_balance_stripe_post),
|
|
||||||
)
|
)
|
||||||
.route(
|
.route(
|
||||||
"/user/balance/:tx_hash",
|
"/user/balance/:tx_hash",
|
||||||
|
@ -20,33 +20,6 @@ use std::sync::Arc;
|
|||||||
use stripe::Webhook;
|
use stripe::Webhook;
|
||||||
use tracing::{debug, error, warn};
|
use tracing::{debug, error, warn};
|
||||||
|
|
||||||
/// `GET /user/balance/stripe` -- Use a bearer token to get the user's balance and spend.
|
|
||||||
///
|
|
||||||
/// - shows a list of all stripe deposits, all fields from entity
|
|
||||||
#[debug_handler]
|
|
||||||
pub async fn user_stripe_deposits_get(
|
|
||||||
Extension(app): Extension<Arc<Web3ProxyApp>>,
|
|
||||||
TypedHeader(Authorization(bearer)): TypedHeader<Authorization<Bearer>>,
|
|
||||||
) -> Web3ProxyResponse {
|
|
||||||
let user = app.bearer_is_authorized(bearer).await?;
|
|
||||||
|
|
||||||
let db_replica = app.db_replica().context("Getting database connection")?;
|
|
||||||
|
|
||||||
// Filter by user ...
|
|
||||||
let receipts = stripe_increase_balance_receipt::Entity::find()
|
|
||||||
.filter(stripe_increase_balance_receipt::Column::DepositToUserId.eq(user.id))
|
|
||||||
.all(db_replica.as_ref())
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
// Return the response, all except the user ...
|
|
||||||
let response = json!({
|
|
||||||
"user": Address::from_slice(&user.address),
|
|
||||||
"deposits": receipts,
|
|
||||||
});
|
|
||||||
|
|
||||||
Ok(Json(response).into_response())
|
|
||||||
}
|
|
||||||
|
|
||||||
/// `POST /user/balance/stripe` -- Process a stripe transaction;
|
/// `POST /user/balance/stripe` -- Process a stripe transaction;
|
||||||
/// this endpoint is called from the webhook with the user_id parameter in the request
|
/// this endpoint is called from the webhook with the user_id parameter in the request
|
||||||
#[debug_handler]
|
#[debug_handler]
|
||||||
|
Loading…
Reference in New Issue
Block a user