Skip to content

Commit 5ad3f89

Browse files
fix(payment_link): added expires_on in payment response (#3332)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
1 parent 58cc8d6 commit 5ad3f89

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

crates/api_models/src/payments.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,6 +2277,11 @@ pub struct PaymentsResponse {
22772277
/// List of incremental authorizations happened to the payment
22782278
pub incremental_authorizations: Option<Vec<IncrementalAuthorizationResponse>>,
22792279

2280+
/// Date Time expiry of the payment
2281+
#[schema(example = "2022-09-10T10:11:12Z")]
2282+
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
2283+
pub expires_on: Option<PrimitiveDateTime>,
2284+
22802285
/// Payment Fingerprint
22812286
pub fingerprint: Option<String>,
22822287
}

crates/router/src/core/payments/transformers.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ where
709709
.set_fingerprint(payment_intent.fingerprint_id)
710710
.set_authorization_count(payment_intent.authorization_count)
711711
.set_incremental_authorizations(incremental_authorizations_response)
712+
.set_expires_on(payment_intent.session_expiry)
712713
.to_owned(),
713714
headers,
714715
))
@@ -775,6 +776,7 @@ where
775776
incremental_authorization_allowed: payment_intent.incremental_authorization_allowed,
776777
authorization_count: payment_intent.authorization_count,
777778
incremental_authorizations: incremental_authorizations_response,
779+
expires_on: payment_intent.session_expiry,
778780
..Default::default()
779781
},
780782
headers,

openapi/openapi_spec.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10948,6 +10948,13 @@
1094810948
"description": "List of incremental authorizations happened to the payment",
1094910949
"nullable": true
1095010950
},
10951+
"expires_on": {
10952+
"type": "string",
10953+
"format": "date-time",
10954+
"description": "Date Time expiry of the payment",
10955+
"example": "2022-09-10T10:11:12Z",
10956+
"nullable": true
10957+
},
1095110958
"fingerprint": {
1095210959
"type": "string",
1095310960
"description": "Payment Fingerprint",

0 commit comments

Comments
 (0)