Adyen for Platforms

The Adyen plugin enables some specific features when set up for Adyen for Platforms.

To enable Adyen for Platforms go to Store > Plugins > Adyen Configure and check the checkbox "Enable Adyen Platforms".

Split Payments

Payments can be split between Adyen sub-accounts by setting up Product Fields to denote the Adyen Account ID.

Firstly, ensure the following Product Fields exist in Aurora Products > Fields > Fields

  • merchant_id
  • stock_brand_name

Secondly, add field values for those fields to the products which should be paid out to the different Sub Accounts.

For example, if a fictional product "Falco White Trainers" is fulfilled by a different Adyen Sub Account, get the Account ID for that Account from Adyens Platforms Dashboard and set the merchant_id product field to that value for the product. The stock_brand_name is a label which is passed to Adyen and is used in the split payment description.

The final step is to update your Adyen templates to tell Aurora to duplicate the merchant_id and stock_brand_name to the order items on completion of checkout. This is needed to allow split payments to be refunded.

More info about this can be found in this support article Submitting Ordered Item Additional Fields from Templates but the following code snippets show the steps taken in the AuroraDemo templates to get this to work.

Checkout

Simply provide the merchant_id and stock_brand_name as hidden fields under the name duplicate_product_fields_to_ordered_items[] in the checkout. This can be within the Adyen template as it is specific to Adyen.

<input name="duplicate_product_fields_to_ordered_items[]" type="hidden" value="merchant_id">
<input name="duplicate_product_fields_to_ordered_items[]" type="hidden" value="stock_brand_name">

Ajax Checkout

We recommend looking at the updated template files detailed below to submit duplicate field names for Adyen transactions not done through standard checkout. For example PDP buttons.

Update the aapc.js component to send the data for duplicateProductFieldsToOrderedItems to Aurora. You can either pass in the field names through the component initialisation in the templates as per the example below or hard-code the field names into the aapc.js file (Line 26 below).

$(function() {
    // Default option.
    $.aapc.duplicateProductFieldsToOrderedItems = [];

    $.aapc.setup = function (options) {
        // ... Other setup options ...
      
        // Add duplicateProductFieldsToOrderedItems from options into the component.
        if ("duplicateProductFieldsToOrderedItems" in options) {
            $.aapc.duplicateProductFieldsToOrderedItems = options.duplicateProductFieldsToOrderedItems;
        }
    }

    // ... Rest of component definition unchanged.

    $.aapc.doSetupSubmit = async (submitData, plugin) => {
        let shipTo = {
            home: 'ship',
            store: 'store',       
        };

        //map shiptowhere to correct values
        submitData.shiptowhere = shipTo[submitData.shiptowhere] || shipTo.home;
        // Add the field names into the submission data.
        submitData.duplicate_product_fields_to_ordered_items = $.aapc.duplicateProductFieldsToOrderedItems;
        
        try {
            return await $.ajax({
                url: "/checkout/setup-submit?checkout_type=proxy-adyen",
                type: "POST",
                data: submitData,
            });
        } catch (e) {
            $.aapc.log('aapc:' + plugin.component.shortName + ': ' + plugin.component.name + ':setupSubmit Payment Setup Submit request failed: ', e);
            throw Error('aapc:' + plugin.component.shortName + ': ' + plugin.component.name + ':setupSubmit Payment Setup Submit request failed: ' + e)
        }
    }
});
$.aapc.setup({
  // ... Other setup options.
  duplicateProductFieldsToOrderedItems: ['merchant_id', 'stock_brand_name'],
});
$.aapc.setup({
  // ... Other setup options.
  duplicateProductFieldsToOrderedItems: ['merchant_id', 'stock_brand_name'],
});

Settings

It is recommended that you enable this setting within Store > Settings > Aurora > Refunds > Disable Non-Automatic Refund Types.

Refunds cannot be split when using a non-automatic refund type and this setting will prevent users from selecting a non-automatic strategy during refund administration.

Microservice Settings

The following settings are configured from the Store > Microservices > Proxy Adyen and are specific to Adyen for Platforms

Parameter NameValue for IntegrationNotes
Enable Adyen PlatformsChecked - for Enabled
Unchecked - for Disabled
When enabled, specific functionality for Adyen Platforms will be enabled.
Default Payment Account IDGet this value from AdyenOptional - The Account ID used in the Default payment split.
If not set the account value within the Default split will not be sent to Adyen.
Liable Account IDGet this value from AdyenOptional - The platform liable Account ID. Used in the PaymentFee payment split and the Shipping BalanceAccount split for orders where all products contained a merchant_id

If not set the account value for the PaymentFee split will not be sent to Adyen and shipping will always be included in the Default split, as account is a required field for BalanceAccount Splits.