JMC/Adyen Integration¶
JMC has a pluggable payment microservice architecture. For payments, JMC integrates with the payment microservice which delegates to a provider implementation. JMC supports Adyen integration out of the box.
JMC’s service architecture is based on Spring and Java. The JMC Adyen payment endpoint implementation uses the Adyen Java API Library (https://github.com/Adyen/adyen-java-api-library) to talk directly with the Adyen payment device.
The calls to Adyen are synchronous (from the device’s perspective, JMC does put calls on background threads to wait for the responses). We wait for a response from the device.
By default, JMC does a CardAcquisitionTransaction first and then follows up with a PaymentRequest with the cardAcquisitionReference set.
JMC uses card acquisition, so it can perform business logic based on the card that is swiped.
In the case of same card refunds JMC uses ReversalRequest with the originalPOITransaction.
For non-receipted returns JMC uses a PaymentRequest with a payment type of REFUND.
For voiding transactions JMC uses a CancelOrRefundRequest with the merchant id directly to Adyen (bypassing the device).
In the case of mobile where a payment device can be chosen, JMC polls all configured devices on a regular basis to determine if they are online and to determine the battery power level. The Adyen DiagnosisRequest is used for that.
The JMC central component is capable of registering with an Adyen webhook to receive and act upon Adyen notifications. When a sale is processed with an offline Adyen device JMC will receive the notification when a PSP reference number is available, and it will update the offline transaction with it.
Webhooks¶
Adyen webhooks enable Adyen to asynchronously provide updated payment information to JMC. You can find detailed information about Adyen webhooks in the documentation located here: https://docs.adyen.com/development-resources/webhooks/.
JMC consumes these webhooks by exposing an endpoint to receive notifications from Adyen.
The JMC endpoint is accessible at /rest/adyen/notification and needs network access opened to be reachable by Adyen.
All Adyen events are logged in the adyen_notification table. If the original payment was conducted offline, the sls_auth_line_item will be updated with the PSP reference number. Any updates to the sls_auth_line_item row are recorded in the adyen_notification table under the auth_updated column.