Skip to content

Commit

Permalink
new changes 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sayak Bhattacharya authored and Sayak Bhattacharya committed Dec 5, 2024
1 parent 86c69b9 commit 7885a2c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 35 deletions.
1 change: 0 additions & 1 deletion config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ max_feed_count = 200
[server]
# HTTP Request body limit. Defaults to 32kB
request_body_limit = 32768
port=8082

[secrets]
admin_api_key = "test_admin"
Expand Down
7 changes: 5 additions & 2 deletions crates/hyperswitch_connectors/src/connectors/jpmorgan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,14 @@ where
);
let request_id = (
headers::REQUEST_ID.to_string(),
req.connector_request_reference_id.clone().to_string().into_masked()
req.connector_request_reference_id
.clone()
.to_string()
.into_masked(),
);
let merchant_id = (
headers::MERCHANTID.to_string(),
req.merchant_id.get_string_repr().to_string().into_masked()
req.merchant_id.get_string_repr().to_string().into_masked(),
);
headers.push(auth_header);
headers.push(request_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ impl TryFrom<&JpmorganRouterData<&PaymentsAuthorizeRouterData>> for JpmorganPaym
) -> Result<Self, Self::Error> {
match item.router_data.request.payment_method_data.clone() {
PaymentMethodData::Card(req_card) => {
if item.router_data.is_three_ds(){
return Err(errors::ConnectorError::NotSupported{
message : "Three_ds payments".to_string(),
connector : "Jpmorgan"
}
if item.router_data.is_three_ds() {
return Err(errors::ConnectorError::NotSupported {
message: "Three_ds payments".to_string(),
connector: "Jpmorgan",
}
.into());
}
let capture_method = if let Some(method) = item.router_data.request.capture_method {
Expand Down Expand Up @@ -1049,7 +1049,7 @@ pub struct MerchantRefundReq {

impl<F> TryFrom<&JpmorganRouterData<&RefundsRouterData<F>>> for JpmorganRefundRequest {
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(_item: &JpmorganRouterData<&RefundsRouterData<F>>) -> Result <Self, Self::Error> {
fn try_from(_item: &JpmorganRouterData<&RefundsRouterData<F>>) -> Result<Self, Self::Error> {
Err(errors::ConnectorError::NotImplemented("Refunds".to_string()).into())
}
}
Expand Down
41 changes: 15 additions & 26 deletions cypress-tests/cypress/e2e/PaymentUtils/Jpmorgan.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,6 @@ export const connectorDetails = {
Request: {
currency: "USD",
payment_method: "card",
billing: {
address: {
line1: "1467",
line2: "CA",
line3: "CA",
city: "Musterhausen",
state: "California",
zip: "12345",
country: "US",
first_name: "John",
last_name: "Doe",
},
email: "test@jpmorgan.us",
phone: {
number: "9123456789",
country_code: "+91",
},
},
payment_method_data: {
card: successfulNo3DSCardDetails,
},
Expand Down Expand Up @@ -207,6 +189,9 @@ export const connectorDetails = {
},
},*/
Refund: {
Configs: {
TRIGGER_SKIP: true,
},
Request: {
payment_method: "card",
payment_method_data: {
Expand All @@ -217,14 +202,16 @@ export const connectorDetails = {
Response: {
status: 501,
body: {
// status: "succeeded",
type: "invalid_request",
message: "Refunds is not implemented",
code: "IR_00"
},
},
},
manualPaymentRefund: {
Configs: {
TRIGGER_SKIP: true,
},
Request: {
payment_method: "card",
payment_method_data: {
Expand All @@ -242,6 +229,9 @@ export const connectorDetails = {
},
},
manualPaymentPartialRefund: {
Configs: {
TRIGGER_SKIP: true,
},
Request: {
payment_method: "card",
payment_method_data: {
Expand All @@ -259,6 +249,9 @@ export const connectorDetails = {
},
},
PartialRefund: {
Configs: {
TRIGGER_SKIP: true,
},
Request: {
payment_method: "card",
payment_method_data: {
Expand Down Expand Up @@ -292,17 +285,13 @@ export const connectorDetails = {
},
}*/
SyncRefund: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
customer_acceptance: null,
Configs: {
TRIGGER_SKIP: true,
},
Response: {
status: 404,
body: {
type: "undefined",
type: "invalid_request",
message: "Refund does not exist in our records.",
code: "HE_02"
},
Expand Down

0 comments on commit 7885a2c

Please sign in to comment.