Skip to content

Commit

Permalink
Improving beacon logging for new web based modes
Browse files Browse the repository at this point in the history
  • Loading branch information
alleus committed Nov 13, 2024
1 parent f1d237e commit 9ff6eb7
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions SwedbankPaySDK/Classes/SwedbankPayPaymentSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,25 @@ public extension SwedbankPaySDK {
return
}

let logValues: [String: String?]

switch mode {
case .instrumentMode(let instrument):
logValues = [
"mode": "instrumentMode",
"instrument": instrument.paymentMethod
]
case .menu(let restrictedToInstruments):
logValues = [
"mode": "menu",
"restrictedToInstruments": restrictedToInstruments?.compactMap({ $0.paymentMethod }).joined(separator: ";")
]
}

BeaconService.shared.log(type: .sdkMethodInvoked(name: "createSwedbankPaySDKController",
succeeded: true,
values: logValues))

paymentViewSessionIsOngoing = false
sdkControllerMode = mode

Expand Down Expand Up @@ -245,10 +264,6 @@ public extension SwedbankPaySDK {
paymentOrder: nil,
userData: nil)

BeaconService.shared.log(type: .sdkMethodInvoked(name: "createSwedbankPaySDKController",
succeeded: true,
values: nil))

paymentViewSessionIsOngoing = true

viewController.internalDelegate = self
Expand Down

0 comments on commit 9ff6eb7

Please sign in to comment.