diff --git a/crates/api_models/src/customers.rs b/crates/api_models/src/customers.rs index 0fe9624ab3..3ccb8e0963 100644 --- a/crates/api_models/src/customers.rs +++ b/crates/api_models/src/customers.rs @@ -33,7 +33,7 @@ pub struct CustomerRequest { #[schema(value_type = Option,example = json!({ "city": "Bangalore", "country": "IN", - "line1": "Juspay router", + "line1": "Hyperswitch router", "line2": "Koramangala", "line3": "Stallion", "state": "Karnataka", @@ -73,7 +73,7 @@ pub struct CustomerResponse { #[schema(value_type = Option,example = json!({ "city": "Bangalore", "country": "IN", - "line1": "Juspay router", + "line1": "Hyperswitch router", "line2": "Koramangala", "line3": "Stallion", "state": "Karnataka", diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index ba192d83df..54ff974047 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -154,8 +154,8 @@ pub struct PaymentsRequest { pub billing: Option
, /// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. - #[schema(max_length = 255, example = "Juspay Router")] - pub statement_descriptor_name: Option, + #[schema(max_length = 255, example = "Hyperswitch Router")] + pub statement_descriptor: Option, /// Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. #[schema(max_length = 255, example = "Payment for shoes purchase")] @@ -861,8 +861,8 @@ pub struct PaymentsResponse { #[schema(value_type = Option, example = "no_three_ds", default = "three_ds")] pub authentication_type: Option, /// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. - #[schema(max_length = 255, example = "Juspay Router")] - pub statement_descriptor_name: Option, + #[schema(max_length = 255, example = "Hyperswitch Router")] + pub statement_descriptor: Option, /// Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 255 characters for the concatenated descriptor. #[schema(max_length = 255, example = "Payment for shoes purchase")] pub statement_descriptor_suffix: Option, diff --git a/crates/router/src/compatibility/stripe/payment_intents/types.rs b/crates/router/src/compatibility/stripe/payment_intents/types.rs index 077917813a..5c11ceb7a7 100644 --- a/crates/router/src/compatibility/stripe/payment_intents/types.rs +++ b/crates/router/src/compatibility/stripe/payment_intents/types.rs @@ -181,7 +181,7 @@ impl TryFrom for payments::PaymentsRequest { .billing_details .as_ref() .map(|b| payments::Address::from(b.to_owned())), - statement_descriptor_name: item.statement_descriptor, + statement_descriptor: item.statement_descriptor, statement_descriptor_suffix: item.statement_descriptor_suffix, metadata: item.metadata, client_secret: item.client_secret.map(|s| s.peek().clone()), @@ -336,7 +336,7 @@ impl From for StripePaymentIntentResponse { name: resp.name, phone: resp.phone, authentication_type: resp.authentication_type, - statement_descriptor_name: resp.statement_descriptor_name, + statement_descriptor_name: resp.statement_descriptor, statement_descriptor_suffix: resp.statement_descriptor_suffix, next_action: into_stripe_next_action(resp.next_action, resp.return_url), cancellation_reason: resp.cancellation_reason, diff --git a/crates/router/src/compatibility/stripe/setup_intents/types.rs b/crates/router/src/compatibility/stripe/setup_intents/types.rs index d9e58f3fe5..86e1e73fdc 100644 --- a/crates/router/src/compatibility/stripe/setup_intents/types.rs +++ b/crates/router/src/compatibility/stripe/setup_intents/types.rs @@ -159,7 +159,7 @@ impl From for payments::PaymentsRequest { .billing_details .as_ref() .map(|b| payments::Address::from(b.to_owned())), - statement_descriptor_name: item.statement_descriptor, + statement_descriptor: item.statement_descriptor, statement_descriptor_suffix: item.statement_descriptor_suffix, metadata: item.metadata, client_secret: item.client_secret.map(|s| s.peek().clone()), diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs index 09ac25fecd..6875b5a469 100644 --- a/crates/router/src/connector/stripe/transformers.rs +++ b/crates/router/src/connector/stripe/transformers.rs @@ -33,10 +33,6 @@ impl TryFrom<&types::ConnectorAuthType> for StripeAuthType { } } -// Stripe Types Definition -// PAYMENT -// PaymentIntentRequest - #[derive(Debug, Default, Eq, PartialEq, Serialize)] #[serde(rename_all = "lowercase")] pub enum StripeCaptureMethod { @@ -72,6 +68,7 @@ pub struct PaymentIntentRequest { pub amount: i64, //amount in cents, hence passed as integer pub currency: String, pub statement_descriptor_suffix: Option, + pub statement_descriptor: Option, #[serde(rename = "metadata[order_id]")] pub metadata_order_id: String, #[serde(rename = "metadata[txn_id]")] @@ -626,6 +623,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for PaymentIntentRequest { amount: item.request.amount, //hopefully we don't loose some cents here currency: item.request.currency.to_string(), //we need to copy the value and not transfer ownership statement_descriptor_suffix: item.request.statement_descriptor_suffix.clone(), + statement_descriptor: item.request.statement_descriptor.clone(), metadata_order_id, metadata_txn_id, metadata_txn_uuid, @@ -672,8 +670,6 @@ impl TryFrom<&types::VerifyRouterData> for SetupIntentRequest { } } -// PaymentIntentResponse - #[derive(Clone, Debug, Default, Eq, PartialEq, Deserialize, Serialize)] pub struct StripeMetadata { pub order_id: String, diff --git a/crates/router/src/core/payment_methods/transformers.rs b/crates/router/src/core/payment_methods/transformers.rs index fd0e779870..486ea1f49d 100644 --- a/crates/router/src/core/payment_methods/transformers.rs +++ b/crates/router/src/core/payment_methods/transformers.rs @@ -83,7 +83,7 @@ pub fn mk_add_card_request( card_exp_year: card.card_exp_year.clone(), merchant_id: locker_id, email_address: Some("dummy@gmail.com".to_string().into()), // - name_on_card: Some("juspay".to_string().into()), // [#256] + name_on_card: Some("John Doe".to_string().into()), // [#256] nickname: Some("router".to_string()), // }; let body = utils::Encode::>::encode(&add_card_req) diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs index ee20cdc4df..fac63910a3 100644 --- a/crates/router/src/core/payments/operations/payment_create.rs +++ b/crates/router/src/core/payments/operations/payment_create.rs @@ -500,7 +500,7 @@ impl PaymentCreate { return_url: request.return_url.as_ref().map(|a| a.to_string()), shipping_address_id, billing_address_id, - statement_descriptor_name: request.statement_descriptor_name.clone(), + statement_descriptor_name: request.statement_descriptor.clone(), statement_descriptor_suffix: request.statement_descriptor_suffix.clone(), metadata, ..storage::PaymentIntentNew::default() diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs index 2c53bec09e..5f4c510ed0 100644 --- a/crates/router/src/core/payments/transformers.rs +++ b/crates/router/src/core/payments/transformers.rs @@ -324,7 +324,7 @@ where .authentication_type .map(ForeignInto::foreign_into), ) - .set_statement_descriptor_name(payment_intent.statement_descriptor_name) + .set_statement_descriptor(payment_intent.statement_descriptor_name) .set_statement_descriptor_suffix(payment_intent.statement_descriptor_suffix) .set_setup_future_usage( payment_intent @@ -432,6 +432,7 @@ impl TryFrom> for types::PaymentsAuthorizeData { setup_mandate_details: payment_data.setup_mandate.clone(), confirm: payment_data.payment_attempt.confirm, statement_descriptor_suffix: payment_data.payment_intent.statement_descriptor_suffix, + statement_descriptor: payment_data.payment_intent.statement_descriptor_name, capture_method: payment_data.payment_attempt.capture_method, amount: payment_data.amount.into(), currency: payment_data.currency, diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs index 13354aff5b..f8033b0058 100644 --- a/crates/router/src/types.rs +++ b/crates/router/src/types.rs @@ -116,6 +116,7 @@ pub struct PaymentsAuthorizeData { pub currency: storage_enums::Currency, pub confirm: bool, pub statement_descriptor_suffix: Option, + pub statement_descriptor: Option, pub capture_method: Option, // Mandates pub setup_future_usage: Option, diff --git a/crates/router/tests/connectors/aci.rs b/crates/router/tests/connectors/aci.rs index c99eaeed9d..9fbf3a881f 100644 --- a/crates/router/tests/connectors/aci.rs +++ b/crates/router/tests/connectors/aci.rs @@ -44,6 +44,7 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData { }), confirm: true, statement_descriptor_suffix: None, + statement_descriptor: None, setup_future_usage: None, mandate_id: None, off_session: None, diff --git a/crates/router/tests/connectors/adyen.rs b/crates/router/tests/connectors/adyen.rs index 6c34f2f444..cff3c79606 100644 --- a/crates/router/tests/connectors/adyen.rs +++ b/crates/router/tests/connectors/adyen.rs @@ -72,6 +72,7 @@ impl AdyenTest { }), confirm: true, statement_descriptor_suffix: None, + statement_descriptor: None, setup_future_usage: None, mandate_id: None, off_session: None, diff --git a/crates/router/tests/connectors/authorizedotnet.rs b/crates/router/tests/connectors/authorizedotnet.rs index 737bda93de..b74d502f76 100644 --- a/crates/router/tests/connectors/authorizedotnet.rs +++ b/crates/router/tests/connectors/authorizedotnet.rs @@ -44,6 +44,7 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData { }), confirm: true, statement_descriptor_suffix: None, + statement_descriptor: None, setup_future_usage: None, mandate_id: None, off_session: None, diff --git a/crates/router/tests/connectors/checkout.rs b/crates/router/tests/connectors/checkout.rs index 151c1c98ad..2c28753cce 100644 --- a/crates/router/tests/connectors/checkout.rs +++ b/crates/router/tests/connectors/checkout.rs @@ -41,6 +41,7 @@ fn construct_payment_router_data() -> types::PaymentsAuthorizeRouterData { }), confirm: true, statement_descriptor_suffix: None, + statement_descriptor: None, setup_future_usage: None, mandate_id: None, off_session: None, diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rs index bcbc239dac..3e0f3f739c 100644 --- a/crates/router/tests/connectors/utils.rs +++ b/crates/router/tests/connectors/utils.rs @@ -475,6 +475,7 @@ impl Default for PaymentAuthorizeType { currency: enums::Currency::USD, confirm: true, statement_descriptor_suffix: None, + statement_descriptor: None, capture_method: None, setup_future_usage: None, mandate_id: None, diff --git a/crates/router/tests/connectors/worldline.rs b/crates/router/tests/connectors/worldline.rs index 0932123add..375b560115 100644 --- a/crates/router/tests/connectors/worldline.rs +++ b/crates/router/tests/connectors/worldline.rs @@ -74,6 +74,7 @@ impl WorldlineTest { }), confirm: true, statement_descriptor_suffix: None, + statement_descriptor: None, setup_future_usage: None, mandate_id: None, off_session: None, diff --git a/crates/router/tests/payments.rs b/crates/router/tests/payments.rs index 7436180ad6..e94069ad81 100644 --- a/crates/router/tests/payments.rs +++ b/crates/router/tests/payments.rs @@ -317,8 +317,8 @@ async fn payments_create_core() { address: None, phone: None, }), - statement_descriptor_name: Some("Juspay".to_string()), - statement_descriptor_suffix: Some("Router".to_string()), + statement_descriptor: Some("Hyperswtich".to_string()), + statement_descriptor_suffix: Some("Hyperswitch".to_string()), ..Default::default() }; @@ -463,7 +463,7 @@ async fn payments_create_core_adyen_no_redirect() { address: None, phone: None, }), - statement_descriptor_name: Some("Juspay".to_string()), + statement_descriptor: Some("Juspay".to_string()), statement_descriptor_suffix: Some("Router".to_string()), ..Default::default() }; diff --git a/crates/router/tests/payments2.rs b/crates/router/tests/payments2.rs index fecf9c9c90..c55a923223 100644 --- a/crates/router/tests/payments2.rs +++ b/crates/router/tests/payments2.rs @@ -77,8 +77,8 @@ async fn payments_create_core() { address: None, phone: None, }), - statement_descriptor_name: Some("Juspay".to_string()), - statement_descriptor_suffix: Some("Router".to_string()), + statement_descriptor: Some("Hyperswitch".to_string()), + statement_descriptor_suffix: Some("Hyperswitch".to_string()), ..<_>::default() }; @@ -229,7 +229,7 @@ async fn payments_create_core_adyen_no_redirect() { address: None, phone: None, }), - statement_descriptor_name: Some("Juspay".to_string()), + statement_descriptor: Some("Juspay".to_string()), statement_descriptor_suffix: Some("Router".to_string()), ..Default::default() }; diff --git a/crates/router/tests/utils.rs b/crates/router/tests/utils.rs index ef2497af2f..c420662d35 100644 --- a/crates/router/tests/utils.rs +++ b/crates/router/tests/utils.rs @@ -250,8 +250,8 @@ fn mk_payment(amount: i64, amount_to_capture: i32) -> Value { "card_cvc": "123" } }, - "statement_descriptor_name": "Juspay", - "statement_descriptor_suffix": "Router", + "statement_descriptor_name": "Hyperswitch", + "statement_descriptor_suffix": "Hyperswitch", "metadata": { "udf1": "value1", "new_customer": "true", diff --git a/openapi/generated.json b/openapi/generated.json index 659dbe5f8f..2599000695 100644 --- a/openapi/generated.json +++ b/openapi/generated.json @@ -4397,10 +4397,10 @@ "billing": { "$ref": "#/components/schemas/Address" }, - "statement_descriptor_name": { + "statement_descriptor": { "type": "string", "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.", - "example": "Juspay Router", + "example": "Hyperswitch Router", "maxLength": 255 }, "statement_descriptor_suffix": { @@ -4593,10 +4593,10 @@ "authentication_type": { "$ref": "#/components/schemas/AuthenticationType" }, - "statement_descriptor_name": { + "statement_descriptor": { "type": "string", "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.", - "example": "Juspay Router", + "example": "Hyperswitch Router", "maxLength": 255 }, "statement_descriptor_suffix": { diff --git a/postman/portman-config.json b/postman/portman-config.json index cdfb2b6594..3d7da939c6 100644 --- a/postman/portman-config.json +++ b/postman/portman-config.json @@ -432,7 +432,7 @@ }, { "key": "address.line1", - "value": "Juspay router" + "value": "Hyperswitch router" }, { "key": "address.line2", @@ -523,7 +523,7 @@ }, { "key": "address.line1", - "value": "Juspay router" + "value": "Hyperswitch router" }, { "key": "address.line2", @@ -928,7 +928,7 @@ }, { "key": "address.line1", - "value": "Juspay router" + "value": "Hyperswitch router" }, { "key": "address.line2",