Permalink
Cannot retrieve contributors at this time
Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up
Find file
Copy path
Heidelpay-SXC9-example/source/Plugin.Payments.Heidelpay/Pipelines/PendingOrdersMinionPipeline/Blocks/ValidatePaymentBlock.cs
Find file
Copy path
Fetching contributors…

using Plugin.Payment.Heidelpay.Components; | |
using Sitecore.Commerce.Core; | |
using Sitecore.Commerce.Plugin.Orders; | |
using Sitecore.Framework.Pipelines; | |
using System.Threading.Tasks; | |
namespace Plugin.Payment.Heidelpay.Pipelines.PendingOrdersMinionPipeline.Blocks | |
{ | |
[PipelineDisplayName("Plugin.Payment.Heidelpay:Blocks:ValidatePaymentBlock")] | |
public class ValidatePaymentBlock : PipelineBlock<Order, Order, CommercePipelineExecutionContext> | |
{ | |
public override Task<Order> Run(Order arg, CommercePipelineExecutionContext context) | |
{ | |
if (!arg.HasComponent<HeidelpayPaymentComponent>()) | |
{ | |
return Task.FromResult(arg); | |
} | |
var payment = arg.GetComponent<HeidelpayPaymentComponent>(); | |
if (!payment.IsSettled) | |
{ | |
context.Abort("Heidelpay payment has not been received", context); | |
} | |
return Task.FromResult(arg); | |
} | |
} | |
} |