Skip to content

Order Management , Notifications and Events

JL Alías E2Y edited this page May 16, 2023 · 1 revision

Order Management

Learn how the Adyen payments add-on implements the Order Management system.

Payment Pending

For payments using cards with 3D Secure authentication or local payment methods, the add-on places the order with a PAYMENT_PENDING status. This status will be removed as soon as the authorisation is finished.

In cases where the payment is abandoned or the authorisation is not received, the order status is updated to PROCESSING_ERROR after a certain period. By default this period is 60 minutes. You can configure this period in the dynamic order process definition file:

In the extension you are using (adyenv6fulfilmentprocess or adyenv6ordermanagement), find the order-process.xml file. Update the timeout delay value and save the file.

AdyenPaymentResult

Authorisation

Capture + Partial Capture

If you have configured an automatic capture using the Hybris back office, we capture your payment automatically. However, if you prefer a manual capture flow you need to send a capture request before the authorisation expires.

Some payment methods do not support manual capture. Your capture flow settings in Hybris should match the capture settings for your merchant account in your Customer Area.

The add-on provides an implementation of the de.hybris.platform.payment.commands.CaptureCommand for capturing payments.

Using adyenCheckCaptureAction, you can check if the capture of a payment has been completed. You can expect the following states:

  • OK – Payment was captured
  • NOK – Capture failed
  • WAIT – Waiting for capture completion (listening to the AdyenCaptured event)

Cancellations/Refunds + Partial ...

The add-on provides an implementation of the de.hybris.platform.payment.commands.VoidCommand to cancel the payment, if required. This command uses our cancelOrRefund API call and refunds the payment.

Refunds + Partial Refund

This extension provides an implementation of the de.hybris.platform.payment.commands.FollowOnRefundCommand to refund a payment.

You can integrate AdyenCancelOrRefundAction to check if a refund is complete. You can expect the below states:

  • OK – Payment was refunded
  • NOK – Refund failed
  • WAIT – Waiting for refund completion (listening to the AdyenRefunded event)

Notifications

To keep you updated on the status of a payment, we send you notifications. The Adyen payments add-on for SAP Commerce (Hybris) accepts notifications sent from Adyen using the controller under URL /adyen/v6/notification/json.

To receive notifications, you first need to set up a standard JSON notification in the Adyen Customer Area. Refer to Server notification settings.

HTTP basic authentication

The notifications are secured via HTTP basic authentication. You need to configure your username and password for basic authentication in the Adyen Customer Area when you set up notifications, and also in your SAP back office.

As an extra layer of security you can allowlist Adyen IP ranges so that the controller under /adyen/v6/notification/json is only available from the Adyen address space.

Cron job

Adyen may send notifications in batches, and their processing can be a resource-intensive procedure. The add-on provides the cron job AdyenProcessNotificationCronJob that processes notifications regularly.

Event handling

The add-on handles notifications by their eventCode:

Authorization:

Events are handled by registering the appropriate AUTHORIZATION transaction entry and emitting the AdyenPaymentResult event (or the AdyenAuthorized event for plugin versions below 7.0.0) to the corresponding order processes.

Capture:

Events are handled by registering the appropriate CAPTURE transaction entry and emitting the AdyenCaptured event to the corresponding order processes.

Refund:

Events are handled by registering the appropriate REFUND_FOLLOW_ON transaction entry and emitting the AdyenRefunded event to the corresponding return processes.

Cancellation:

Events are handled by registering the appropriate CANCEL transaction entry.

Supported list of Events

See here for more information on all events

Transaction events

EventCode Supported
AUTHORISATION yes
AUTHORISATION_ADJUSTMENT Not tested
CANCELLATION yes
CANCEL_OR_REFUND yes
CAPTURE yes
CAPTURE_FAILED Not tested
HANDLED_EXTERNALLY Not tested
ORDER_OPENED Not tested
ORDER_CLOSED Not tested
REFUND yes
REFUND_FAILED Not tested
REFUNDED_REVERSED Not tested
REFUND_WITH_DATA Not tested
REPORT_AVAILABLE Not tested
VOID_PENDING_REFUND Not tested

Dispute events

EventCode Supported
CHARGEBACK Not tested
CHARGEBACK_REVERSED Not tested
NOTIFICATION_OF_CHARGEBACK Not tested
NOTIFICATION_OF_FRAUD Not tested
PREARBITRATION_LOST Not tested
PREARBITRATION_WON Not tested
REQUEST_FOR_INFORMATION Not tested
SECOND_CHARGEBACK Not tested

Payout events

EventCode Supported
PAYOUT_EXPIRE Not tested
PAYOUT_DECLINE Not tested
PAYOUT_THIRDPARTY Not tested
PAIDOUT_REVERSED Not tested

Non-default event codes

EventCode Supported
OFFER_CLOSED N/a
RECURRING_CONTRACT No
POSTPONED_REFUND No
AUTHENTICATION No
CAPTURE Yes
MANUAL_REVIEW_ACCEPT N/a
MANUAL_REVIEW_REJECT N/a