Notification of Payment Process Start
A notification has been added BeforeProceedOrderPayment, which is executed before the payment process starts (on the checkout screen when the “Pay” button is pressed).
Capabilities
Allows plugins to:
- Perform additional checks before payment
- Make changes to the order at the payment initiation stage through the provided
IOperationService
Example Usage
// Subscribing to the notification
var subscription = PluginContext.Notifications
.BeforeProceedOrderPayment
.Subscribe(notification =>
{
var order = notification.Order;
var operations = notification.Operations;
// Performing checks or changes
var editSession = operations.CreateEditSession();
// Adding external data or other operations
editSession.AddOrderExternalData(
"PaymentInitiated",
new ExternalDataItem(DateTime.Now.ToString(), false),
order
);
operations.SubmitChanges(editSession);
});