Notification of Payment Process Start

Tags: v9 v9preview1

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:

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);
    });

See also