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

PIAX. Restore Purchase

parent c58385bd
......@@ -24,24 +24,17 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yDn-f2-pRd">
<rect key="frame" x="0.0" y="0.0" width="375" height="647"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uEe-na-x7K">
<rect key="frame" x="0.0" y="0.0" width="375" height="647"/>
<accessibility key="accessibilityConfiguration" label="Cancel"/>
<connections>
<action selector="dismiss:" destination="Y1W-Um-2lp" eventType="touchUpInside" id="umL-4L-pzm"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1CW-ZP-sqf">
<rect key="frame" x="37.5" y="190" width="300" height="267.5"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="647"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Restore uncredited purchase" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="C7C-8i-CTb">
<rect key="frame" x="20" y="30" width="260" height="19.5"/>
<rect key="frame" x="80" y="29" width="215" height="19.5"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6Sq-eo-OrE">
<rect key="frame" x="20" y="59.5" width="260" height="78"/>
<rect key="frame" x="40" y="69.5" width="295" height="62.5"/>
<string key="text">If you purchased a plan through this app and didn't receive your credentials, you can send them again from here.
You will not be charged during this process.</string>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
......@@ -49,22 +42,21 @@ You will not be charged during this process.</string>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Email address" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="5Vo-GR-ciV" customClass="BorderedTextField" customModule="PIALibrary" customModuleProvider="target">
<rect key="frame" x="20" y="157.5" width="260" height="30"/>
<rect key="frame" x="25" y="157" width="325" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="WNz-0h-Xp2"/>
<constraint firstAttribute="height" constant="50" id="WNz-0h-Xp2"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="emailAddress" enablesReturnKeyAutomatically="YES"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="emailAddress" enablesReturnKeyAutomatically="YES" textContentType="email"/>
<connections>
<outlet property="delegate" destination="Y1W-Um-2lp" id="3zT-xF-wGK"/>
</connections>
</textField>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Un1-3v-2Ob" customClass="ActivityButton" customModule="PIALibrary" customModuleProvider="target">
<rect key="frame" x="20" y="207.5" width="260" height="40"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Un1-3v-2Ob" customClass="PIAButton" customModule="PIALibrary" customModuleProvider="target">
<rect key="frame" x="25" y="222" width="325" height="50"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="Z9y-Og-t8q"/>
<constraint firstAttribute="width" constant="260" id="iKe-Dz-xoG"/>
<constraint firstAttribute="height" constant="50" id="Z9y-Og-t8q"/>
</constraints>
<connections>
<action selector="restorePurchase:" destination="Y1W-Um-2lp" eventType="touchUpInside" id="Xuc-A7-OOK"/>
......@@ -72,31 +64,28 @@ You will not be charged during this process.</string>
</view>
</subviews>
<constraints>
<constraint firstItem="6Sq-eo-OrE" firstAttribute="leading" secondItem="5Vo-GR-ciV" secondAttribute="leading" id="7Ta-kr-HWX"/>
<constraint firstItem="C7C-8i-CTb" firstAttribute="top" secondItem="1CW-ZP-sqf" secondAttribute="top" constant="30" id="HFp-oh-sBM"/>
<constraint firstItem="6Sq-eo-OrE" firstAttribute="trailing" secondItem="5Vo-GR-ciV" secondAttribute="trailing" id="IUS-Mu-8mH"/>
<constraint firstItem="6Sq-eo-OrE" firstAttribute="top" secondItem="C7C-8i-CTb" secondAttribute="bottom" constant="10" id="J8C-xq-QqM"/>
<constraint firstAttribute="trailing" secondItem="Un1-3v-2Ob" secondAttribute="trailing" constant="20" id="MPL-4k-wMH"/>
<constraint firstItem="C7C-8i-CTb" firstAttribute="leading" secondItem="6Sq-eo-OrE" secondAttribute="leading" id="Tp3-AQ-LUG"/>
<constraint firstItem="5Vo-GR-ciV" firstAttribute="top" secondItem="6Sq-eo-OrE" secondAttribute="bottom" constant="20" id="aHZ-El-ic3"/>
<constraint firstItem="Un1-3v-2Ob" firstAttribute="leading" secondItem="1CW-ZP-sqf" secondAttribute="leading" constant="20" id="abu-R5-vY3"/>
<constraint firstItem="Un1-3v-2Ob" firstAttribute="trailing" secondItem="5Vo-GR-ciV" secondAttribute="trailing" id="bTh-Gr-ytX"/>
<constraint firstItem="C7C-8i-CTb" firstAttribute="trailing" secondItem="6Sq-eo-OrE" secondAttribute="trailing" id="gAE-PA-OiV"/>
<constraint firstItem="Un1-3v-2Ob" firstAttribute="top" secondItem="5Vo-GR-ciV" secondAttribute="bottom" constant="20" id="ven-p9-ZsT"/>
<constraint firstItem="Un1-3v-2Ob" firstAttribute="leading" secondItem="5Vo-GR-ciV" secondAttribute="leading" id="vvm-wE-w6B"/>
<constraint firstAttribute="bottom" secondItem="Un1-3v-2Ob" secondAttribute="bottom" constant="20" id="yLO-r9-xwd"/>
<constraint firstItem="C7C-8i-CTb" firstAttribute="top" secondItem="1CW-ZP-sqf" secondAttribute="top" constant="29" id="HFp-oh-sBM"/>
<constraint firstItem="6Sq-eo-OrE" firstAttribute="top" secondItem="C7C-8i-CTb" secondAttribute="bottom" constant="21" id="J8C-xq-QqM"/>
<constraint firstAttribute="trailing" secondItem="6Sq-eo-OrE" secondAttribute="trailing" constant="40" id="O5z-Uv-yyh"/>
<constraint firstItem="5Vo-GR-ciV" firstAttribute="leading" secondItem="1CW-ZP-sqf" secondAttribute="leading" constant="25" id="Sh0-wS-pM6"/>
<constraint firstItem="Un1-3v-2Ob" firstAttribute="leading" secondItem="1CW-ZP-sqf" secondAttribute="leading" constant="25" id="YSj-gb-5Nr"/>
<constraint firstItem="5Vo-GR-ciV" firstAttribute="top" secondItem="6Sq-eo-OrE" secondAttribute="bottom" constant="25" id="aHZ-El-ic3"/>
<constraint firstAttribute="trailing" secondItem="Un1-3v-2Ob" secondAttribute="trailing" constant="25" id="cNH-Oc-VWW"/>
<constraint firstItem="C7C-8i-CTb" firstAttribute="centerX" secondItem="1CW-ZP-sqf" secondAttribute="centerX" id="e4C-IO-aYb"/>
<constraint firstItem="6Sq-eo-OrE" firstAttribute="leading" secondItem="1CW-ZP-sqf" secondAttribute="leading" constant="40" id="vHT-G3-WYz"/>
<constraint firstItem="Un1-3v-2Ob" firstAttribute="top" secondItem="5Vo-GR-ciV" secondAttribute="bottom" constant="15" id="ven-p9-ZsT"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="Un1-3v-2Ob" secondAttribute="bottom" constant="20" id="yLO-r9-xwd"/>
<constraint firstAttribute="trailing" secondItem="5Vo-GR-ciV" secondAttribute="trailing" constant="25" id="yir-wz-zBT"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="uEe-na-x7K" secondAttribute="bottom" id="IEH-W7-4oC"/>
<constraint firstItem="1CW-ZP-sqf" firstAttribute="centerX" secondItem="yDn-f2-pRd" secondAttribute="centerX" id="Juc-DH-i6T"/>
<constraint firstItem="1CW-ZP-sqf" firstAttribute="top" secondItem="yDn-f2-pRd" secondAttribute="top" constant="147.5" id="S8N-A7-eRO"/>
<constraint firstItem="1CW-ZP-sqf" firstAttribute="centerY" secondItem="yDn-f2-pRd" secondAttribute="centerY" id="dKC-Yt-XPU"/>
<constraint firstItem="uEe-na-x7K" firstAttribute="top" secondItem="yDn-f2-pRd" secondAttribute="top" id="e9R-Ix-MJz"/>
<constraint firstAttribute="trailing" secondItem="uEe-na-x7K" secondAttribute="trailing" id="eQC-8V-0ZN"/>
<constraint firstAttribute="bottom" secondItem="1CW-ZP-sqf" secondAttribute="bottom" id="Tp8-Bv-eNj"/>
<constraint firstItem="1CW-ZP-sqf" firstAttribute="leading" secondItem="yDn-f2-pRd" secondAttribute="leading" id="asH-N4-4d1"/>
<constraint firstItem="1CW-ZP-sqf" firstAttribute="centerY" secondItem="yDn-f2-pRd" secondAttribute="centerY" id="iUg-9l-uNK"/>
<constraint firstItem="uEe-na-x7K" firstAttribute="leading" secondItem="yDn-f2-pRd" secondAttribute="leading" id="xvD-Dr-5SD"/>
<constraint firstAttribute="trailing" secondItem="1CW-ZP-sqf" secondAttribute="trailing" id="p47-wb-nlk"/>
<constraint firstItem="1CW-ZP-sqf" firstAttribute="top" secondItem="yDn-f2-pRd" secondAttribute="top" id="xsS-u9-UmL"/>
</constraints>
<variation key="default">
<mask key="constraints">
......@@ -137,23 +126,19 @@ You will not be charged during this process.</string>
</mask>
</variation>
</view>
<navigationItem key="navigationItem" id="K20-v4-u5F">
<barButtonItem key="leftBarButtonItem" systemItem="stop" id="1vy-qm-KfK"/>
<barButtonItem key="rightBarButtonItem" title="Item" id="N0Y-dd-SGm"/>
</navigationItem>
<connections>
<outlet property="buttonDismiss" destination="uEe-na-x7K" id="Wz0-5O-P8r"/>
<outlet property="buttonRestorePurchase" destination="Un1-3v-2Ob" id="VA0-fZ-KyS"/>
<outlet property="labelDescription" destination="6Sq-eo-OrE" id="Ofw-Fg-FCH"/>
<outlet property="labelTitle" destination="C7C-8i-CTb" id="WTX-ZD-y2n"/>
<outlet property="scrollView" destination="rId-M8-qSh" id="H21-4l-pwC"/>
<outlet property="textEmail" destination="5Vo-GR-ciV" id="NNG-TR-vtL"/>
<outlet property="viewModal" destination="1CW-ZP-sqf" id="knW-G6-eA2"/>
<segue destination="9jt-8I-K8i" kind="presentation" identifier="SignupViaRestoreSegue" id="Vqa-Fa-HWk"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="5s0-3w-xw2" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="846" y="-2596"/>
<point key="canvasLocation" x="354" y="-2622"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="YDM-pU-cja">
......@@ -437,7 +422,6 @@ You will not be charged during this process.</string>
<outlet property="scrollView" destination="RgS-fn-CJH" id="gQR-aC-e9f"/>
<outlet property="textPassword" destination="Wtm-HW-6FS" id="bvM-nY-mSr"/>
<outlet property="textUsername" destination="Gcb-kt-Yu7" id="5rD-If-yIW"/>
<segue destination="9jt-8I-K8i" kind="presentation" identifier="SignupViaRestoreSegue" id="EEe-nI-dHO"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="MPJ-r6-Xjn" userLabel="First Responder" sceneMemberID="firstResponder"/>
......@@ -883,6 +867,9 @@ You will not be charged during this process.</string>
<constraint firstAttribute="height" constant="20" id="8C6-6B-4dA"/>
</constraints>
<state key="normal" title="Button"/>
<connections>
<segue destination="Y1W-Um-2lp" kind="show" identifier="RestorePurchaseSegue" id="Od1-de-d57"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
......@@ -1175,6 +1162,6 @@ You will not be charged during this process.</string>
</resources>
<inferredMetricsTieBreakers>
<segue reference="L3M-2E-gAx"/>
<segue reference="EEe-nI-dHO"/>
<segue reference="Vqa-Fa-HWk"/>
</inferredMetricsTieBreakers>
</document>
......@@ -44,5 +44,5 @@
"redeem.title" = "استلم محتويات بطاقة هدية";
"restore.email.placeholder" = "البريد الإلكتروني";
"restore.submit" = "تأكيد";
"restore.subtitle" = "إذا اشتريت خطة من خلال هذا التطبيق ولم تصلك بيانات تسجيل دخولك، يمكنك إرسالها مرة أخرى من هنا.\nلن يتم تحصيل رسوم منك أثناء هذه العملية.";
"restore.subtitle" = "إذا اشتريت خطة من خلال هذا التطبيق ولم تصلك بيانات تسجيل دخولك، يمكنك إرسالها مرة أخرى من هنا. لن يتم تحصيل رسوم منك أثناء هذه العملية.";
"restore.title" = "استرداد الشراء غير المقيد في الحساب";
......@@ -44,5 +44,5 @@
"redeem.title" = "Indløs gavekort";
"restore.email.placeholder" = "E-mailadresse";
"restore.submit" = "BEKRÆFT";
"restore.subtitle" = "Hvis du har købt en plan gennem denne app og ikke har modtaget dine legitimationsoplysninger, kan du anmode om at sende dem igen herfra.\nDu vil ikke blive opkrævet i løbet af denne proces.";
"restore.subtitle" = "Hvis du har købt en plan gennem denne app og ikke har modtaget dine legitimationsoplysninger, kan du anmode om at sende dem igen herfra. Du vil ikke blive opkrævet i løbet af denne proces.";
"restore.title" = "Gendan ukrediteret køb";
......@@ -44,5 +44,5 @@
"redeem.title" = "Geschenkkarte einlösen";
"restore.email.placeholder" = "E-Mail-Adresse";
"restore.submit" = "BESTÄTIGEN";
"restore.subtitle" = "Wenn du durch diese App einen Plan gekauft hast und deine Anmeldedaten nicht erhalten hast, kannst du sie von hier aus erneut senden.\nDir wird während dieses Prozesses nichts in Rechnung gestellt.";
"restore.subtitle" = "Wenn du durch diese App einen Plan gekauft hast und deine Anmeldedaten nicht erhalten hast, kannst du sie von hier aus erneut senden. Dir wird während dieses Prozesses nichts in Rechnung gestellt.";
"restore.title" = "Nicht gutgeschriebenen Kauf wiederherstellen";
......@@ -54,7 +54,7 @@
"plan.accessibility.per_month" = "per month";
"restore.title" = "Restore uncredited purchase";
"restore.subtitle" = "If you purchased a plan through this app and didn't receive your credentials, you can send them again from here.\nYou will not be charged during this process.";
"restore.subtitle" = "If you purchased a plan through this app and didn't receive your credentials, you can send them again from here. You will not be charged during this process.";
"restore.email.placeholder" = "Email address";
"restore.submit" = "CONFIRM";
......
......@@ -44,5 +44,5 @@
"redeem.title" = "Canjear tarjeta de regalo";
"restore.email.placeholder" = "Correo electrónico";
"restore.submit" = "CONFIRMAR";
"restore.subtitle" = "Si compraste un plan con esta aplicación y no recibiste tus credenciales, puedes enviarlas de nuevo desde aquí.\nNo se te harán cargos durante este proceso.";
"restore.subtitle" = "Si compraste un plan con esta aplicación y no recibiste tus credenciales, puedes enviarlas de nuevo desde aquí. No se te harán cargos durante este proceso.";
"restore.title" = "Restablecer compra no acreditada";
......@@ -44,5 +44,5 @@
"redeem.title" = "Riscatta la carta regalo";
"restore.email.placeholder" = "Indirizzo email";
"restore.submit" = "CONFERMA";
"restore.subtitle" = "Se hai acquistato un piano mediante questa app ma non hai ricevuto le tue credenziali, puoi inviarle nuovamente da qui.\nNon verrà effettuato alcun addebito durante la procedura.";
"restore.subtitle" = "Se hai acquistato un piano mediante questa app ma non hai ricevuto le tue credenziali, puoi inviarle nuovamente da qui. Non verrà effettuato alcun addebito durante la procedura.";
"restore.title" = "Ripristina acquisto non accreditato";
......@@ -44,5 +44,5 @@
"redeem.title" = "기프트 카드 청구";
"restore.email.placeholder" = "이메일 주소";
"restore.submit" = "확인";
"restore.subtitle" = "이 앱을 통해 요금 플랜을 구매하셨는데 자격 증명 정보를 받지 못하신 경우 이곳에서 다시 보내실 수 있습니다.\n이 과정 중 요금이 부과되지 않습니다.";
"restore.subtitle" = "이 앱을 통해 요금 플랜을 구매하셨는데 자격 증명 정보를 받지 못하신 경우 이곳에서 다시 보내실 수 있습니다. 이 과정 중 요금이 부과되지 않습니다.";
"restore.title" = "인정되지 않은 구매 항목 복원";
......@@ -44,5 +44,5 @@
"redeem.title" = "Løs inn gavekort";
"restore.email.placeholder" = "E-postadresse";
"restore.submit" = "BEKREFT";
"restore.subtitle" = "Hvis du kjøpte en plan via appen og ikke har mottatt opplysningene dine, kan du sende dem igjen her i fra.\nDu belastes ikke under denne prosessen.";
"restore.subtitle" = "Hvis du kjøpte en plan via appen og ikke har mottatt opplysningene dine, kan du sende dem igjen her i fra. Du belastes ikke under denne prosessen.";
"restore.title" = "Gjenopprett ukreditert kjøp";
......@@ -44,5 +44,5 @@
"redeem.title" = "Cadeaubon inwisselen";
"restore.email.placeholder" = "E-mailadres";
"restore.submit" = "BEVESTIGEN";
"restore.subtitle" = "Als u een abonnement via deze app heeft aangeschaft en u heeft uw gegevens niet ontvangen, dan kunt u ze hier opnieuw verzenden.\nEr worden geen kosten in rekening gebracht tijdens dit proces.";
"restore.subtitle" = "Als u een abonnement via deze app heeft aangeschaft en u heeft uw gegevens niet ontvangen, dan kunt u ze hier opnieuw verzenden. Er worden geen kosten in rekening gebracht tijdens dit proces.";
"restore.title" = "Aankoop herstellen";
......@@ -44,5 +44,5 @@
"redeem.title" = "Wykorzystaj kartę podarunkową";
"restore.email.placeholder" = "Adres e-mail";
"restore.submit" = "POTWIERDŹ";
"restore.subtitle" = "Jeśli kupił(a)ś plan, korzystając z tej aplikacji, ale nie dostałe(a)ś danych logowania, możesz wysłać je ponownie stąd.\nOpłata nie zostanie za to pobrana.";
"restore.subtitle" = "Jeśli kupił(a)ś plan, korzystając z tej aplikacji, ale nie dostałe(a)ś danych logowania, możesz wysłać je ponownie stąd. Opłata nie zostanie za to pobrana.";
"restore.title" = "Przywróć pominięty zakup";
......@@ -44,5 +44,5 @@
"redeem.title" = "ใช้สิทธิ์บัตรของขวัญ";
"restore.email.placeholder" = "อีเมลแอดเดรส";
"restore.submit" = "ยืนยัน";
"restore.subtitle" = "หากคุณทำการซื้อแผนผ่านแอพนี้และยังไม่ได้รับข้อมูลประจำตัว คุณสามารถส่งอีกครั้งได้จากที่นี่\nคุณจะไม่ถูกเรียกเก็บเงินซ้ำอีกครั้งในกระบวนการนี้";
"restore.subtitle" = "หากคุณทำการซื้อแผนผ่านแอพนี้และยังไม่ได้รับข้อมูลประจำตัว คุณสามารถส่งอีกครั้งได้จากที่นี่ คุณจะไม่ถูกเรียกเก็บเงินซ้ำอีกครั้งในกระบวนการนี้";
"restore.title" = "คืนค่าการซื้อยังไม่ได้คิดเครดิต";
......@@ -44,5 +44,5 @@
"redeem.title" = "Hediye kartını kullan";
"restore.email.placeholder" = "E-posta adresi";
"restore.submit" = "ONAYLA";
"restore.subtitle" = "Bu uygulamadan bir plan satın aldıktan sonra hesap bilgilerinizi alamadıysanız, onları buradan tekrar gönderebilirsiniz.\nBu işlem için sizden ücret alınmayacak.";
"restore.subtitle" = "Bu uygulamadan bir plan satın aldıktan sonra hesap bilgilerinizi alamadıysanız, onları buradan tekrar gönderebilirsiniz. Bu işlem için sizden ücret alınmayacak.";
"restore.title" = "Bilgileri gönderilmeyen satın alma işlemini tekrarlayın";
......@@ -44,5 +44,5 @@
"redeem.title" = "兑换礼品卡";
"restore.email.placeholder" = "电子邮件地址";
"restore.submit" = "确认";
"restore.subtitle" = "如果您通过此 app 购买了套餐,但没有收到凭据,可以从这里重新发送。\n在此过程中您不会被收费。";
"restore.subtitle" = "如果您通过此 app 购买了套餐,但没有收到凭据,可以从这里重新发送。 在此过程中您不会被收费。";
"restore.title" = "恢复未入账的购买";
......@@ -44,5 +44,5 @@
"redeem.title" = "兌換禮品卡";
"restore.email.placeholder" = "電子郵件地址";
"restore.submit" = "確定";
"restore.subtitle" = "如果您透過此應用程式購買方案後收不到您的憑證資料,您可以透過這裡要求再次傳送。\n此操作不會收取任何費用。";
"restore.subtitle" = "如果您透過此應用程式購買方案後收不到您的憑證資料,您可以透過這裡要求再次傳送。 此操作不會收取任何費用。";
"restore.title" = "回復未貸記購買項目";
......@@ -24,6 +24,7 @@ internal enum StoryboardSegue {
case loginAccountSegue = "LoginAccountSegue"
case purchaseVPNPlanSegue = "PurchaseVPNPlanSegue"
case redeemGiftCardSegue = "RedeemGiftCardSegue"
case restorePurchaseSegue = "RestorePurchaseSegue"
case signupQRCameraScannerSegue = "SignupQRCameraScannerSegue"
case signupViaPurchaseSegue = "SignupViaPurchaseSegue"
case signupViaRecoverSegue = "SignupViaRecoverSegue"
......
......@@ -285,7 +285,7 @@ internal enum L10n {
internal enum Restore {
/// CONFIRM
internal static let submit = L10n.tr("Welcome", "restore.submit")
/// If you purchased a plan through this app and didn't receive your credentials, you can send them again from here.\nYou will not be charged during this process.
/// If you purchased a plan through this app and didn't receive your credentials, you can send them again from here. You will not be charged during this process.
internal static let subtitle = L10n.tr("Welcome", "restore.subtitle")
/// Restore uncredited purchase
internal static let title = L10n.tr("Welcome", "restore.title")
......
......@@ -62,6 +62,11 @@ public class GetStartedViewController: AutolayoutViewController, ConfigurationAc
public override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
guard let vc = segue.destination as? PIAWelcomeViewController else {
if segue.identifier == StoryboardSegue.Welcome.restorePurchaseSegue.rawValue {
if let vc = segue.destination as? RestoreSignupViewController {
vc.preset = preset
}
}
return
}
......
......@@ -135,27 +135,6 @@ class LoginViewController: AutolayoutViewController, WelcomeChild {
}
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let vc = segue.destination as? RestoreSignupViewController {
vc.preset = preset
vc.delegate = self
}
// signup after receipt restore
else if (segue.identifier == StoryboardSegue.Welcome.signupViaRestoreSegue.rawValue) {
let nav = segue.destination as! UINavigationController
let vc = nav.topViewController as! SignupInProgressViewController
guard let email = signupEmail else {
fatalError("Signing up and signupEmail is not set")
}
var metadata = SignupMetadata(email: email)
metadata.title = L10n.Signup.InProgress.title
metadata.bodySubtitle = L10n.Signup.InProgress.message
vc.metadata = metadata
vc.signupRequest = SignupRequest(email: email)
}
}
private func enableInteractions(_ enable: Bool) {
parent?.view.isUserInteractionEnabled = enable
isLogging = !enable
......@@ -191,16 +170,3 @@ extension LoginViewController: UITextFieldDelegate {
return true
}
}
extension LoginViewController: RestoreSignupViewControllerDelegate {
func restoreController(_ restoreController: RestoreSignupViewController, didRefreshReceiptWith email: String) {
dismiss(animated: true) {
self.signupEmail = email
self.perform(segue: StoryboardSegue.Welcome.signupViaRestoreSegue)
}
}
func restoreControllerDidDismiss(_ restoreController: RestoreSignupViewController) {
dismiss(animated: true, completion: nil)
}
}
......@@ -11,7 +11,7 @@ import SwiftyBeaver
private let log = SwiftyBeaver.self
class RestoreSignupViewController: AutolayoutViewController {
public class RestoreSignupViewController: AutolayoutViewController, BrandableNavigationBar {
@IBOutlet private weak var scrollView: UIScrollView!
@IBOutlet private weak var viewModal: UIView!
......@@ -22,28 +22,32 @@ class RestoreSignupViewController: AutolayoutViewController {
@IBOutlet private weak var textEmail: BorderedTextField!
@IBOutlet private weak var buttonRestorePurchase: ActivityButton!
@IBOutlet private weak var buttonDismiss: UIButton!
@IBOutlet private weak var buttonRestorePurchase: PIAButton!
var preset: Preset?
weak var delegate: RestoreSignupViewControllerDelegate?
private var signupEmail: String?
private var isRunningActivity = false
deinit {
NotificationCenter.default.removeObserver(self)
}
override func viewDidLoad() {
override public func viewDidLoad() {
super.viewDidLoad()
self.navigationController?.setNavigationBarHidden(false, animated: true)
self.navigationItem.leftBarButtonItem = UIBarButtonItem(
image: Theme.current.palette.navigationBarBackIcon?.withRenderingMode(.alwaysOriginal),
style: .plain,
target: self,
action: #selector(back(_:))
)
self.navigationItem.leftBarButtonItem?.accessibilityLabel = L10n.Welcome.Redeem.Accessibility.back
labelTitle.text = L10n.Welcome.Restore.title
labelDescription.text = L10n.Welcome.Restore.subtitle
textEmail.placeholder = L10n.Welcome.Restore.Email.placeholder
buttonRestorePurchase.title = L10n.Welcome.Restore.submit
buttonDismiss.accessibilityLabel = L10n.Ui.Global.cancel
textEmail.text = preset?.purchaseEmail
......@@ -52,33 +56,60 @@ class RestoreSignupViewController: AutolayoutViewController {
scrollView.isScrollEnabled = false
}
let nc = NotificationCenter.default
nc.addObserver(self, selector: #selector(keyboardDidShow(notification:)), name: .UIKeyboardDidShow, object: nil)
nc.addObserver(self, selector: #selector(keyboardDidHide(notification:)), name: .UIKeyboardDidHide, object: nil)
styleRestoreButton()
}
override func viewWillAppear(_ animated: Bool) {
override public func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
enableInteractions(true)
}
// MARK: Actions
override public func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// signup after receipt restore
if (segue.identifier == StoryboardSegue.Welcome.signupViaRestoreSegue.rawValue) {
let nav = segue.destination as! UINavigationController
let vc = nav.topViewController as! SignupInProgressViewController
guard let email = signupEmail else {
fatalError("Signing up and signupEmail is not set")
}
var metadata = SignupMetadata(email: email)
metadata.title = L10n.Signup.InProgress.title
metadata.bodySubtitle = L10n.Signup.InProgress.message
vc.metadata = metadata
vc.preset = preset
vc.signupRequest = SignupRequest(email: email)
}
}
// MARK: Actions
@objc private func back(_ sender: Any?) {
self.navigationController?.popViewController(animated: true)
}
@IBAction private func restorePurchase(_ sender: Any?) {
guard !buttonRestorePurchase.isRunningActivity else {
guard !isRunningActivity else {
return
}
guard let email = textEmail.text, Validator.validate(email: email) else {
guard let email = textEmail.text, Validator.validate(email: email.trimmed()) else {
signupEmail = nil
textEmail.becomeFirstResponder()
Macros.displayImageNote(withImage: Asset.iconWarning.image,
message: L10n.Welcome.Purchase.Error.validation)
self.status = .error(element: textEmail)
return
}
signupEmail = email
self.status = .restore(element: textEmail)
signupEmail = email.trimmed()
enableInteractions(false)
isRunningActivity = true
preset?.accountProvider.restorePurchases { (error) in
self.isRunningActivity = false
if let _ = error {
self.reportRestoreFailure(error)
self.enableInteractions(true)
......@@ -94,7 +125,8 @@ class RestoreSignupViewController: AutolayoutViewController {
guard let email = signupEmail else {
fatalError("Restore receipt and signupEmail is not set")
}
delegate?.restoreController(self, didRefreshReceiptWith: email)
self.restoreController(self,
didRefreshReceiptWith: email)
}
private func reportRestoreFailure(_ optionalError: Error?) {
......@@ -104,56 +136,44 @@ class RestoreSignupViewController: AutolayoutViewController {
log.error("Failed to restore payment receipt")
}
let alert = Macros.alert(
L10n.Welcome.Iap.Error.title,
optionalError?.localizedDescription ?? ""
)
alert.addCancelAction(L10n.Ui.Global.close)
present(alert, animated: true, completion: nil)
}
@IBAction private func dismiss(_ sender: Any?) {
view.endEditing(false)
delegate?.restoreControllerDidDismiss(self)
Macros.displayImageNote(withImage: Asset.iconWarning.image,
message: optionalError?.localizedDescription ?? L10n.Welcome.Iap.Error.title)
}
private func enableInteractions(_ enable: Bool) {
textEmail.isEnabled = enable
if enable {
buttonRestorePurchase.stopActivity()
} else {
buttonRestorePurchase.startActivity()
}
}
// MARK: Notifications
@objc private func keyboardDidShow(notification: Notification) {
buttonDismiss.isUserInteractionEnabled = false
}
@objc private func keyboardDidHide(notification: Notification) {
buttonDismiss.isUserInteractionEnabled = true
}
// MARK: Restylable
override func viewShouldRestyle() {
override public func viewShouldRestyle() {
super.viewShouldRestyle()
Theme.current.applyOverlay(view)
Theme.current.applySolidLightBackground(viewModal)
Theme.current.applyCorner(viewModal)
navigationItem.titleView = NavigationLogoView()
Theme.current.applyNavigationBarStyle(to: self)
Theme.current.applyLightBackground(view)
Theme.current.applyLightBackground(viewModal)
Theme.current.applyTitle(labelTitle, appearance: .dark)
Theme.current.applySubtitle(labelDescription)
Theme.current.applyInput(textEmail)
Theme.current.applyActionButton(buttonRestorePurchase)
}
private func styleRestoreButton() {
buttonRestorePurchase.setRounded()
buttonRestorePurchase.style(style: TextStyle.Buttons.piaGreenButton)
buttonRestorePurchase.setTitle(L10n.Welcome.Restore.submit.uppercased(),
for: [])
}
private func restoreController(_ restoreController: RestoreSignupViewController, didRefreshReceiptWith email: String) {
self.signupEmail = email
self.perform(segue: StoryboardSegue.Welcome.signupViaRestoreSegue)
}
}
extension RestoreSignupViewController: UITextFieldDelegate {
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
public func textFieldShouldReturn(_ textField: UITextField) -> Bool {
if (textField == textEmail) {
restorePurchase(nil)
}
......@@ -161,8 +181,3 @@ extension RestoreSignupViewController: UITextFieldDelegate {
}
}
protocol RestoreSignupViewControllerDelegate: class {
func restoreController(_ restoreController: RestoreSignupViewController, didRefreshReceiptWith email: String)
func restoreControllerDidDismiss(_ restoreController: RestoreSignupViewController)
}
......@@ -52,7 +52,7 @@ public class SignupFailureViewController: AutolayoutViewController, BrandableNav
}
@IBAction private func submit() {
perform(segue: