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 91fbf95 commit 678b508
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 47 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
61 changes: 25 additions & 36 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"
message: "Refunds is not implemented",
code: "IR_00",
},
},
},
manualPaymentRefund: {
Configs: {
TRIGGER_SKIP: true,
},
Request: {
payment_method: "card",
payment_method_data: {
Expand All @@ -236,12 +223,15 @@ export const connectorDetails = {
status: 501,
body: {
type: "invalid_request",
message: "Refunds is not implemented",
code: "IR_00"
message: "Refunds is not implemented",
code: "IR_00",
},
},
},
manualPaymentPartialRefund: {
Configs: {
TRIGGER_SKIP: true,
},
Request: {
payment_method: "card",
payment_method_data: {
Expand All @@ -253,12 +243,15 @@ export const connectorDetails = {
status: 501,
body: {
type: "invalid_request",
message: "Refunds is not implemented",
code: "IR_00"
message: "Refunds is not implemented",
code: "IR_00",
},
},
},
PartialRefund: {
Configs: {
TRIGGER_SKIP: true,
},
Request: {
payment_method: "card",
payment_method_data: {
Expand All @@ -270,8 +263,8 @@ export const connectorDetails = {
status: 501,
body: {
type: "invalid_request",
message: "Refunds is not implemented",
code: "IR_00"
message: "Refunds is not implemented",
code: "IR_00",
},
},
},
Expand All @@ -292,21 +285,17 @@ 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"
code: "HE_02",
},
},
}
},
},
};
4 changes: 2 additions & 2 deletions cypress-tests/cypress/e2e/PaymentUtils/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { connectorDetails as fiservemeaConnectorDetails } from "./Fiservemea.js"
import { connectorDetails as fiuuConnectorDetails } from "./Fiuu.js";
import { connectorDetails as iatapayConnectorDetails } from "./Iatapay.js";
import { connectorDetails as itaubankConnectorDetails } from "./ItauBank.js";
import { connectorDetails as jpmorganConnectorDetails} from "./Jpmorgan.js";
import { connectorDetails as jpmorganConnectorDetails } from "./Jpmorgan.js";
import { connectorDetails as nexixpayConnectorDetails } from "./Nexixpay.js";
import { connectorDetails as nmiConnectorDetails } from "./Nmi.js";
import { connectorDetails as noonConnectorDetails } from "./Noon.js";
Expand All @@ -37,7 +37,7 @@ const connectorDetails = {
fiservemea: fiservemeaConnectorDetails,
iatapay: iatapayConnectorDetails,
itaubank: itaubankConnectorDetails,
jpmorgan : jpmorganConnectorDetails,
jpmorgan: jpmorganConnectorDetails,
nexixpay: nexixpayConnectorDetails,
nmi: nmiConnectorDetails,
novalnet: novalnetConnectorDetails,
Expand Down
24 changes: 24 additions & 0 deletions cypress-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 678b508

Please sign in to comment.