Commit ca66c72a authored by Jose Blaya's avatar Jose Blaya
Browse files

Update copy

parent f24ea940
......@@ -22,7 +22,7 @@
"failure.title" = "Account creation failed";
"failure.message" = "We're unable to create an account at this time. Please try again later. Reopening the app will re-attempt to create an account.";
"failure.environment.title" = "Invalid environment";
"failure.environment.message" = "Your have a sandbox receipt. Purchases are not available in Beta builds";
"failure.environment.message" = "Your have a sandbox receipt. Purchases with sandbox receipts are not available in Beta or Production builds.";
"failure.redeem.invalid.title" = "Invalid card PIN";
"failure.redeem.invalid.message" = "Looks like you entered an invalid card PIN. Please try again.";
"failure.redeem.claimed.title" = "Card claimed already";
......
......@@ -297,7 +297,7 @@ extension Client {
public func arePurchasesAvailable() -> Bool {
if let url = Bundle.main.appStoreReceiptURL,
url.lastPathComponent == "sandboxReceipt",
Client.environment == .production {
!isDevelopment {
return false
}
return true
......
......@@ -22,7 +22,7 @@ internal enum L10n {
/// Sign-up failed
internal static let vcTitle = L10n.tr("Signup", "failure.vc_title")
internal enum Environment {
/// Purchases are not available in Beta builds
/// Your have a sandbox receipt. Purchases with sandbox receipts are not available in Beta or Production builds.
internal static let message = L10n.tr("Signup", "failure.environment.message")
/// Invalid environment
internal static let title = L10n.tr("Signup", "failure.environment.title")
......
......@@ -159,9 +159,13 @@ public class ConfirmVPNPlanViewController: AutolayoutViewController, BrandableNa
guard let transaction = transaction else {
if let error = error {
var message = error.localizedDescription
log.error("Purchase failed (error: \(error))")
if error as? ClientError == ClientError.invalidEnvironment {
message = L10n.Signup.Failure.Environment.message
}
Macros.displayImageNote(withImage: Asset.iconWarning.image,
message: error.localizedDescription)
message: message)
} else {
log.warning("Cancelled purchase")
}
......
......@@ -134,14 +134,17 @@ public class RestoreSignupViewController: AutolayoutViewController, BrandableNav
}
private func reportRestoreFailure(_ optionalError: Error?) {
var message = optionalError?.localizedDescription ?? L10n.Welcome.Iap.Error.title
if let error = optionalError {
if error as? ClientError == ClientError.invalidEnvironment {
message = L10n.Signup.Failure.Environment.message
}
log.error("Failed to restore payment receipt (error: \(error))")
} else {
log.error("Failed to restore payment receipt")
}
Macros.displayImageNote(withImage: Asset.iconWarning.image,
message: optionalError?.localizedDescription ?? L10n.Welcome.Iap.Error.title)
message: message)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment