Skip to content

fix(ad-hoc): send device timezone offset under correct key and sign - #548

Merged
andrii-vysotskyi-cko merged 1 commit into
masterfrom
worktree-fix-device-timezone-offset
Nov 6, 2026
Merged

andrii-vysotskyi-cko merged 1 commit into
masterfrom
worktree-fix-device-timezone-offset

Conversation

@andrii-vysotskyi-cko

Copy link
Copy Markdown
Collaborator

iOS sent app_time_zone_offset (ignored by the API, so Adyen got 0) with the opposite sign to Android/browsers.

  • Encode as app_timezone_offset
  • Use UTC − local minutes (e.g. -60 for CET), matching Android and EMVCo
  • Add tests for sign and encoded key

Encode as app_timezone_offset (the key the API reads) and use UTC - local minutes, matching Android and browsers.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the iOS timezone metadata correction.

No open issues 🎉

What changed in this PR

Corrects iOS device timezone metadata so the API receives app_timezone_offset with the UTC-minus-local sign, matching Android and EMVCo semantics.

Changes:

  • Renames the metadata property to produce the correct snake-case key and updates its consumers.
  • Reverses the offset sign and adds injectable timezone support.
  • Adds regression tests for offset values and JSON encoding.
File Description
Tests/​ProcessOutTests/​Sources/​Unit/​Core/​DeviceMetadata/​DefaultDeviceMetadataProviderTests.swift Adds offset-sign and encoded-key tests.
Tests/​ProcessOutTests/​Sources/​Unit/​Connectors/​Http/​DefaultHttpConnectorRequestMapperTests.swift Updates expected payloads for the renamed property.
Tests/​ProcessOutTests/​Sources/​Mocks/​DeviceMetadataProvider/​StubDeviceMetadataProvider.swift Updates the stub to use the renamed property.
Sources/​ProcessOut/​Sources/​Services/​Telemetry/​DefaultTelemetryService.swift Updates telemetry to read the renamed property.
Sources/​ProcessOut/​Sources/​Core/​DeviceMetadata/​DeviceMetadata.swift Renames the offset property and documents its sign convention.
Sources/​ProcessOut/​Sources/​Core/​DeviceMetadata/​DefaultDeviceMetadataProvider.swift Calculates UTC-minus-local minutes and accepts an injectable timezone.

Review effort: Balanced

@andrii-vysotskyi-cko
andrii-vysotskyi-cko merged commit c0fd2af into master Nov 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants