show the payment status in the command view
This commit is contained in:
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -170,8 +170,5 @@ namespace Yavsc.Helpers
|
||||
};
|
||||
}
|
||||
|
||||
public static bool IsSuccess(this PayPalPayment info) {
|
||||
return info.State == PayPal.PayPalAPIInterfaceService.Model.PaymentStatusCodeType.COMPLETED.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ namespace Yavsc.Models.Payment {
|
||||
|
||||
public string State { get; set; }
|
||||
|
||||
public bool IsOk() { return State == "SUCCESS"; }
|
||||
public virtual List<HyperLink> Links { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,12 @@
|
||||
</text>
|
||||
}
|
||||
<text> :
|
||||
</text><a asp-controller="Manage" asp-action="PaymentInfo" asp-route-id="@Model.Regularisation.CreationToken">@Model.Regularisation.CreationToken</a>
|
||||
|
||||
</text>
|
||||
<label>
|
||||
<input type="checkbox" checked="@Model.Regularisation.IsOk()" disabled/>
|
||||
<a asp-controller="Manage" asp-action="PaymentInfo" asp-route-id="@Model.Regularisation.CreationToken">@Model.Regularisation.CreationToken</a>
|
||||
</label>
|
||||
|
||||
} else {
|
||||
<div id="paypalzone"></div>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -1202,6 +1202,11 @@
|
||||
<Content Include="Helpers\BillingHelpers.cs" />
|
||||
<Content Include="ApiControllers\BillingController.cs" />
|
||||
<Content Include="Models\Payment\PaypalPayment.cs" />
|
||||
<Content Include="ViewModels\PayPal\PaymentInfo.cs" />
|
||||
<Content Include="Helpers\PayPalHelpers.cs" />
|
||||
<Content Include="Views\Shared\DisplayTemplates\HairCutQuery.cshtml" />
|
||||
<Content Include="Views\Shared\Components\PayPalButton\Default.cshtml" />
|
||||
<Content Include="wwwroot\fonts\glyphicons-halflings-regular.svg" />
|
||||
</ItemGroup>
|
||||
<Import Project="../Yavsc.Abstract/Yavsc.Abstract.csproj" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
|
Reference in New Issue
Block a user