Skip to content

Commit 333019e

Browse files
committed
Tweaking payment menu buttons and code
1 parent 048c57e commit 333019e

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

Example-app/Base.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
"stand_alone_generic_error_title" = "Something went wrong";
3030
"stand_alone_url_seamless_title" = "Seamless View";
3131
"stand_alone_url_payment_web" = "Get payment menu";
32-
"stand_alone_url_payment_web_restricted" = "Get payment menu (restricted 2 first)";
32+
"stand_alone_url_payment_web_restricted" = "Get payment menu\nRestricted to non native";
3333
"stand_alone_url_payment_apple_pay" = "ApplePay";
3434
"stand_alone_url_payment_web_based" = "Web Based";

Example-app/Views/StandaloneUrlView.swift

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,9 @@ struct StandaloneUrlView: View {
488488
Button {
489489
isFocused = false
490490

491-
viewModel.nativePayment?.createSwedbankPaySDKController(mode: .menu(restrictedToInstruments: [availableInstruments[0], availableInstruments[1]]))
491+
viewModel.nativePayment?.createSwedbankPaySDKController(mode: .menu(restrictedToInstruments: nil))
492492
} label: {
493-
Text("stand_alone_url_payment_web_restricted")
493+
Text("stand_alone_url_payment_web")
494494
.smallFont()
495495
.frame(maxWidth: .infinity)
496496
.frame(height: 48)
@@ -505,9 +505,17 @@ struct StandaloneUrlView: View {
505505
Button {
506506
isFocused = false
507507

508-
viewModel.nativePayment?.createSwedbankPaySDKController(mode: .menu(restrictedToInstruments: nil))
508+
let restrictedToInstruments = availableInstruments.filter {
509+
if case .webBased = $0 {
510+
return true
511+
}
512+
513+
return false
514+
}
515+
viewModel.nativePayment?.createSwedbankPaySDKController(mode: .menu(restrictedToInstruments: restrictedToInstruments))
516+
509517
} label: {
510-
Text("stand_alone_url_payment_web")
518+
Text("stand_alone_url_payment_web_restricted")
511519
.smallFont()
512520
.frame(maxWidth: .infinity)
513521
.frame(height: 48)

Example-app/en.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
"stand_alone_generic_error_title" = "Something went wrong";
3030
"stand_alone_url_seamless_title" = "Seamless View";
3131
"stand_alone_url_payment_web" = "Get payment menu";
32-
"stand_alone_url_payment_web_restricted" = "Get payment menu (restricted 2 first)";
32+
"stand_alone_url_payment_web_restricted" = "Get payment menu\nRestricted to non native";
3333
"stand_alone_url_payment_apple_pay" = "ApplePay";
3434
"stand_alone_url_payment_web_based" = "Web Based";

0 commit comments

Comments
 (0)