22using System . IO ;
33using System . Linq ;
44using System . Text ;
5+ using System . Threading ;
56using System . Threading . Tasks ;
67using DinkToPdf ;
78using DinkToPdf . Contracts ;
@@ -198,12 +199,13 @@ public async Task<ActionResult<CustomerOrder>> CalculateTotals([FromBody] Custom
198199 /// </summary>
199200 /// <param name="orderId">customer order id</param>
200201 /// <param name="paymentId">payment id</param>
202+ /// <param name="cancellationToken">cancellationToken</param>
201203 [ HttpPost ]
202204 [ Route ( "{orderId}/processPayment/{paymentId}" ) ]
203205 [ ApiExplorerSettings ( IgnoreApi = true ) ]
204- public Task < ActionResult < ProcessPaymentRequestResult > > ProcessOrderPaymentsWithoutBankCardInfo ( [ FromRoute ] string orderId , [ FromRoute ] string paymentId )
206+ public Task < ActionResult < ProcessPaymentRequestResult > > ProcessOrderPaymentsWithoutBankCardInfo ( [ FromRoute ] string orderId , [ FromRoute ] string paymentId , CancellationToken cancellationToken )
205207 {
206- return ProcessOrderPayments ( orderId , paymentId , null ) ;
208+ return ProcessOrderPayments ( orderId , paymentId , null , cancellationToken ) ;
207209 }
208210
209211 /// <summary>
@@ -213,10 +215,11 @@ public Task<ActionResult<ProcessPaymentRequestResult>> ProcessOrderPaymentsWitho
213215 /// <param name="orderId">customer order id</param>
214216 /// <param name="paymentId">payment id</param>
215217 /// <param name="bankCardInfo">banking card information</param>
218+ /// <param name="cancellationToken">cancellationToken</param>
216219 [ HttpPost ]
217220 [ Route ( "{orderId}/processPayment/{paymentId}" ) ]
218221 [ Consumes ( "application/json" , "application/json-patch+json" ) ] // It's a trick that allows ASP.NET infrastructure to select this action with body and ProcessOrderPaymentsWithoutBankCardInfo if no body
219- public async Task < ActionResult < ProcessPaymentRequestResult > > ProcessOrderPayments ( [ FromRoute ] string orderId , [ FromRoute ] string paymentId , [ FromBody ] BankCardInfo bankCardInfo )
222+ public async Task < ActionResult < ProcessPaymentRequestResult > > ProcessOrderPayments ( [ FromRoute ] string orderId , [ FromRoute ] string paymentId , [ FromBody ] BankCardInfo bankCardInfo , CancellationToken cancellationToken )
220223 {
221224 var customerOrder = await customerOrderService . GetByIdAsync ( orderId , CustomerOrderResponseGroup . Full . ToString ( ) ) ;
222225
@@ -267,7 +270,7 @@ public async Task<ActionResult<ProcessPaymentRequestResult>> ProcessOrderPayment
267270 Store = store ,
268271 BankCardInfo = bankCardInfo
269272 } ;
270- var result = inPayment . PaymentMethod . ProcessPayment ( request ) ;
273+ var result = await inPayment . PaymentMethod . ProcessPaymentAsync ( request , cancellationToken ) ;
271274 if ( result . OuterId != null )
272275 {
273276 inPayment . OuterId = result . OuterId ;
0 commit comments