Vue Storefront is now Alokai! Learn More
Adyen commercetools API v2 -> v3

Adyen commercetools API v2 -> v3

In update, we decided to:

  • cancel partial payment process if cart's totals changed during the process, as Adyen doesn't allow to update total amount of payment after initializing partial payment.

If you want to migrate, firstly make sure version of packages, extension, and notification module matches specified on the Compatibility page.

Then let's adjust codebase.

Extend order custom type in commercetools

We added adyenOrderTotalAmountValue, and adyenOrderTotalAmountCurrency custom fields to the commercetools cart/order type.

Add them to your existing type using the following field definitions:

{
  "name": "adyenOrderTotalAmountValue",
  "label": {
    "en": "adyenOrderTotalAmountValue"
  },
  "type": {
    "name": "Number"
  },
  "inputHint": "SingleLine",
  "required": false
},
{
  "name": "adyenOrderTotalAmountCurrency",
  "label": {
    "en": "adyenOrderTotalAmountCurrency"
  },
  "type": {
    "name": "String"
  },
  "inputHint": "SingleLine",
  "required": false
}

Setup commercetools API Extension for cart

Register commercetools API Extension that triggers on cart's update. It's URL should match the following pattern https://your-shop-url.local/api/adyen/webhookOnCartUpdate.

{
  "destination" : {
    "type" : "HTTP",
    "url" : "https://your-shop-url.local/api/adyen/webhookOnCartUpdate"
  },
  "triggers" : [ {
    "resourceTypeId" : "cart",
    "actions" : [ "Update" ]
  } ],
  "key" : "ct-adyen-partial-payments-cart-ext"
}

Adjust frontend part of integration to match current boilerplate

Base on the example presented at quickstart guide.