File tree Expand file tree Collapse file tree 1 file changed +11
-19
lines changed
src/NoFrixion.MoneyMoov/Models/PaymentRequests Expand file tree Collapse file tree 1 file changed +11
-19
lines changed Original file line number Diff line number Diff line change 2323
2424using System . ComponentModel . DataAnnotations ;
2525using NoFrixion . MoneyMoov . Extensions ;
26- using LanguageExt ;
2726
2827namespace NoFrixion . MoneyMoov . Models ;
2928
@@ -376,30 +375,23 @@ public bool HasWebHook()
376375 return ! string . IsNullOrEmpty ( SuccessWebHookUrl ) ;
377376 }
378377
379- public Either < NoFrixionProblem , Uri > GetSuccessWebhookUri ( )
378+ public Uri GetSuccessWebhookUri ( )
380379 {
381- if ( string . IsNullOrWhiteSpace ( SuccessWebHookUrl ) )
380+ if ( string . IsNullOrEmpty ( SuccessWebHookUrl ) )
382381 {
383382 return new Uri ( MoneyMoovConstants . WEBHOOK_BLACKHOLE_URI ) ;
384383 }
385384 else
386385 {
387- if ( Uri . TryCreate ( SuccessWebHookUrl , UriKind . Absolute , out Uri ? uri ) )
388- {
389- var successWebHookUri = new UriBuilder ( uri ) ;
390-
391- string successParams = $ "id={ ID } &orderid={ OrderID ?? string . Empty } ";
392-
393- successWebHookUri . Query = string . IsNullOrEmpty ( successWebHookUri . Query )
394- ? successParams
395- : successWebHookUri . Query + "&" + successParams ;
396-
397- return successWebHookUri . Uri ;
398- }
399- else
400- {
401- return new NoFrixionProblem ( $ "The success web hook URL { SuccessWebHookUrl } for payment request ID { ID } is not a valid URL.") ;
402- }
386+ var successWebHookUri = new UriBuilder ( SuccessWebHookUrl ) ;
387+
388+ string successParams = $ "id={ ID } &orderid={ OrderID ?? string . Empty } ";
389+
390+ successWebHookUri . Query = string . IsNullOrEmpty ( successWebHookUri . Query )
391+ ? successParams
392+ : successWebHookUri . Query + "&" + successParams ;
393+
394+ return successWebHookUri . Uri ;
403395 }
404396 }
405397
You can’t perform that action at this time.
0 commit comments