diff --git a/Yavsc/Helpers/BillingHelpers.cs b/Yavsc/Helpers/BillingHelpers.cs index 67657fbd..c9a233f8 100644 --- a/Yavsc/Helpers/BillingHelpers.cs +++ b/Yavsc/Helpers/BillingHelpers.cs @@ -20,9 +20,10 @@ namespace Yavsc.Helpers return bill; } - public static FileInfo GetBillInfo(string billingcode, long id) + public static FileInfo GetBillInfo(string billingcode, long id, bool acquitted = false) { - var filename = $"facture-{billingcode}-{id}.pdf"; + var suffix = acquitted ? "-ack":null; + var filename = $"facture-{billingcode}-{id}{suffix}.pdf"; return new FileInfo(Path.Combine(Startup.UserBillsDirName, filename)); } } diff --git a/Yavsc/Helpers/PayPalHelpers.cs b/Yavsc/Helpers/PayPalHelpers.cs index b06bc6ae..575cf1d9 100644 --- a/Yavsc/Helpers/PayPalHelpers.cs +++ b/Yavsc/Helpers/PayPalHelpers.cs @@ -170,8 +170,5 @@ namespace Yavsc.Helpers }; } - public static bool IsSuccess(this PayPalPayment info) { - return info.State == PayPal.PayPalAPIInterfaceService.Model.PaymentStatusCodeType.COMPLETED.ToString(); - } } } diff --git a/Yavsc/Models/Payment/PaypalPayment.cs b/Yavsc/Models/Payment/PaypalPayment.cs index e5ed69b1..4c716455 100644 --- a/Yavsc/Models/Payment/PaypalPayment.cs +++ b/Yavsc/Models/Payment/PaypalPayment.cs @@ -45,6 +45,7 @@ namespace Yavsc.Models.Payment { public string State { get; set; } + public bool IsOk() { return State == "SUCCESS"; } public virtual List Links { get; set; } } } diff --git a/Yavsc/Views/Shared/Components/PayPalButton/Default.cshtml b/Yavsc/Views/Shared/Components/PayPalButton/Default.cshtml index ae5a6d37..a0511eee 100644 --- a/Yavsc/Views/Shared/Components/PayPalButton/Default.cshtml +++ b/Yavsc/Views/Shared/Components/PayPalButton/Default.cshtml @@ -13,7 +13,12 @@ } : - @Model.Regularisation.CreationToken + + + } else {
diff --git a/Yavsc/Views/Shared/DisplayTemplates/HairCutQuery.cshtml b/Yavsc/Views/Shared/DisplayTemplates/HairCutQuery.cshtml index e826d7b3..5442ceda 100644 --- a/Yavsc/Views/Shared/DisplayTemplates/HairCutQuery.cshtml +++ b/Yavsc/Views/Shared/DisplayTemplates/HairCutQuery.cshtml @@ -3,7 +3,7 @@ var paid = false; if (Model.PaymentId!=null) { if (Model.Regularisation!=null) { - if (Model.Regularisation.IsSuccess()) { + if (Model.Regularisation.IsOk()) { paid=true; } } diff --git a/Yavsc/Yavsc.csproj b/Yavsc/Yavsc.csproj index 0273a7cf..f05c826e 100644 --- a/Yavsc/Yavsc.csproj +++ b/Yavsc/Yavsc.csproj @@ -1202,6 +1202,11 @@ + + + + +