ČSOB Business Connector – PHP implementation

A few months ago I was asked to implement the connector in PHP 7.3 for new ČSOB API called Business Connector (CEB). If you have business bank account in ČSOB bank, you can activate the Business Connector in the internet banking. Afterwards this API will be available for you.

PHP implementation of CEB allows you to perform following tasks:

  • account information
  • list incoming/outgoing payments
  • generate import of payment batches

As mentioned the CEB connector is written in PHP 7.3 and you can find the source files on https://github.com/AsisTeam/csob-bc or you can install it into your project via composer require asisteam/csob-bc.

During the implementation I followed the implementation guide provided by ČSOB itself. Unfortunately there was no other open-source implementation of CEB even in different languages so I had no choice of inspiring myself in others code and I had to struggle with ČSOB certificates for a while. Anyway in the end there is a functional program that you can use for your own purpose as you wish and modify the code as you wish.

(more…)

Continue Reading

Marshalling empty slice to empty JSON array instead of null in Go

You’d better don’t make them angry and make them happy giving them the proper `[]` empty array value. How to do that? Easily.

When you are creating the new slice like var people []Person you created new slice with you get the nil pointer to people var. And then there is a comprehensively a null value in output JSON. But if you create new slice with people := make([]Person, 0) you get the desired output. Or you can use people := []Person{}for same result too. See the whole code below or try it in playground. Tell me if the Frontend colleague invited you for a beer then.

In JSON APIs you often need to return array of data. In your Go code you probably use the slice []NameOfTheType to keep the list of the items. But when it comes to marshalling to JSON when the slice is empty you may get the JSON output contains null instead of an empty array. You should (but most of the time should not) see the faces of frontend developers when they face null instead of expected [] and try to iterate over it in JS 🙂

(more…)

Continue Reading
Close Menu