@@ -553,6 +553,7 @@ public async Task<ActionResult<DashboardStatisticsResult>> GetDashboardStatistic
553553 /// <param name="callback">payment callback parameters</param>
554554 [ HttpPost ]
555555 [ Route ( "~/api/paymentcallback" ) ]
556+ [ Authorize ( ModuleConstants . Security . Permissions . PaymentExecuteCallback ) ]
556557 public async Task < ActionResult < PostProcessPaymentRequestResult > > PostProcessPayment ( [ FromBody ] PaymentCallbackParameters callback )
557558 {
558559 var parameters = paymentRequestConverter . GetPaymentParameters ( callback ) ;
@@ -570,6 +571,7 @@ public async Task<ActionResult<PostProcessPaymentRequestResult>> PostProcessPaym
570571 /// </summary>
571572 [ HttpPost ]
572573 [ Route ( "~/api/paymentcallback-raw" ) ]
574+ [ Authorize ( ModuleConstants . Security . Permissions . PaymentExecuteCallback ) ]
573575 public async Task < ActionResult < PostProcessPaymentRequestResult > > PostProcessPaymentRaw ( )
574576 {
575577 var parameters = paymentRequestConverter . GetPaymentParameters ( await GetRequestBody ( ) , Request . QueryString . Value ) ;
@@ -582,6 +584,27 @@ public async Task<ActionResult<PostProcessPaymentRequestResult>> PostProcessPaym
582584 : BadRequest ( response ) ;
583585 }
584586
587+ /// <summary>
588+ /// Payment callback operation used by external payment services to inform post process payment in our system
589+ /// </summary>
590+ [ HttpPost ]
591+ [ Route ( "~/api/paymentcallback-form" ) ]
592+ [ Authorize ( ModuleConstants . Security . Permissions . PaymentExecuteCallback ) ]
593+ public async Task < ActionResult < PostProcessPaymentRequestResult > > PostProcessPaymentForm ( [ FromForm ] IFormCollection form )
594+ {
595+ var callbackParameters = new PaymentCallbackParameters ( )
596+ {
597+ Parameters = form . Select ( kvp => new KeyValuePair ( )
598+ {
599+ Key = kvp . Key ,
600+ Value = kvp . Value . FirstOrDefault ( ) ?? string . Empty ,
601+ } )
602+ . ToArray ( ) ,
603+ } ;
604+
605+ return await PostProcessPayment ( callbackParameters ) ;
606+ }
607+
585608 private async Task < string > GetRequestBody ( )
586609 {
587610 using var reader = new StreamReader ( Request . Body , Encoding . UTF8 , detectEncodingFromByteOrderMarks : true , 1024 , leaveOpen : true ) ;
0 commit comments