Skip to content

Commit

Permalink
new changes
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 5d13237 commit 91fbf95
Show file tree
Hide file tree
Showing 7 changed files with 784 additions and 342 deletions.
1 change: 1 addition & 0 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ impl<F, T> TryFrom<ResponseRouterData<F, JpmorganPaymentsResponse, T, PaymentsRe

let connector_response_reference_id = Some(item.response.transaction_id.clone());

let resource_id = ResponseId::ConnectorTransactionId(item.response.request_id.unwrap_or_default().clone()); //change made from tranId to reqId
let resource_id = ResponseId::ConnectorTransactionId(item.response.transaction_id);
// let resource_id = ResponseId::ConnectorTransactionId(item.response.request_id.unwrap_or_default().clone()); //change made from tranId to reqId

Ok(Self {
status,
Expand Down Expand Up @@ -1028,7 +1029,7 @@ pub struct MerchantRefundReq {
pub merchant_software: MerchantSoftware,
}

impl<F> TryFrom<&JpmorganRouterData<&RefundsRouterData<F>>> for JpmorganRefundRequest {
/*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> {
let merchant_software = MerchantSoftware {
Expand All @@ -1044,6 +1045,13 @@ impl<F> TryFrom<&JpmorganRouterData<&RefundsRouterData<F>>> for JpmorganRefundRe
Ok(Self { merchant, amount })
}
}*/

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> {
Err(errors::ConnectorError::NotImplemented("Refunds".to_string()).into())
}
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down
93 changes: 90 additions & 3 deletions cypress-tests/cypress/e2e/PaymentUtils/Jpmorgan.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const connectorDetails = {
},
},
},
Refund: {
/*Refund: {
Request: {
payment_method: "card",
payment_method_data: {
Expand Down Expand Up @@ -205,8 +205,77 @@ export const connectorDetails = {
status: "succeeded",
},
},
},*/
Refund: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
customer_acceptance: null,
},
Response: {
status: 501,
body: {
// status: "succeeded",
type: "invalid_request",
message: "Refunds is not implemented",
code: "IR_00"
},
},
},
SyncRefund: {
manualPaymentRefund: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
customer_acceptance: null,
},
Response: {
status: 501,
body: {
type: "invalid_request",
message: "Refunds is not implemented",
code: "IR_00"
},
},
},
manualPaymentPartialRefund: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
customer_acceptance: null,
},
Response: {
status: 501,
body: {
type: "invalid_request",
message: "Refunds is not implemented",
code: "IR_00"
},
},
},
PartialRefund: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
customer_acceptance: null,
},
Response: {
status: 501,
body: {
type: "invalid_request",
message: "Refunds is not implemented",
code: "IR_00"
},
},
},
/*SyncRefund: {
Request: {
payment_method: "card",
payment_method_data: {
Expand All @@ -216,10 +285,28 @@ export const connectorDetails = {
},
Response: {
status: 200,
trigger_skip: true,
body: {
status: "succeeded",
},
},
},
}*/
SyncRefund: {
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
customer_acceptance: null,
},
Response: {
status: 404,
body: {
type: "undefined",
message: "Refund does not exist in our records.",
code: "HE_02"
},
},
}
},
};
17 changes: 3 additions & 14 deletions cypress-tests/package-lock.json

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

3 changes: 3 additions & 0 deletions cypress-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@
"globals": "^15.13.0",
"jsqr": "^1.4.0",
"prettier": "^3.4.1"
},
"dependencies": {
"ci": "^2.3.0"
}
}
Loading

0 comments on commit 91fbf95

Please sign in to comment.