From dbc97a900a78972d34d5d11a755ea36e4b086bee Mon Sep 17 00:00:00 2001 From: Michael Balsiger Date: Fri, 6 Sep 2024 14:51:34 +0200 Subject: [PATCH] =?UTF-8?q?SP-70=20=C3=84ndring=20av=20format=20f=C3=B6r?= =?UTF-8?q?=20timeZoneOffset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Classes/Api/Helpers/TimeZone+OffsetFromGMT.swift | 5 +++++ SwedbankPaySDK/Classes/Api/SwedbankPayAPIEnpointRouter.swift | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/SwedbankPaySDK/Classes/Api/Helpers/TimeZone+OffsetFromGMT.swift b/SwedbankPaySDK/Classes/Api/Helpers/TimeZone+OffsetFromGMT.swift index 254de26..4d9f6814 100644 --- a/SwedbankPaySDK/Classes/Api/Helpers/TimeZone+OffsetFromGMT.swift +++ b/SwedbankPaySDK/Classes/Api/Helpers/TimeZone+OffsetFromGMT.swift @@ -22,4 +22,9 @@ extension TimeZone { localTimeZoneFormatter.dateFormat = "Z" return localTimeZoneFormatter.string(from: Date()) } + + func minutesFromGMT() -> String { + let minutes = (secondsFromGMT() / 60) + return String(minutes) + } } diff --git a/SwedbankPaySDK/Classes/Api/SwedbankPayAPIEnpointRouter.swift b/SwedbankPaySDK/Classes/Api/SwedbankPayAPIEnpointRouter.swift index 093216e..d422c0d 100644 --- a/SwedbankPaySDK/Classes/Api/SwedbankPayAPIEnpointRouter.swift +++ b/SwedbankPaySDK/Classes/Api/SwedbankPayAPIEnpointRouter.swift @@ -81,7 +81,7 @@ struct SwedbankPayAPIEnpointRouter: EndpointRouterProtocol { "screenColorDepth": String(24)], "browser": ["acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "languageHeader": Locale.current.identifier.replacingOccurrences(of: "_", with: "-"), - "timeZoneOffset": TimeZone.current.offsetFromGMT(), + "timeZoneOffset": TimeZone.current.minutesFromGMT(), "javascriptEnabled": true], "service": ["name": "SwedbankPaySDK-iOS", "version": SwedbankPaySDK.VersionReporter.currentVersion] @@ -97,7 +97,7 @@ struct SwedbankPayAPIEnpointRouter: EndpointRouterProtocol { "screenColorDepth": String(24)], "browser": ["acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "languageHeader": Locale.current.identifier.replacingOccurrences(of: "_", with: "-"), - "timeZoneOffset": TimeZone.current.offsetFromGMT(), + "timeZoneOffset": TimeZone.current.minutesFromGMT(), "javascriptEnabled": true] ] case .completeAuthentication(let cRes):