Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Himanshu-370 authored Oct 11, 2023
2 parents 48b33db + 550377a commit 46b37fe
Show file tree
Hide file tree
Showing 8 changed files with 540 additions and 6 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 1.56.0 (2023-10-11)

### Features

- **connector:**
- [Volt] Template generation ([#2480](https://github.com/juspay/hyperswitch/pull/2480)) ([`ee321bb`](https://github.com/juspay/hyperswitch/commit/ee321bb82686559643d8c2725b0491997af717b2))
- [NexiNets] Update connector_response_reference_id as reference to merchant ([#2537](https://github.com/juspay/hyperswitch/pull/2537)) ([`2f6c00a`](https://github.com/juspay/hyperswitch/commit/2f6c00a1fd853876333608a7d1fa6b488c3001d3))
- [Authorizedotnet] use connector_response_reference_id as reference to merchant ([#2497](https://github.com/juspay/hyperswitch/pull/2497)) ([`62638c4`](https://github.com/juspay/hyperswitch/commit/62638c4230bfd149c43c2805cbad0ce9be5386b3))
- **router:** Change temp locker config as enable only ([#2522](https://github.com/juspay/hyperswitch/pull/2522)) ([`7acf101`](https://github.com/juspay/hyperswitch/commit/7acf10101435ab97d93490e19eaac5373d34f531))

### Refactors

- Delete requires cvv config when merchant account is deleted ([#2525](https://github.com/juspay/hyperswitch/pull/2525)) ([`b968552`](https://github.com/juspay/hyperswitch/commit/b9685521735956659c50bc2e1c15b08cb9952aee))

### Testing

- **postman:**
- Add proper `customer_id` in payment method create api ([#2548](https://github.com/juspay/hyperswitch/pull/2548)) ([`7994a12`](https://github.com/juspay/hyperswitch/commit/7994a1259c5852ba4ebabb906bef963c6cf81bc9))
- Update postman collection files ([`7c561d5`](https://github.com/juspay/hyperswitch/commit/7c561d57767001e755fc9abfc32352ffdc9aacea))

### Miscellaneous Tasks

- **CODEOWNERS:** Update CODEOWNERS ([#2541](https://github.com/juspay/hyperswitch/pull/2541)) ([`d9fb5d4`](https://github.com/juspay/hyperswitch/commit/d9fb5d4a52f44809ab4a1576a99e97b4c8b8c41b))

**Full Changelog:** [`v1.55.0...v1.56.0`](https://github.com/juspay/hyperswitch/compare/v1.55.0...v1.56.0)

- - -


## 1.55.0 (2023-10-10)

### Features
Expand Down
13 changes: 10 additions & 3 deletions crates/router/src/connector/tsys/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,14 @@ fn get_error_response(

fn get_payments_response(connector_response: TsysResponse) -> types::PaymentsResponseData {
types::PaymentsResponseData::TransactionResponse {
resource_id: types::ResponseId::ConnectorTransactionId(connector_response.transaction_id),
resource_id: types::ResponseId::ConnectorTransactionId(
connector_response.transaction_id.clone(),
),
redirection_data: None,
mandate_reference: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: None,
connector_response_reference_id: Some(connector_response.transaction_id),
}
}

Expand All @@ -215,7 +217,12 @@ fn get_payments_sync_response(
mandate_reference: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: None,
connector_response_reference_id: Some(
connector_response
.transaction_details
.transaction_id
.clone(),
),
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"eventOrder": ["event.test.js"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Validate status 2xx
pm.test("[POST]::/customers - Status code is 2xx", function () {
pm.response.to.be.success;
});

// Validate if response header has matching content-type
pm.test("[POST]::/customers - Content-Type is application/json", function () {
pm.expect(pm.response.headers.get("Content-Type")).to.include(
"application/json",
);
});

// Validate if response has JSON Body
pm.test("[POST]::/customers - Response has JSON Body", function () {
pm.response.to.have.jsonBody();
});

// Set response object as internal variable
let jsonData = {};
try {
jsonData = pm.response.json();
} catch (e) {}

// Response body should have "customer_id"
pm.test(
"[POST]::/customers - Content check if 'customer_id' exists",
function () {
pm.expect(typeof jsonData.customer_id !== "undefined").to.be.true;
},
);

// Response body should have a minimum length of "1" for "customer_id"
if (jsonData?.customer_id) {
pm.test(
"[POST]::/customers - Content check if value of 'customer_id' has a minimum length of '1'",
function () {
pm.expect(jsonData.customer_id.length).is.at.least(1);
},
);
}

// pm.collectionVariables - Set customer_id as variable for jsonData.customer_id
if (jsonData?.customer_id) {
pm.collectionVariables.set("customer_id", jsonData.customer_id);
console.log(
"- use {{customer_id}} as collection variable for value",
jsonData.customer_id,
);
} else {
console.log(
"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.",
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"options": {
"raw": {
"language": "json"
}
},
"raw_json_formatted": {
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "First customer",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}
},
"url": {
"raw": "{{baseUrl}}/customers",
"host": ["{{baseUrl}}"],
"path": ["customers"]
},
"description": "Create a customer object and store the customer details to be reused for future payments. Incase the customer already exists in the system, this API will respond with the customer details."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"card_exp_year": "25",
"card_holder_name": "John Doe"
},
"customer_id": "cus_mnewerunwiuwiwqw",
"customer_id": "{{customer_id}}",
"metadata": {
"city": "NY",
"unit": "245"
Expand Down
Loading

0 comments on commit 46b37fe

Please sign in to comment.