billing
This commit is contained in:
parent
7b9078c6da
commit
42c08797e3
44 changed files with 2798 additions and 350 deletions
|
|
@ -1,7 +1,7 @@
|
|||
@model ApplicationUser
|
||||
|
||||
@if (Model!=null) {
|
||||
<img src="~/Avatars/@(Model.UserName).s.png" alt="" class="smalltofhol">
|
||||
@Model.UserName
|
||||
@if (Model.Posts!=null) { <a asp-controller="Blogspot" asp-action="UserPosts"
|
||||
asp-route-id="@Model.UserName" class="btn btn-link">@SR["index de ses articles"]</a>
|
||||
}
|
||||
}} else { <text>néant</text> }
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
@model HairCutQuery
|
||||
|
||||
<dl class="dl-horizontal">
|
||||
<dt>@Html.DisplayNameFor(m=>m.Prestation)
|
||||
</dt>
|
||||
|
|
@ -21,7 +20,8 @@
|
|||
</dt>
|
||||
<dd>@Html.DisplayFor(m=>m.AdditionalInfo)
|
||||
</dd>
|
||||
|
||||
<dt>@Html.DisplayNameFor(m=>m.Regularisation)</dt>
|
||||
<dd>@Html.DisplayFor(m=>m.Regularisation,new { PaymentUrl = "/api/haircut/createpayment/"+Model.Id.ToString() })</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
|
|
|||
50
Yavsc/Views/Shared/DisplayTemplates/PaypalPayment.cshtml
Normal file
50
Yavsc/Views/Shared/DisplayTemplates/PaypalPayment.cshtml
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
@model PaypalPayment
|
||||
|
||||
@if (Model!=null && Model.Executor!=null) {
|
||||
@Html.DisplayFor(m=>m.Executor)
|
||||
} else {
|
||||
|
||||
<div id="paypal-button"></div>
|
||||
|
||||
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
|
||||
<environement names="lua,coiffure,zicmoove,yavsc,yavscpre">
|
||||
<script>
|
||||
var CREATE_PAYMENT_URL = '@(ViewData["PaymentUrl"])';
|
||||
var EXECUTE_PAYMENT_URL = 'https://lua.pschneider.fr/api/payment/execute';
|
||||
var PAYPAL_ENV = 'sandbox';
|
||||
</script>
|
||||
</environement>
|
||||
<environement names="Development">
|
||||
<script>
|
||||
var CREATE_PAYMENT_URL = '@(ViewData["PaymentUrl"])';
|
||||
var EXECUTE_PAYMENT_URL = 'https://dev.pschneider.fr/api/payment/execute';
|
||||
var PAYPAL_ENV = 'sandbox';
|
||||
</script>
|
||||
</environement>
|
||||
<script>
|
||||
paypal.Button.render({
|
||||
|
||||
env: PAYPAL_ENV, // 'production', Optional: specify 'sandbox' environment
|
||||
|
||||
payment: function(resolve, reject) {
|
||||
|
||||
return paypal.request.post(CREATE_PAYMENT_URL)
|
||||
.then(function(data) { resolve(data.id); })
|
||||
.catch(function(err) { reject(err); });
|
||||
},
|
||||
|
||||
onAuthorize: function(data) {
|
||||
|
||||
// Note: you can display a confirmation page before executing
|
||||
|
||||
return paypal.request.post(EXECUTE_PAYMENT_URL,
|
||||
{ paymentID: data.paymentID, payerID: data.payerID })
|
||||
|
||||
.then(function(data) { /* Go to a success page */ })
|
||||
.catch(function(err) { /* Go to an error page */ });
|
||||
}
|
||||
|
||||
}, '#paypal-button');
|
||||
</script>
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue