adriens / tickets-resto-nc-sdk

Implémentation Java de l'API de https://www.neocarte.nc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Join the chat at https://gitter.im/tickets-resto-nc-api/Lobby

tickets-resto-nc-sdk

Implémentation Java de l'API du site Web des tickets restaurants de Nouvelle-Calédonie (https://www.neocarte.nc).

Actuellement il n'existe pas d'API pour interagir avec ce sîte Web : cela est maintenant possible.

Application mobile

Use case

Pour recuperer les datas, tout simplement :

        String login = "xxxxxxxxx";
        String password = "xxxxxx";
           
        TicketsRestaurantsServiceWrapper wrap = new TicketsRestaurantsServiceWrapper(login, password, ServiceType.BOTH);
	// now deal with with account, credit, transactions ;-p
	logger.info("################################################");
	logger.info("Solde (XPF) : " + wrap.getAccountBalance());
	logger.info("Employeur : " + wrap.getAccountEmployeer());
	logger.info("Beneficiaire : " + wrap.getAccountName());
	logger.info("################################################");

	// Listing transactions
	logger.info("################################################");
	logger.info("Transactions :\n");
	Iterator<Transaction> iter = wrap.getTransactions().iterator();

	while (iter.hasNext()) {
	    logger.info(iter.next().toString());
        }
	logger.info("################################################");

Output :

################################################
Solde (XPF) : 21310
Employeur : MAIRIE DE NOUMEA
Beneficiaire : MR ADRIEN SALES
Transactions :

Date : Mon Apr 24 00:00:00 SBT 2017 (Recharge)
Date : Fri Apr 14 00:00:00 SBT 2017 (Transaction CHAMPION N'GEA)
Date : Tue Apr 04 00:00:00 SBT 2017 (Transaction CHAMPION N'GEA)
Date : Fri Mar 31 00:00:00 SBT 2017 (Recharge)
Date : Wed Mar 29 00:00:00 SBT 2017 (Recharge)
################################################


Récupération des affiliés

ArrayList<Affilie> affilies = TicketsRestaurantsServiceWrapper.getAffilies();
Iterator<Affilie> affIter = affilies.iterator();
Affilie aff = new Affilie();
            
logger.info("Affilies :\n");
while(affIter.hasNext()){
    aff =  affIter.next();
    logger.info(aff.toString());
}

Use this lib in your project

Follow jitpack instructions, see https://jitpack.io/#adriens/tickets-resto-nc-api

Motivations

  • Deal with htmlunit
  • Deal with Apache POI
  • Discover advanced features of Google Spreadsheets : dashboatd, reporting, mobile apps based on spreadsheets, ...
  • Getting fun as we gain the power on the data

About

Implémentation Java de l'API de https://www.neocarte.nc

License:GNU Lesser General Public License v3.0


Languages

Language:Java 100.0%