Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(connector): revert noon-paypal (#7864)

Swangi Kumari776bde00efce
diff --git a/config/config.example.toml b/config/config.example.toml
index a84f130b45..15b9dd2fc4 100644
--- a/config/config.example.toml
+++ b/config/config.example.toml
@@ -584,9 +584,6 @@ debit = { country = "US,CA", currency = "USD" }
[pm_filters.volt]
open_banking_uk = { country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "EUR,GBP,DKK,NOK,PLN,SEK,AUD,BRL" }
-[pm_filters.noon]
-paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD,AED,SAR"}
-
[pm_filters.razorpay]
upi_collect = { country = "IN", currency = "INR" }
diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml
index 4e3c2881cd..802af333f8 100644
--- a/config/deployments/integration_test.toml
+++ b/config/deployments/integration_test.toml
@@ -458,9 +458,6 @@ paypal = { country = "AD,AE,AL,AM,AR,AT,AU,AZ,BA,BB,BD,BE,BG,BH,BI,BM,BN,BO,BR,B
[pm_filters.volt]
open_banking_uk = {country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "EUR,GBP,DKK,NOK,PLN,SEK,AUD,BRL"}
-[pm_filters.noon]
-paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD,AED,SAR"}
-
[pm_filters.razorpay]
upi_collect = {country = "IN", currency = "INR"}
diff --git a/config/deployments/production.toml b/config/deployments/production.toml
index 4c46815b9e..3cc5b8c0f8 100644
--- a/config/deployments/production.toml
+++ b/config/deployments/production.toml
@@ -472,9 +472,6 @@ ach = { country = "US", currency = "USD" }
[pm_filters.volt]
open_banking_uk = {country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "EUR,GBP,DKK,NOK,PLN,SEK,AUD,BRL"}
-[pm_filters.noon]
-paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD,AED,SAR"}
-
[pm_filters.razorpay]
upi_collect = {country = "IN", currency = "INR"}
diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml
index 69e5d4faed..c3555f7ea0 100644
--- a/config/deployments/sandbox.toml
+++ b/config/deployments/sandbox.toml
@@ -474,9 +474,6 @@ ach = { country = "US", currency = "USD" }
[pm_filters.volt]
open_banking_uk = { country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "EUR,GBP,DKK,NOK,PLN,SEK,AUD,BRL" }
-[pm_filters.noon]
-paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD,AED,SAR"}
-
[pm_filters.razorpay]
upi_collect = {country = "IN", currency = "INR"}
diff --git a/config/development.toml b/config/development.toml
index 2ea80035c8..37c496efba 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -434,9 +434,6 @@ ach = { country = "US", currency = "USD" }
[pm_filters.volt]
open_banking_uk = { country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "EUR,GBP,DKK,NOK,PLN,SEK,AUD,BRL" }
-[pm_filters.noon]
-paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD,AED,SAR"}
-
[pm_filters.razorpay]
upi_collect = { country = "IN", currency = "INR" }
diff --git a/config/docker_compose.toml b/config/docker_compose.toml
index 75e8bf5b77..4b0214b8f1 100644
--- a/config/docker_compose.toml
+++ b/config/docker_compose.toml
@@ -486,9 +486,6 @@ debit = { country = "US,CA", currency = "USD" }
[pm_filters.volt]
open_banking_uk = { country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,MT,NL,PT,SI,SK,BG,CZ,DK,HU,NO,PL,RO,SE,AU,BR", currency = "EUR,GBP,DKK,NOK,PLN,SEK,AUD,BRL" }
-[pm_filters.noon]
-paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD,AED,SAR"}
-
[pm_filters.razorpay]
upi_collect = { country = "IN", currency = "INR" }
diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml
index 3eec123c8c..efc797a5a1 100644
--- a/crates/connector_configs/toml/production.toml
+++ b/crates/connector_configs/toml/production.toml
@@ -2241,133 +2241,6 @@ key1="Public Key"
[nmi.connector_webhook_details]
merchant_secret="Source verification key"
-[noon]
-[[noon.credit]]
- payment_method_type = "Mastercard"
-[[noon.credit]]
- payment_method_type = "Visa"
-[[noon.credit]]
- payment_method_type = "Interac"
-[[noon.credit]]
- payment_method_type = "AmericanExpress"
-[[noon.credit]]
- payment_method_type = "JCB"
-[[noon.credit]]
- payment_method_type = "DinersClub"
-[[noon.credit]]
- payment_method_type = "Discover"
-[[noon.credit]]
- payment_method_type = "CartesBancaires"
-[[noon.credit]]
- payment_method_type = "UnionPay"
-[[noon.debit]]
- payment_method_type = "Mastercard"
-[[noon.debit]]
- payment_method_type = "Visa"
-[[noon.debit]]
- payment_method_type = "Interac"
-[[noon.debit]]
- payment_method_type = "AmericanExpress"
-[[noon.debit]]
- payment_method_type = "JCB"
-[[noon.debit]]
- payment_method_type = "DinersClub"
-[[noon.debit]]
- payment_method_type = "Discover"
-[[noon.debit]]
- payment_method_type = "CartesBancaires"
-[[noon.debit]]
- payment_method_type = "UnionPay"
-[[noon.wallet]]
- payment_method_type = "apple_pay"
-[[noon.wallet]]
- payment_method_type = "google_pay"
-[[noon.wallet]]
- payment_method_type = "paypal"
-[noon.connector_auth.SignatureKey]
-api_key="API Key"
-key1="Business Identifier"
-api_secret="Application Identifier"
-[noon.connector_webhook_details]
-merchant_secret="Source verification key"
-
-[[noon.metadata.apple_pay]]
-name="certificate"
-label="Merchant Certificate (Base64 Encoded)"
-placeholder="Enter Merchant Certificate (Base64 Encoded)"
-required=true
-type="Text"
-[[noon.metadata.apple_pay]]
-name="certificate_keys"
-label="Merchant PrivateKey (Base64 Encoded)"
-placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
-required=true
-type="Text"
-[[noon.metadata.apple_pay]]
-name="merchant_identifier"
-label="Apple Merchant Identifier"
-placeholder="Enter Apple Merchant Identifier"
-required=true
-type="Text"
-[[noon.metadata.apple_pay]]
-name="display_name"
-label="Display Name"
-placeholder="Enter Display Name"
-required=true
-type="Text"
-[[noon.metadata.apple_pay]]
-name="initiative"
-label="Domain"
-placeholder="Enter Domain"
-required=true
-type="Text"
-[[noon.metadata.apple_pay]]
-name="initiative_context"
-label="Domain Name"
-placeholder="Enter Domain Name"
-required=true
-type="Text"
-[[noon.metadata.apple_pay]]
-name="merchant_business_country"
-label="Merchant Business Country"
-placeholder="Enter Merchant Business Country"
-required=true
-type="Select"
-options=[]
-[[noon.metadata.apple_pay]]
-name="payment_processing_details_at"
-label="Payment Processing Details At"
-placeholder="Enter Payment Processing Details At"
-required=true
-type="Radio"
-options=["Connector"]
-
-[[noon.metadata.google_pay]]
-name="merchant_name"
-label="Google Pay Merchant Name"
-placeholder="Enter Google Pay Merchant Name"
-required=true
-type="Text"
-[[noon.metadata.google_pay]]
-name="merchant_id"
-label="Google Pay Merchant Id"
-placeholder="Enter Google Pay Merchant Id"
-required=true
-type="Text"
-[[noon.metadata.google_pay]]
-name="gateway_merchant_id"
-label="Google Pay Merchant Key"
-placeholder="Enter Google Pay Merchant Key"
-required=true
-type="Text"
-[[noon.metadata.google_pay]]
-name="allowed_auth_methods"
-label="Allowed Auth Methods"
-placeholder="Enter Allowed Auth Methods"
-required=true
-type="MultiSelect"
-options=["PAN_ONLY", "CRYPTOGRAM_3DS"]
-
[novalnet]
[[novalnet.credit]]
payment_method_type = "Mastercard"
diff --git a/crates/hyperswitch_connectors/src/connectors/noon.rs b/crates/hyperswitch_connectors/src/connectors/noon.rs
index 2c16bd3e05..933d08d7a0 100644
--- a/crates/hyperswitch_connectors/src/connectors/noon.rs
+++ b/crates/hyperswitch_connectors/src/connectors/noon.rs
@@ -19,19 +19,16 @@ use hyperswitch_domain_models::{
mandate_revoke::MandateRevoke,
payments::{Authorize, Capture, PSync, PaymentMethodToken, Session, SetupMandate, Void},
refunds::{Execute, RSync},
- CompleteAuthorize,
},
router_request_types::{
- AccessTokenRequestData, CompleteAuthorizeData, MandateRevokeRequestData,
- PaymentMethodTokenizationData, PaymentsAuthorizeData, PaymentsCancelData,
- PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData, RefundsData,
- SetupMandateRequestData,
+ AccessTokenRequestData, MandateRevokeRequestData, PaymentMethodTokenizationData,
+ PaymentsAuthorizeData, PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData,
+ PaymentsSyncData, RefundsData, SetupMandateRequestData,
},
router_response_types::{MandateRevokeResponseData, PaymentsResponseData, RefundsResponseData},
types::{
MandateRevokeRouterData, PaymentsAuthorizeRouterData, PaymentsCancelRouterData,
- PaymentsCaptureRouterData, PaymentsCompleteAuthorizeRouterData, PaymentsSyncRouterData,
- RefundSyncRouterData, RefundsRouterData,
+ PaymentsCaptureRouterData, PaymentsSyncRouterData, RefundSyncRouterData, RefundsRouterData,
},
};
use hyperswitch_interfaces::{
@@ -43,9 +40,8 @@ use hyperswitch_interfaces::{
errors,
events::connector_api_logs::ConnectorEvent,
types::{
- MandateRevokeType, PaymentsAuthorizeType, PaymentsCaptureType,
- PaymentsCompleteAuthorizeType, PaymentsSyncType, PaymentsVoidType, RefundExecuteType,
- RefundSyncType, Response,
+ MandateRevokeType, PaymentsAuthorizeType, PaymentsCaptureType, PaymentsSyncType,
+ PaymentsVoidType, RefundExecuteType, RefundSyncType, Response,
},
webhooks,
};
@@ -331,125 +327,11 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
event_builder: Option<&mut ConnectorEvent>,
res: Response,
) -> CustomResult<PaymentsAuthorizeRouterData, errors::ConnectorError> {
- let response: noon::NoonAuthPaymentResponse = res
+ let response: noon::NoonPaymentsResponse = res
.response
.parse_struct("Noon PaymentsAuthorizeResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
- match response {
- noon::NoonAuthPaymentResponse::NoonPaypalResponse(response) => {
- event_builder.map(|i| i.set_response_body(&response));
- router_env::logger::info!(connector_response=?response);
- RouterData::try_from(ResponseRouterData {
- response,
- data: data.clone(),
- http_code: res.status_code,
- })
- }
- noon::NoonAuthPaymentResponse::NoonPaymentsResponse(response) => {
- event_builder.map(|i| i.set_response_body(&response));
- router_env::logger::info!(connector_response=?response);
- RouterData::try_from(ResponseRouterData {
- response,
- data: data.clone(),
- http_code: res.status_code,
- })
- }
- }
- }
-
- fn get_error_response(
- &self,
- res: Response,
- event_builder: Option<&mut ConnectorEvent>,
- ) -> CustomResult<ErrorResponse, errors::ConnectorError> {
- self.build_error_response(res, event_builder)
- }
-}
-
-impl api::PaymentsCompleteAuthorize for Noon {}
-
-impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData> for Noon {
- fn get_headers(
- &self,
- req: &PaymentsCompleteAuthorizeRouterData,
- connectors: &Connectors,
- ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
- self.build_headers(req, connectors)
- }
- fn get_content_type(&self) -> &'static str {
- self.common_get_content_type()
- }
-
- fn get_url(
- &self,
- _req: &PaymentsCompleteAuthorizeRouterData,
- connectors: &Connectors,
- ) -> CustomResult<String, errors::ConnectorError> {
- Ok(format!("{}payment/v1/order", self.base_url(connectors)))
- }
-
- fn get_request_body(
- &self,
- req: &PaymentsCompleteAuthorizeRouterData,
- _connectors: &Connectors,
- ) -> CustomResult<RequestContent, errors::ConnectorError> {
- let amount = connector_utils::convert_amount(
- self.amount_converter,
- req.request.minor_amount,
- req.request.currency,
- )?;
-
- let mandate_details =
- connector_utils::get_mandate_details(req.request.setup_mandate_details.clone())?;
- let mandate_amount = mandate_details
- .map(|mandate| {
- connector_utils::convert_amount(
- self.amount_converter,
- mandate.amount,
- mandate.currency,
- )
- })
- .transpose()?;
- let connector_router_data = noon::NoonRouterData::from((amount, req, mandate_amount));
- let connector_req =
- noon::NoonPaymentsCompleteAuthorizeRequest::try_from(&connector_router_data)?;
- Ok(RequestContent::Json(Box::new(connector_req)))
- }
-
- fn build_request(
- &self,
- req: &PaymentsCompleteAuthorizeRouterData,
- connectors: &Connectors,
- ) -> CustomResult<Option<Request>, errors::ConnectorError> {
- Ok(Some(
- RequestBuilder::new()
- .method(Method::Post)
- .url(&PaymentsCompleteAuthorizeType::get_url(
- self, req, connectors,
- )?)
- .attach_default_headers()
- .headers(PaymentsCompleteAuthorizeType::get_headers(
- self, req, connectors,
- )?)
- .set_body(PaymentsCompleteAuthorizeType::get_request_body(
- self, req, connectors,
- )?)
- .build(),
- ))
- }
-
- fn handle_response(
- &self,
- data: &PaymentsCompleteAuthorizeRouterData,
- event_builder: Option<&mut ConnectorEvent>,
- res: Response,
- ) -> CustomResult<PaymentsCompleteAuthorizeRouterData, errors::ConnectorError> {
- let response: noon::NoonPaypalResponse = res
- .response
- .parse_struct("Noon NoonPaypalResponse")
- .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
-
event_builder.map(|i| i.set_response_body(&response));
router_env::logger::info!(connector_response=?response);
@@ -459,6 +341,7 @@ impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResp
http_code: res.status_code,
})
}
+
fn get_error_response(
&self,
res: Response,
diff --git a/crates/hyperswitch_connectors/src/connectors/noon/transformers.rs b/crates/hyperswitch_connectors/src/connectors/noon/transformers.rs
index ee658d8a0f..109c53fbde 100644
--- a/crates/hyperswitch_connectors/src/connectors/noon/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/noon/transformers.rs
@@ -12,11 +12,11 @@ use hyperswitch_domain_models::{
},
types::{
MandateRevokeRouterData, PaymentsAuthorizeRouterData, PaymentsCancelRouterData,
- PaymentsCaptureRouterData, PaymentsCompleteAuthorizeRouterData, RefundsRouterData,
+ PaymentsCaptureRouterData, RefundsRouterData,
},
};
use hyperswitch_interfaces::errors;
-use masking::{ExposeInterface, PeekInterface, Secret};
+use masking::{ExposeInterface, Secret};
use serde::{Deserialize, Serialize};
use crate::{
@@ -247,7 +247,6 @@ pub enum NoonApiOperations {
Reverse,
Refund,
CancelSubscription,
- ProcessAuthentication,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
@@ -316,7 +315,7 @@ impl TryFrom<&NoonRouterData<&PaymentsAuthorizeRouterData>> for NoonPaymentsRequ
}))
}
WalletData::PaypalRedirect(_) => Ok(NoonPaymentData::PayPal(NoonPayPal {
- return_url: item.request.get_complete_authorize_url()?,
+ return_url: item.request.get_router_return_url()?,
})),
WalletData::AliPayQr(_)
| WalletData::AliPayRedirect(_)
@@ -446,116 +445,6 @@ impl TryFrom<&NoonRouterData<&PaymentsAuthorizeRouterData>> for NoonPaymentsRequ
}
}
-#[derive(Debug, Serialize)]
-#[serde(rename_all = "camelCase")]
-pub struct NoonPaymentsCompleteAuthorizeRequest {
- api_operation: NoonApiOperations,
- order: NoonCompleteOrder,
- payment_data: NoonCompletePaymentData,
-}
-
-#[derive(Debug, Serialize)]
-#[serde(rename_all = "camelCase")]
-pub struct NoonCompleteOrder {
- id: u64,
-}
-
-#[derive(Debug, Serialize)]
-#[serde(rename_all = "camelCase")]
-pub struct NoonCompletePaymentData {
- #[serde(rename = "type")]
- payment_method_type: NoonPaymentMethodType,
- data: NoonData,
-}
-
-#[derive(Debug, Serialize)]
-#[serde(rename_all = "camelCase")]
-pub struct NoonData {
- method: Method,
- query_data: NoonQueryData,
-}
-
-#[derive(Debug, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct NoonQueryData {
- status: String,
- #[serde(rename = "PayerID")]
- payer_id: Option<Secret<String>>,
- payment_id: Option<Secret<String>>,
- token: Option<Secret<String>>,
-}
-
-#[derive(Clone, Debug, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct PaypalQueryData {
- status: String,
- #[serde(rename = "PayerID")]
- payer_id: Option<Secret<String>>,
- token: Option<Secret<String>>,
-}
-
-#[derive(Debug, Serialize)]
-#[serde(rename_all = "UPPERCASE")]
-pub enum NoonPaymentMethodType {
- Paypal,
-}
-
-impl TryFrom<&NoonRouterData<&PaymentsCompleteAuthorizeRouterData>>
- for NoonPaymentsCompleteAuthorizeRequest
-{
- type Error = error_stack::Report<errors::ConnectorError>;
- fn try_from(
- item: &NoonRouterData<&PaymentsCompleteAuthorizeRouterData>,
- ) -> Result<Self, Self::Error> {
- let params = item
- .router_data
- .request
- .redirect_response
- .as_ref()
- .and_then(|redirect_response| redirect_response.params.as_ref())
- .ok_or(errors::ConnectorError::ResponseDeserializationFailed)?;
-
- let query_params: PaypalQueryData = serde_urlencoded::from_str(params.peek())
- .change_context(errors::ConnectorError::ResponseDeserializationFailed)
- .attach_printable("Failed to parse connector response")?;
-
- let payer_id = query_params.payer_id;
- let token = query_params.token.clone();
- let payment_id = query_params.token;
- let status = query_params.status;
- let payment_method_type = NoonPaymentMethodType::Paypal;
-
- let order = NoonCompleteOrder {
- id: item
- .router_data
- .request
- .connector_transaction_id
- .clone()
- .ok_or(errors::ConnectorError::MissingRequiredField {
- field_name: "connector_transaction_id",
- })?
- .parse::<u64>()
- .change_context(errors::ConnectorError::RequestEncodingFailed)?,
- };
- Ok(Self {
- api_operation: NoonApiOperations::ProcessAuthentication,
- order,
- payment_data: NoonCompletePaymentData {
- payment_method_type,
- data: NoonData {
- method: Method::Get,
- query_data: NoonQueryData {
- status,
- payer_id,
- payment_id,
- token,
- },
- },
- },
- })
- }
-}
-
// Auth Struct
pub struct NoonAuthType {
pub(super) api_key: Secret<String>,
@@ -622,13 +511,15 @@ fn get_payment_status(data: (NoonPaymentStatus, AttemptStatus)) -> AttemptStatus
NoonPaymentStatus::Cancelled | NoonPaymentStatus::Expired => {
AttemptStatus::AuthenticationFailed
}
- NoonPaymentStatus::ThreeDsEnrollInitiated
- | NoonPaymentStatus::ThreeDsEnrollChecked
- | NoonPaymentStatus::PaymentInfoAdded => AttemptStatus::AuthenticationPending,
+ NoonPaymentStatus::ThreeDsEnrollInitiated | NoonPaymentStatus::ThreeDsEnrollChecked => {
+ AttemptStatus::AuthenticationPending
+ }
NoonPaymentStatus::ThreeDsResultVerified => AttemptStatus::AuthenticationSuccessful,
NoonPaymentStatus::Failed | NoonPaymentStatus::Rejected => AttemptStatus::Failure,
NoonPaymentStatus::Pending | NoonPaymentStatus::MarkedForReview => AttemptStatus::Pending,
- NoonPaymentStatus::Initiated | NoonPaymentStatus::Authenticated => AttemptStatus::Started,
+ NoonPaymentStatus::Initiated
+ | NoonPaymentStatus::PaymentInfoAdded
+ | NoonPaymentStatus::Authenticated => AttemptStatus::Started,
NoonPaymentStatus::Locked => current_status,
}
}
@@ -662,103 +553,11 @@ pub struct NoonPaymentsResponseResult {
subscription: Option<NoonSubscriptionObject>,
}
-#[derive(Debug, Serialize, Deserialize)]
-#[serde(untagged)]
-pub enum NoonAuthPaymentResponse {
- NoonPaypalResponse(NoonPaypalResponse),
- NoonPaymentsResponse(NoonPaymentsResponse),
-}
-
#[derive(Debug, Serialize, Deserialize)]
pub struct NoonPaymentsResponse {
result: NoonPaymentsResponseResult,
}
-#[derive(Debug, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct NoonPaypalResponse {
- result: NoonPaypalResponseResult,
-}
-
-#[derive(Debug, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct NoonPaypalResponseResult {
- order: NoonPaymentsOrderResponse,
- payment_data: Option<NoonPaypalPaymentData>,
- subscription: Option<NoonSubscriptionObject>,
-}
-
-#[derive(Debug, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct NoonPaypalPaymentData {
- data: PaypalData,
-}
-
-#[derive(Debug, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct PaypalData {
- url: url::Url,
-}
-
-impl<F, T> TryFrom<ResponseRouterData<F, NoonPaypalResponse, T, PaymentsResponseData>>
- for RouterData<F, T, PaymentsResponseData>
-{
- type Error = error_stack::Report<errors::ConnectorError>;
- fn try_from(
- item: ResponseRouterData<F, NoonPaypalResponse, T, PaymentsResponseData>,
- ) -> Result<Self, Self::Error> {
- let order = item.response.result.order;
- let status = get_payment_status((order.status, item.data.status));
- let url = item
- .response
- .result
- .payment_data
- .map(|redirection_data| redirection_data.data.url);
- let redirection_data = url.map(|url| RedirectForm::from((url, Method::Get)));
- let mandate_reference =
- item.response
- .result
- .subscription
- .map(|subscription_data| MandateReference {
- connector_mandate_id: Some(subscription_data.identifier.expose()),
- payment_method_id: None,
- mandate_metadata: None,
- connector_mandate_request_reference_id: None,
- });
- Ok(Self {
- status,
- response: match order.error_message {
- Some(error_message) => Err(ErrorResponse {
- code: order.error_code.to_string(),
- message: error_message.clone(),
- reason: Some(error_message),
- status_code: item.http_code,
- attempt_status: Some(status),
- connector_transaction_id: Some(order.id.to_string()),
- network_advice_code: None,
- network_decline_code: None,
- network_error_message: None,
- }),
- _ => {
- let connector_response_reference_id =
- order.reference.or(Some(order.id.to_string()));
- Ok(PaymentsResponseData::TransactionResponse {
- resource_id: ResponseId::ConnectorTransactionId(order.id.to_string()),
- redirection_data: Box::new(redirection_data),
- mandate_reference: Box::new(mandate_reference),
- connector_metadata: None,
- network_txn_id: None,
- connector_response_reference_id,
- incremental_authorization_allowed: None,
- charges: None,
- })
- }
- },
- ..item.data
- })
- }
-}
-
impl<F, T> TryFrom<ResponseRouterData<F, NoonPaymentsResponse, T, PaymentsResponseData>>
for RouterData<F, T, PaymentsResponseData>
{
diff --git a/crates/hyperswitch_connectors/src/default_implementations.rs b/crates/hyperswitch_connectors/src/default_implementations.rs
index c21c1d716b..35d95343ab 100644
--- a/crates/hyperswitch_connectors/src/default_implementations.rs
+++ b/crates/hyperswitch_connectors/src/default_implementations.rs
@@ -655,6 +655,7 @@ default_imp_for_complete_authorize!(
connectors::Moneris,
connectors::Multisafepay,
connectors::Nomupay,
+ connectors::Noon,
connectors::Novalnet,
connectors::Nexinets,
connectors::Opayo,
diff --git a/loadtest/config/development.toml b/loadtest/config/development.toml
index ea6d79f320..fc3a777ee6 100644
--- a/loadtest/config/development.toml
+++ b/loadtest/config/development.toml
@@ -306,9 +306,6 @@ open_banking_uk = { country = "DE,GB,AT,BE,CY,EE,ES,FI,FR,GR,HR,IE,IT,LT,LU,LV,M
instant_bank_transfer = { country = "CZ,SK,GB,AT,DE,IT", currency = "CZK, EUR, GBP" }
sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,GB", currency = "EUR" }
-[pm_filters.noon]
-paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD,AED,SAR"}
-
[pm_filters.razorpay]
upi_collect = { country = "IN", currency = "INR" }