Migrate to Unzer Node.js SDK

Migrate from the old heidelpay Node.js SDK to the new Unzer Node.js SDK.

About the migration

The new Unzer Node.js SDK works the same as the old heidelpay Node.js SDK, except for changes in:

  • Instance names
  • Method names
  • Payment type names
  • Deprecated code
  • UI components

Migrate to Unzer Node.js SDK

To migrate to the new Unzer Node.js SDK, you need to update the code in your project.

All migration changes
To see all Node.js SDK migration changes, go here.

To migrate from the latest version of the old heidelpay Node.js SDK to the new Unzer Node.js SDK, implement the following changes (in any order).

Install Unzer Node.js SDK

In your package.json file, replace @heidelpay/nodejs-sdk with @unzer/nodejs-sdk:

npm install --save @unzer/nodejs-sdk

Replace instance and method names

In your project, replace the names of instances and methods.

This table shows examples of changes that you need to make:

All migration changes
To see all Node.js SDK migration changes, go here.
Element Old New
Instance names Heidelpay Unzer
Method names getHeidelpay getUnzer

The following examples show how these changes apply to your payment integration.

CommonJS

var Heidelpay = require('@heidelpay/nodejs-sdk').default;
 
// Create new instance Heidelpay
var heidelpay = new Heidelpay('s-priv-...');
var Unzer = require('@unzer/nodejs-sdk').default;
 
// Create new instance Unzer
var unzer = new Unzer('s-priv-...');

ES Module

import Heidelpay from '@heidelpay/nodejs-sdk';
 
// Create new instance Heidelpay
const heidelpay = new Heidelpay('s-priv-...');
import Unzer from '@unzer/nodejs-sdk';
 
// Create new instance Unzer
const unzer = new Unzer('s-priv-...');

Typescript

import Heidelpay from '@heidelpay/nodejs-sdk';
 
// Create new instance Heidelpay
const heidelpay = new Heidelpay('s-priv-...');
import Unzer from '@unzer/nodejs-sdk';
 
// Create new instance Unzer
const unzer = new Unzer('s-priv-...');

Replace payment type names

Replace the following payment type names:

Old New
InvoiceGuaranteed InvoiceSecured
InvoiceFactoring InvoiceSecured
SepaDirectDebitGuaranteed SepaDirectDebitSecured
HirePurchaseDirectDebit InstallmentSecured

Replace deprecated code

In your project, replace any code marked as deprecated in the heidelpay Node.js SDK.

Update your UI components

To update your UI components, go here.