Repository navigation
Expand file tree
/
Copy pathBasePaymentTransactionController.cs
More file actions
559 lines (474 loc) · 23.9 KB
/
Copy pathBasePaymentTransactionController.cs
File metadata and controls
559 lines (474 loc) · 23.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
using Grand.Business.Core.Commands.Checkout.Orders;
using Grand.Business.Core.Extensions;
using Grand.Business.Core.Interfaces.Checkout.Orders;
using Grand.Business.Core.Interfaces.Checkout.Payments;
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Business.Core.Queries.Checkout.Orders;
using Grand.Business.Core.Utilities.Checkout;
using Grand.Domain.Orders;
using Grand.Domain.Payments;
using Grand.Domain.Permissions;
using Grand.Mediator;
using Grand.SharedKernel;
using Grand.Web.AdminShared.Interfaces;
using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.Controllers;
using Grand.Web.Common.DataSource;
using Grand.Web.Common.Localization;
using Grand.Web.Common.Security.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace Grand.Web.AdminShared.Controllers;
[PermissionAuthorize(PermissionSystemName.PaymentTransactions)]
[AutoValidateAntiforgeryToken]
public abstract class BasePaymentTransactionController(
IPaymentTransactionService paymentTransactionService,
IOrderService orderService,
IRequestTranslationService translationService,
IDateTimeService dateTimeService,
IMediator mediator,
IEnumTranslationService enumTranslationService,
IAdminDataScope<PaymentTransaction> scope)
: BaseController
{
// Exposed for host-specific concrete subclasses (none currently need extra actions, unlike
// Shipment's Admin-only EditUserFields, but the accessors are added for consistency with
// every other Base*Controller and so Task 3/4's own file sections can reference them).
protected IPaymentTransactionService PaymentTransactionService => paymentTransactionService;
protected IOrderService OrderService => orderService;
protected IRequestTranslationService TranslationService => translationService;
protected IDateTimeService DateTimeService => dateTimeService;
protected IMediator Mediator => mediator;
protected IEnumTranslationService EnumTranslationService => enumTranslationService;
protected IAdminDataScope<PaymentTransaction> Scope => scope;
/// <summary>DRY replacement for the repeated "load payment transaction, redirect to List if not
/// found or not authorized" pattern found in both original controllers (Admin never denied;
/// Store denied on StoreId mismatch at every single action). Not a behavior change — every call
/// site below still individually returns RedirectToAction("List") exactly as the originals
/// did.</summary>
protected async Task<(PaymentTransaction paymentTransaction, IActionResult denied)> LoadAuthorizedPaymentTransaction(string id)
{
var paymentTransaction = await paymentTransactionService.GetById(id);
if (paymentTransaction == null) return (null, RedirectToAction("List", "PaymentTransaction"));
if (!await scope.HasAccess(paymentTransaction)) return (null, RedirectToAction("List", "PaymentTransaction"));
return (paymentTransaction, null);
}
#region List
public IActionResult Index() => RedirectToAction("List");
public IActionResult List()
{
var model = new PaymentTransactionListModel {
PaymentTransactionStatus = enumTranslationService.ToSelectList(TransactionStatus.Pending, false)
.ToList()
};
model.PaymentTransactionStatus.Insert(0,
new SelectListItem { Text = translationService.GetResource("Admin.Common.All"), Value = "-1", Selected = true });
return View(model);
}
/// <summary>Store's original forced <c>model.StoreId = StaffStoreId</c> unconditionally at the
/// top of this action, overwriting whatever the posted grid model carried — not the usual
/// "default when null" forcing pattern, because the List grid never lets a Store user pick a
/// different store to begin with (there's no store selector on this screen for Store; compare
/// Order's list, which does have one). Admin's original had no such line at all. Reproduced here
/// as an unconditional assignment gated on <c>scope.DefaultStoreId</c> being non-null, which is
/// exactly true for Store and exactly false (null) for Admin — same observable behavior as
/// both originals, expressed once.</summary>
[PermissionAuthorizeAction(PermissionActionName.List)]
[HttpPost]
public async Task<IActionResult> List(DataSourceRequest command, PaymentTransactionListModel model)
{
if (scope.DefaultStoreId is not null) model.StoreId = scope.DefaultStoreId;
DateTime? startDateValue = model.StartDate == null
? null
: dateTimeService.ConvertToUtcTime(model.StartDate.Value, dateTimeService.CurrentTimeZone);
DateTime? endDateValue = model.EndDate == null
? null
: dateTimeService.ConvertToUtcTime(model.EndDate.Value, dateTimeService.CurrentTimeZone);
Guid? orderGuid = null;
if (!string.IsNullOrEmpty(model.OrderNumber))
if (int.TryParse(model.OrderNumber, out var ordernumber))
{
var order = await orderService.GetOrderByNumber(ordernumber);
if (order != null)
orderGuid = order.OrderGuid;
}
var paymentTransactions = await mediator.Send(new GetPaymentTransactionQuery {
CustomerEmail = model.SearchCustomerEmail,
Ts = model.SearchTransactionStatus >= 0 ? (TransactionStatus)model.SearchTransactionStatus : null,
CreatedFromUtc = startDateValue,
CreatedToUtc = endDateValue,
StoreId = model.StoreId,
OrderGuid = orderGuid,
PageIndex = command.Page - 1,
PageSize = command.PageSize,
//the payment of an order searched for by its number is shown whatever state its checkout left it in
IncludeTemp = model.ShowAbandoned || orderGuid.HasValue
});
var dataModel = new List<PaymentTransactionModel>();
foreach (var item in paymentTransactions)
{
var order = await orderService.GetOrderByGuid(item.OrderGuid);
var trmodel = new PaymentTransactionModel {
Id = item.Id,
OrderCode = item.OrderCode,
CustomerEmail = item.CustomerEmail,
CustomerId = item.CustomerId,
CurrencyCode = item.CurrencyCode,
TransactionAmount = item.TransactionAmount,
PaidAmount = item.PaidAmount,
PaymentMethodSystemName = item.PaymentMethodSystemName,
RefundedAmount = item.RefundedAmount,
OrderId = order?.Id,
OrderNumber = order?.OrderNumber,
CreatedOn = dateTimeService.ConvertToUserTime(item.CreatedOnUtc, DateTimeKind.Utc),
TransactionStatus = item.TransactionStatus,
Status = enumTranslationService.GetTranslationEnum(item.TransactionStatus)
};
dataModel.Add(trmodel);
}
var gridModel = new DataSourceResult {
Data = dataModel.ToList(),
Total = paymentTransactions.TotalCount
};
return Json(gridModel);
}
[PermissionAuthorizeAction(PermissionActionName.Preview)]
[HttpPost]
public async Task<IActionResult> GoToOrderNumber(PaymentTransactionListModel model)
{
if (model.OrderNumber == null)
return RedirectToAction("List", "PaymentTransaction");
int.TryParse(model.OrderNumber, out var id);
var order = await orderService.GetOrderByNumber(id);
if (order == null)
return RedirectToAction("List", "PaymentTransaction");
var paymentTransaction = await paymentTransactionService.GetOrderByGuid(order.OrderGuid);
if (paymentTransaction == null)
//not found
return RedirectToAction("List", "PaymentTransaction");
if (!await scope.HasAccess(paymentTransaction))
return RedirectToAction("List", "PaymentTransaction");
return RedirectToAction("Edit", "PaymentTransaction", new { id = paymentTransaction.Id });
}
#endregion
#region Edit
[PermissionAuthorizeAction(PermissionActionName.Preview)]
public async Task<IActionResult> Edit(string id)
{
var (paymentTransaction, denied) = await LoadAuthorizedPaymentTransaction(id);
if (denied != null) return denied;
var order = await orderService.GetOrderByGuid(paymentTransaction.OrderGuid);
var model = new PaymentTransactionModel {
Id = paymentTransaction.Id,
OrderCode = paymentTransaction.OrderCode,
CustomerEmail = string.IsNullOrEmpty(paymentTransaction.CustomerEmail)
? "(null)"
: paymentTransaction.CustomerEmail,
CustomerId = paymentTransaction.CustomerId,
CurrencyCode = paymentTransaction.CurrencyCode,
TransactionAmount = paymentTransaction.TransactionAmount,
PaidAmount = paymentTransaction.PaidAmount,
PaymentMethodSystemName = paymentTransaction.PaymentMethodSystemName,
RefundedAmount = paymentTransaction.RefundedAmount,
OrderId = order?.Id,
OrderNumber = order?.OrderNumber,
PurchaseOrderNumber = order?.PurchaseOrderNumber,
PaymentDueDate = order?.PaymentDueDateUtc?.Date,
IsPaymentOverdue = order?.IsPaymentOverdue(DateTime.UtcNow) ?? false,
BoughtOnCredit = order?.PaymentDueDateUtc != null,
CanEditPaymentTerms = HasPaymentTerms(order),
CreatedOn = dateTimeService.ConvertToUserTime(paymentTransaction.CreatedOnUtc, DateTimeKind.Utc),
TransactionStatus = paymentTransaction.TransactionStatus,
Status = enumTranslationService.GetTranslationEnum(paymentTransaction.TransactionStatus),
IPAddress = paymentTransaction.IPAddress,
Description = paymentTransaction.Description,
AdditionalInfo = paymentTransaction.AdditionalInfo,
AuthorizationTransactionId = paymentTransaction.AuthorizationTransactionId,
CanCapture = await mediator.Send(new CanCaptureQuery { PaymentTransaction = paymentTransaction }),
CanMarkAsPaid = await mediator.Send(new CanMarkPaymentTransactionAsPaidQuery { PaymentTransaction = paymentTransaction }),
CanRefund = await mediator.Send(new CanRefundQuery { PaymentTransaction = paymentTransaction }),
CanRefundOffline = await mediator.Send(new CanRefundOfflineQuery { PaymentTransaction = paymentTransaction }),
CanPartiallyRefund = await mediator.Send(new CanPartiallyRefundQuery { PaymentTransaction = paymentTransaction, AmountToRefund = 0 }),
CanPartiallyRefundOffline = await mediator.Send(new CanPartiallyRefundOfflineQuery { PaymentTransaction = paymentTransaction, AmountToRefund = 0 }),
CanPartiallyPaidOffline = await mediator.Send(new CanPartiallyPaidOfflineQuery { PaymentTransaction = paymentTransaction, AmountToPaid = 0 }),
CanVoid = await mediator.Send(new CanVoidQuery { PaymentTransaction = paymentTransaction }),
CanVoidOffline = await mediator.Send(new CanVoidOfflineQuery { PaymentTransaction = paymentTransaction }),
CanDelete = await mediator.Send(new CanDeletePaymentTransactionQuery { PaymentTransaction = paymentTransaction }),
MaxAmountToRefund = paymentTransaction.TransactionAmount - paymentTransaction.RefundedAmount,
MaxAmountToPaid = paymentTransaction.TransactionAmount - paymentTransaction.PaidAmount
};
return View(model);
}
[PermissionAuthorizeAction(PermissionActionName.Edit)]
[HttpPost]
public async Task<IActionResult> CapturePaymentTransaction(string id)
{
var (paymentTransaction, denied) = await LoadAuthorizedPaymentTransaction(id);
if (denied != null) return denied;
try
{
var errors = await mediator.Send(new CaptureCommand { PaymentTransaction = paymentTransaction });
foreach (var error in errors)
Error(error);
return RedirectToAction("Edit", "PaymentTransaction", new { id });
}
catch (Exception exc)
{
Error(exc, false);
return RedirectToAction("Edit", "PaymentTransaction", new { id });
}
}
[PermissionAuthorizeAction(PermissionActionName.Edit)]
[HttpPost]
public async Task<IActionResult> MarkPaymentTransactionAsPaid(string id)
{
var (paymentTransaction, denied) = await LoadAuthorizedPaymentTransaction(id);
if (denied != null) return denied;
try
{
await mediator.Send(new MarkAsPaidCommand { PaymentTransaction = paymentTransaction });
return RedirectToAction("Edit", "PaymentTransaction", new { id });
}
catch (Exception exc)
{
Error(exc, false);
return RedirectToAction("Edit", "PaymentTransaction", new { id });
}
}
[PermissionAuthorizeAction(PermissionActionName.Edit)]
[HttpPost]
public async Task<IActionResult> RefundPaymentTransaction(string id)
{
var (paymentTransaction, denied) = await LoadAuthorizedPaymentTransaction(id);
if (denied != null) return denied;
try
{
var errors = await mediator.Send(new RefundCommand { PaymentTransaction = paymentTransaction });
foreach (var error in errors)
Error(error);
return RedirectToAction("Edit", "PaymentTransaction", new { id });
}
catch (Exception exc)
{
Error(exc, false);
return RedirectToAction("Edit", "PaymentTransaction", new { id });
}
}
[PermissionAuthorizeAction(PermissionActionName.Edit)]
[HttpPost]
public async Task<IActionResult> RefundPaymentTransactionOffline(string id)
{
var (paymentTransaction, denied) = await LoadAuthorizedPaymentTransaction(id);
if (denied != null) return denied;
try
{
await mediator.Send(new RefundOfflineCommand { PaymentTransaction = paymentTransaction });
return RedirectToAction("Edit", "PaymentTransaction", new { id });
}
catch (Exception exc)
{
Error(exc, false);
return RedirectToAction("Edit", "PaymentTransaction", new { id });
}
}
[PermissionAuthorizeAction(PermissionActionName.Edit)]
[HttpPost]
public async Task<IActionResult> VoidPaymentTransaction(string id)
{
var (paymentTransaction, denied) = await LoadAuthorizedPaymentTransaction(id);
if (denied != null) return denied;
try
{
var errors = await mediator.Send(new VoidCommand { PaymentTransaction = paymentTransaction });
foreach (var error in errors)
Error(error);
return RedirectToAction("Edit", "PaymentTransaction", new { id });
}
catch (Exception exc)
{
Error(exc, false);
return RedirectToAction("Edit", "PaymentTransaction", new { id });
}
}
[PermissionAuthorizeAction(PermissionActionName.Edit)]
[HttpPost]
public async Task<IActionResult> VoidPaymentTransactionOffline(string id)
{
var (paymentTransaction, denied) = await LoadAuthorizedPaymentTransaction(id);
if (denied != null) return denied;
try
{
await mediator.Send(new VoidOfflineCommand { PaymentTransaction = paymentTransaction });
return RedirectToAction("Edit", "PaymentTransaction", new { id });
}
catch (Exception exc)
{
Error(exc, false);
return RedirectToAction("Edit", "PaymentTransaction", new { id });
}
}
#endregion
#region Partial refund / paid popups
[PermissionAuthorizeAction(PermissionActionName.Edit)]
public async Task<IActionResult> PartiallyRefundPopup(string id, bool online)
{
var (paymentTransaction, denied) = await LoadAuthorizedPaymentTransaction(id);
if (denied != null) return denied;
var model = new PaymentTransactionModel {
Id = paymentTransaction.Id,
MaxAmountToRefund = paymentTransaction.TransactionAmount - paymentTransaction.RefundedAmount,
CurrencyCode = paymentTransaction.CurrencyCode
};
return View(model);
}
[PermissionAuthorizeAction(PermissionActionName.Edit)]
[HttpPost]
public async Task<IActionResult> PartiallyRefundPopup(string id, bool online, PaymentTransactionModel model)
{
var (paymentTransaction, denied) = await LoadAuthorizedPaymentTransaction(id);
if (denied != null) return denied;
try
{
var amountToRefund = model.AmountToRefund;
if (amountToRefund <= 0)
throw new GrandException("Enter amount to refund");
var maxAmountToRefund = paymentTransaction.TransactionAmount - paymentTransaction.RefundedAmount;
if (amountToRefund > maxAmountToRefund)
amountToRefund = maxAmountToRefund;
var errors = new List<string>();
if (online)
errors = (await mediator.Send(new PartiallyRefundCommand { PaymentTransaction = paymentTransaction, AmountToRefund = amountToRefund })).ToList();
else
await mediator.Send(new PartiallyRefundOfflineCommand { PaymentTransaction = paymentTransaction, AmountToRefund = amountToRefund });
if (errors.Count == 0)
{
//success — Model.RefreshPage, read by both hosts' PartiallyRefundPopup.cshtml script
//block after this task's view migration (Task 5). Admin's pre-consolidation
//controller set ViewBag.RefreshPage here instead, which its own view never read
//(a dead write, since the view already checked Model.RefreshPage) — deliberate bug
//fix, unifying onto Store's already-correct behavior. See spec §2.
model.RefreshPage = true;
return View(model);
}
foreach (var error in errors)
Error(error);
return View(model);
}
catch (Exception exc)
{
Error(exc, false);
return View(model);
}
}
[PermissionAuthorizeAction(PermissionActionName.Edit)]
public async Task<IActionResult> PartiallyPaidPopup(string id, bool online)
{
var (paymentTransaction, denied) = await LoadAuthorizedPaymentTransaction(id);
if (denied != null) return denied;
var model = new PaymentTransactionModel {
Id = paymentTransaction.Id,
MaxAmountToPaid = paymentTransaction.TransactionAmount - paymentTransaction.PaidAmount,
CurrencyCode = paymentTransaction.CurrencyCode
};
return View(model);
}
[PermissionAuthorizeAction(PermissionActionName.Edit)]
[HttpPost]
public async Task<IActionResult> PartiallyPaidPopup(string id, bool online, PaymentTransactionModel model)
{
var (paymentTransaction, denied) = await LoadAuthorizedPaymentTransaction(id);
if (denied != null) return denied;
try
{
var amountToPaid = model.AmountToPaid;
if (amountToPaid <= 0)
throw new GrandException("Enter amount to refund");
var maxAmountToPaid = paymentTransaction.TransactionAmount - paymentTransaction.PaidAmount;
if (amountToPaid > maxAmountToPaid)
amountToPaid = maxAmountToPaid;
await mediator.Send(new PartiallyPaidOfflineCommand { PaymentTransaction = paymentTransaction, AmountToPaid = amountToPaid });
//same RefreshPage fix as PartiallyRefundPopup above.
model.RefreshPage = true;
return View(model);
}
catch (Exception exc)
{
Error(exc, false);
return View(model);
}
}
#endregion
#region Purchase order number and payment due date
/// <summary>An order paid at once has neither, and this screen does not add them to it.</summary>
private static bool HasPaymentTerms(Order order) =>
order != null && (order.PaymentDueDateUtc.HasValue || !string.IsNullOrEmpty(order.PurchaseOrderNumber));
[PermissionAuthorizeAction(PermissionActionName.Edit)]
public async Task<IActionResult> PaymentTermsPopup(string id)
{
var (paymentTransaction, denied) = await LoadAuthorizedPaymentTransaction(id);
if (denied != null) return denied;
var order = await orderService.GetOrderByGuid(paymentTransaction.OrderGuid);
if (!HasPaymentTerms(order))
return RedirectToAction("Edit", "PaymentTransaction", new { id });
return View(new PaymentTransactionModel {
Id = paymentTransaction.Id,
PurchaseOrderNumber = order.PurchaseOrderNumber,
PaymentDueDate = order.PaymentDueDateUtc?.Date,
BoughtOnCredit = order.PaymentDueDateUtc.HasValue
});
}
[PermissionAuthorizeAction(PermissionActionName.Edit)]
[HttpPost]
public async Task<IActionResult> PaymentTermsPopup(string id, PaymentTransactionModel model)
{
var (paymentTransaction, denied) = await LoadAuthorizedPaymentTransaction(id);
if (denied != null) return denied;
var order = await orderService.GetOrderByGuid(paymentTransaction.OrderGuid);
if (!HasPaymentTerms(order))
return RedirectToAction("Edit", "PaymentTransaction", new { id });
model.BoughtOnCredit = order.PaymentDueDateUtc.HasValue;
var purchaseOrderNumber = PurchaseOrderNumberRules.Normalize(model.PurchaseOrderNumber, PurchaseOrderNumberMode.Optional);
var purchaseOrderNumberError = PurchaseOrderNumberRules.Validate(purchaseOrderNumber, PurchaseOrderNumberMode.Optional);
if (purchaseOrderNumberError != null)
ModelState.AddModelError(nameof(model.PurchaseOrderNumber), translationService.GetResource(purchaseOrderNumberError));
//clearing the date would silently take the order off the company's credit; text that is not a date
//gets the same message, because the one from model binding names the raw resource key
if (model.BoughtOnCredit && !model.PaymentDueDate.HasValue)
{
ModelState.Remove(nameof(model.PaymentDueDate));
ModelState.AddModelError(nameof(model.PaymentDueDate), translationService.GetResource("Admin.Orders.Fields.PaymentDueDate.Required"));
}
if (!ModelState.IsValid)
return View(model);
order.PurchaseOrderNumber = purchaseOrderNumber;
//the due date is a calendar day; a date posted for an order paid at once must not put it on credit
if (model.BoughtOnCredit)
order.PaymentDueDateUtc = DateTime.SpecifyKind(model.PaymentDueDate!.Value.Date, DateTimeKind.Utc);
await orderService.UpdateOrder(order);
model.RefreshPage = true;
return View(model);
}
#endregion
#region Delete
[PermissionAuthorizeAction(PermissionActionName.Delete)]
[HttpPost]
public async Task<IActionResult> Delete(string id)
{
var (paymentTransaction, denied) = await LoadAuthorizedPaymentTransaction(id);
if (denied != null) return denied;
if (!await mediator.Send(new CanDeletePaymentTransactionQuery { PaymentTransaction = paymentTransaction }))
{
Error(translationService.GetResource("Admin.Orders.PaymentTransaction.CannotDelete"));
return RedirectToAction("Edit", new { id = paymentTransaction.Id });
}
if (ModelState.IsValid)
{
await paymentTransactionService.DeletePaymentTransaction(paymentTransaction);
Success(translationService.GetResource("Admin.Orders.PaymentTransaction.Deleted"));
return RedirectToAction("List", "PaymentTransaction");
}
Error(ModelState);
return RedirectToAction("Edit", new { id = paymentTransaction.Id });
}
#endregion
}