diff --git a/PadelClub.xcodeproj/project.pbxproj b/PadelClub.xcodeproj/project.pbxproj index 32c98ac..cb06943 100644 --- a/PadelClub.xcodeproj/project.pbxproj +++ b/PadelClub.xcodeproj/project.pbxproj @@ -3094,7 +3094,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; @@ -3141,7 +3141,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_TEAM = BQ3Y44M3Q6; @@ -3259,7 +3259,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; @@ -3305,7 +3305,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_TEAM = BQ3Y44M3Q6; @@ -3351,7 +3351,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; @@ -3394,7 +3394,7 @@ CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEFINES_MODULE = YES; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_TEAM = BQ3Y44M3Q6; diff --git a/PadelClub/Views/Navigation/Umpire/UmpireView.swift b/PadelClub/Views/Navigation/Umpire/UmpireView.swift index ff0348e..cd129fd 100644 --- a/PadelClub/Views/Navigation/Umpire/UmpireView.swift +++ b/PadelClub/Views/Navigation/Umpire/UmpireView.swift @@ -78,6 +78,55 @@ struct UmpireView: View { } label: { AccountRowView(userName: dataStore.user.username) } + + let onlineRegPaymentMode = dataStore.user.registrationPaymentMode + Section { + LabeledContent { + switch onlineRegPaymentMode { + case .corporate: + Text("Activé") + .bold() + .foregroundStyle(.green) + case .disabled: + Text("Désactivé") + .bold() + case .noFee: + Text("Activé") + .bold() + .foregroundStyle(.green) + case .stripe: + Text("Activé") + .bold() + .foregroundStyle(.green) + } + } label: { + Text("Option 'Paiement en ligne'") + if onlineRegPaymentMode == .corporate { + Text("Mode Padel Club") + .foregroundStyle(.secondary) + } else if onlineRegPaymentMode == .noFee { + Text("Commission Stripe") + .foregroundStyle(.secondary) + } else if onlineRegPaymentMode == .stripe { + Text("Commission Stripe et Padel Club") + .foregroundStyle(.secondary) + } + } + } footer: { + if onlineRegPaymentMode == .disabled { + FooterButtonView("Contactez nous pour activer cette option.") { + let emailTo: String = "support@padelclub.app" + let subject: String = "Activer l'option de paiment en ligne : \(dataStore.user.email)" + if let url = URL(string: "mailto:\(emailTo)?subject=\(subject)"), UIApplication.shared.canOpenURL(url) { + UIApplication.shared.open(url, options: [:], completionHandler: nil) + } + } + .font(.callout) + .multilineTextAlignment(.leading) + } else { + Text("Permet de proposer le paiement de vos tournois en ligne.") + } + } } else { NavigationLink(value: UmpireScreen.login) { AccountRowView(userName: dataStore.user.username) diff --git a/PadelClub/Views/Tournament/Screen/RegistrationSetupView.swift b/PadelClub/Views/Tournament/Screen/RegistrationSetupView.swift index 2bfb573..355b6b2 100644 --- a/PadelClub/Views/Tournament/Screen/RegistrationSetupView.swift +++ b/PadelClub/Views/Tournament/Screen/RegistrationSetupView.swift @@ -494,7 +494,7 @@ struct RegistrationSetupView: View { } Section { - if isCorporateTournament == false, dataStore.user.registrationPaymentMode.requiresStripe() { + if isCorporateTournament == false, dataStore.user.registrationPaymentMode.requiresStripe(), dataStore.user.registrationPaymentMode.hasPadelClubFee() { let padelClubFee = paymentConfig?.stripeFee ?? PaymentConfig.defaultConfig.stripeFee let feeAmount = entryFee * padelClubFee @@ -506,8 +506,8 @@ struct RegistrationSetupView: View { } Text("Soit \(feeAmount, format: .currency(code: "EUR")) pour \(entryFee, format: .currency(code: "EUR")).") - } else { - Text("Aucune commission Padel Club ne sera prélevée.").foregroundStyle(.logoRed).bold() +// } else { +// Text("Aucune commission Padel Club ne sera prélevée.").foregroundStyle(.logoRed).bold() } }