retours du paiment
This commit is contained in:
parent
1843955f7e
commit
1958372119
1 changed files with 16 additions and 14 deletions
|
|
@ -2,35 +2,33 @@
|
||||||
|
|
||||||
@if (Model!=null && Model.PaypalPaymentId!=null) {
|
@if (Model!=null && Model.PaypalPaymentId!=null) {
|
||||||
|
|
||||||
if (Model.Executor.Id == User.GetUserId()) {
|
@if (Model.Executor.Id == User.GetUserId()) {
|
||||||
<text>
|
<text>
|
||||||
Vous avez payé :
|
Votre paiment
|
||||||
</text>
|
</text>
|
||||||
} else {
|
} else {
|
||||||
<text>
|
<text>
|
||||||
@Html.DisplayFor(m=>m.Executor.UserName) a payé :
|
Le paiment de @Html.DisplayFor(m=>m.Executor.UserName)
|
||||||
</text>
|
</text>
|
||||||
}
|
}
|
||||||
// Da failback
|
<text> :
|
||||||
<a asp-controller="Manage" asp-action="PaymentInfo" asp-route-id="@Model.PaypalPaymentId">@Model.PaypalPaymentId</a>
|
</text><a asp-controller="Manage" asp-action="PaymentInfo" asp-route-id="@Model.PaypalPaymentId">@Model.PaypalPaymentId</a>
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
<div id="paypal-button"></div>
|
<div id="paypal-button"></div>
|
||||||
|
|
||||||
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
|
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
|
||||||
<environement names="lua,coiffure,zicmoove,yavsc,yavscpre">
|
<environement names="lua,coiffure,zicmoove,yavsc,yavscpre">
|
||||||
<script>
|
<script>
|
||||||
var CREATE_PAYMENT_URL = '@(ViewData["PaymentUrl"])';
|
var CREATE_PAYMENT_URL = '@(ViewData["PaymentUrl"])';
|
||||||
var EXECUTE_PAYMENT_URL = 'https://lua.pschneider.fr/api/payment/execute';
|
var EXECUTE_PAYMENT_URL = '@(SiteSettings.Value.Audience)/api/payment/execute';
|
||||||
var PAYPAL_ENV = 'sandbox';
|
var PAYPAL_ENV = 'production';
|
||||||
</script>
|
</script>
|
||||||
</environement>
|
</environement>
|
||||||
<environement names="Development">
|
<environement names="Development">
|
||||||
<script>
|
<script>
|
||||||
var CREATE_PAYMENT_URL = '@(ViewData["PaymentUrl"])';
|
var CREATE_PAYMENT_URL = '@(ViewData["PaymentUrl"])';
|
||||||
var EXECUTE_PAYMENT_URL = 'https://dev.pschneider.fr/api/payment/execute';
|
var EXECUTE_PAYMENT_URL = '@(SiteSettings.Value.Audience)/api/payment/execute';
|
||||||
var PAYPAL_ENV = 'sandbox';
|
var PAYPAL_ENV = 'sandbox';
|
||||||
</script>
|
</script>
|
||||||
</environement>
|
</environement>
|
||||||
|
|
@ -53,8 +51,12 @@
|
||||||
return paypal.request.post(EXECUTE_PAYMENT_URL,
|
return paypal.request.post(EXECUTE_PAYMENT_URL,
|
||||||
{ paymentID: data.paymentID, payerID: data.payerID })
|
{ paymentID: data.paymentID, payerID: data.payerID })
|
||||||
|
|
||||||
.then(function(data) { /* Go to a success page */ })
|
.then(function(data) {
|
||||||
.catch(function(err) { /* Go to an error page */ });
|
document.location = '@(ViewData["SuccessUrl"])';
|
||||||
|
/* Go to a success page */ })
|
||||||
|
.catch(function(err) {
|
||||||
|
document.location = '/Manage/PaymentInfo/'+data.paymentID;
|
||||||
|
/* Go to an error page */ });
|
||||||
}
|
}
|
||||||
|
|
||||||
}, '#paypal-button');
|
}, '#paypal-button');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue