Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions crates/api_models/src/payment_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ use utoipa::{schema, ToSchema};
#[cfg(feature = "payouts")]
use crate::payouts;
use crate::{
admin,
customers::CustomerId,
enums as api_enums,
admin, enums as api_enums,
payments::{self, BankCodeResponse},
};

Expand Down Expand Up @@ -459,8 +457,6 @@ pub struct RequestPaymentMethodTypes {
#[derive(Debug, Clone, serde::Serialize, Default, ToSchema)]
#[serde(deny_unknown_fields)]
pub struct PaymentMethodListRequest {
#[serde(skip_deserializing)]
pub customer_id: Option<CustomerId>,
Comment on lines -462 to -463
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check with the @juspay/hyperswitch-sdk-devs folks once to ensure that this field is not being passed. If it is removed here, then any client who was passing this field will fail to work because of #[serde(deny_unknown_fields)]

/// This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK
#[schema(max_length = 30, min_length = 30, example = "secret_k2uj3he2893ein2d")]
pub client_secret: Option<String>,
Expand Down
8 changes: 1 addition & 7 deletions crates/router/src/routes/payment_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ pub async fn list_payment_method_api(
get,
path = "/customers/{customer_id}/payment_methods",
params (
("customer_id" = String, Path, description = "The unique identifier for the customer account"),
("accepted_country" = Vec<String>, Query, description = "The two-letter ISO currency code"),
("accepted_currency" = Vec<Currency>, Path, description = "The three-letter ISO currency code"),
("minimum_amount" = i64, Query, description = "The minimum amount accepted for processing by the particular payment method."),
Expand All @@ -134,10 +133,6 @@ pub async fn list_customer_payment_method_api(
) -> HttpResponse {
let flow = Flow::CustomerPaymentMethodsList;
let payload = query_payload.into_inner();
let (auth, _) = match auth::check_client_secret_and_get_auth(req.headers(), &payload) {
Ok((auth, _auth_flow)) => (auth, _auth_flow),
Err(e) => return api::log_and_return_error_response(e),
};
let customer_id = customer_id.into_inner().0;
Box::pin(api::server_wrap(
flow,
Expand All @@ -153,7 +148,7 @@ pub async fn list_customer_payment_method_api(
Some(&customer_id),
)
},
&*auth,
&auth::ApiKeyAuth,
api_locking::LockAction::NotApplicable,
))
.await
Expand All @@ -166,7 +161,6 @@ pub async fn list_customer_payment_method_api(
path = "/customers/payment_methods",
params (
("client-secret" = String, Path, description = "A secret known only to your application and the authorization server"),
("customer_id" = String, Path, description = "The unique identifier for the customer account"),
("accepted_country" = Vec<String>, Query, description = "The two-letter ISO currency code"),
("accepted_currency" = Vec<Currency>, Path, description = "The three-letter ISO currency code"),
("minimum_amount" = i64, Query, description = "The minimum amount accepted for processing by the particular payment method."),
Expand Down
18 changes: 0 additions & 18 deletions openapi/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -473,15 +473,6 @@
"type": "string"
}
},
{
"name": "customer_id",
"in": "path",
"description": "The unique identifier for the customer account",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "accepted_country",
"in": "query",
Expand Down Expand Up @@ -711,15 +702,6 @@
"description": "List payment methods for a Customer\n\nTo filter and list the applicable payment methods for a particular Customer ID",
"operationId": "List all Payment Methods for a Customer",
"parameters": [
{
"name": "customer_id",
"in": "path",
"description": "The unique identifier for the customer account",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "accepted_country",
"in": "query",
Expand Down