Transactions

Introduction

Some WuBook services generate a cost. Such costs are generally monitored and managed on the Auth Factory Area ( https://wubook.net/wauth/wauth/ ). We also provide a way to read them in a programmatically way.

Available functions

balance_transactions(token)
balance_details(token, transaction_id)

The first function will return the list of your transactions. Notice that a transaction is a container of atomic costs. The result of such function is an array, each item having the following meaning:

  • id: guess what! the transaction id!! Surprise :)
  • closed_at: if frozen, this is the date of the transaction closure
  • details: the anatomy of the transaction
  • paid: is this transaction already paid?

Few remarks: the details field does not contain atomic costs. It aggregates them. For example, if you have 2 costs of the same type, then you will receive the sum of such costs, tagged with their related type. The transaction having id==0 (zero) is the current transaction, where current costs are inserted. It’s never closed, never paid.

The function balance_details is now used to retrieve all the atomic costs of a transaction. You obviously must specify the transaction ID and you can use ID=0 to read the current costs (costs associated to the current transaction). Its return value is again an array, each item having the following meaning:

  • descr: description
  • shortdescr: description
  • embargo: we will not require a payment until this date
  • registered: the registration time
  • currency: currency
  • dtype: the type of cost
  • name: the name of the type
  • amount: the cost
  • lcode: if not null, this cost has been generated for the related property