liato / android-bankdroid

A swedish banking application for your Android device.
http://www.swedroid.se/forum/showthread.php?t=11108
Other
243 stars 173 forks source link

access to bpmbanking.it #560

Open montoyaedu opened 9 years ago

montoyaedu commented 9 years ago

Hello,

First of all, I would lika to say that this is a great opensource effort.

Congratulations!!!

I would like to add support for the following online banking service:

bpmbanking.it

The requested information is available at:

https://github.com/montoyaedu/bpmbanking/blob/master/src/main/java/edu/banking/bpmbanking/SimpleController.java

Here a summary:

    private static final String CONNECT_URL = "/";
    private static final String LOGINFORM_URL = "/pub/xbank/home.do";
    private static final String LOGIN_URL = "/pri/login/privata.do";
    private static final String LOGOUT_URL = "/pri/wbOnetoone/chiudi_servizio.jsp";
    private static final String HOMEPAGE_URL = "/pri/wbOnetoone/myHome.do";
    private static final String ACCOUNTDETAILS_URL = "/pri/bnkg/situazioneConti.do";
    private static final String ACCOUNTMOVEMENTS_URL = "/pri/banking/WsMovementsSearch.do";
    private static final String ACCOUNTMOVEMENTDETAILS_URL = "/pri/banking/WsMovementsDetail.do";
    private static final String FULLACCESSLOGINFORM_URL = "/pri/login/switchLogin.do";
    private static final String FULLACCESSLOGIN_URL = "/pri/login/Pin2.do?BV_UseBVCookie=Yes";
    private static final String FULLACCESSPRIVATEHOME_URL = "/pri/login/home_privata.do?BV_UseBVCookie=Yes&service=WEBANK";

    private SimpleEventHandler CONNECT_HANDLER;
    private SimpleEventHandler LOGINFORM_HANDLER;
    private SimpleEventHandler LOGIN_HANDLER;
    private SimpleEventHandler LOGOUT_HANDLER;
    private SimpleEventHandler HOMEPAGE_HANDLER;
    private SimpleEventHandler ACCOUNTDETAILS_HANDLER;
    private SimpleEventHandler ACCOUNTMOVEMENTS_HANDLER;
    private SimpleEventHandler ACCOUNTMOVEMENTDETAILS_HANDLER;
    private SimpleEventHandler FULLACCESSLOGINFORM_HANDLER;
    private SimpleEventHandler FULLACCESSLOGIN_HANDLER;
    private SimpleEventHandler FULLACCESSPRIVATEHOME_HANDLER;

All urls should have the following prefix:

        String scheme = "https";
        String hostname = "www.bpmbanking.it";
        int port = 443;

And MIME types/encodings are as following:

        CONNECT_HANDLER = new SimpleEventHandler(handler, new ConnectionEstablished(), OK, "text/html; charset=UTF-8", new HTMLCleanerSerializer());
        LOGINFORM_HANDLER = new SimpleEventHandler(handler, new LoginFormLoaded(), OK, "text/html;charset=ISO-8859-15", new HTMLCleanerSerializer());
        LOGIN_HANDLER = new SimpleEventHandler(handler, new LoggedIn(), REDIRECT, "text/html;charset=ISO-8859-15", new HTMLCleanerSerializer());
        LOGOUT_HANDLER = new SimpleEventHandler(handler, new LoggedOut(), OK, "text/html;charset=ISO-8859-15", new HTMLCleanerSerializer());
        HOMEPAGE_HANDLER = new SimpleEventHandler(handler, new PrivateHomePageLoaded(), OK, "text/html;charset=ISO-8859-15", new PrivateHomePageLoadedSerializer());
        ACCOUNTDETAILS_HANDLER = new SimpleEventHandler(handler, new AccountDetails(), OK, "application/json;charset=UTF-8", new GSONSerializer());
        ACCOUNTMOVEMENTS_HANDLER = new SimpleEventHandler(handler, new AccountMovements(), OK, "application/json;charset=UTF-8", new GSONSerializer());
        ACCOUNTMOVEMENTDETAILS_HANDLER = new SimpleEventHandler(handler, new MovementDetail(), OK, "application/json;charset=UTF-8", new GSONSerializer());
        FULLACCESSLOGINFORM_HANDLER = new SimpleEventHandler(handler, new FullAccessLoginFormLoaded(), OK, "text/html;charset=ISO-8859-15", new FullAccessLoginFormLoadedSerializer());
        FULLACCESSLOGIN_HANDLER = new SimpleEventHandler(handler, new FullAccessLoggedIn(), OK, "text/html;charset=ISO-8859-1", new HTMLCleanerSerializer());
        FULLACCESSPRIVATEHOME_HANDLER = new SimpleEventHandler(handler, new FullAccessPrivateHomePageLoaded(), OK, "text/html;charset=ISO-8859-15", new HTMLCleanerSerializer());

It should be possible to link this library by extending:

https://github.com/montoyaedu/bpmbanking/blob/master/src/main/java/edu/banking/bpmbanking/SimpleClient.java

and then by overriding onXxxx... methods.

An example application that I use for keeping track of my transactions is available at:

https://github.com/montoyaedu/bpmbanking/blob/master/src/main/java/edu/banking/bpmbanking/example/BPMClient.java

Hope this is enough. If you want, I can try to add bpmbanking support myself.

Is it enough to extend the following class?

https://github.com/liato/android-bankdroid/blob/master/bankdroid-legacy/src/main/java/com/liato/bankdroid/banking/Bank.java

Thanks in advance for considering this message.

Cheers,

Edu.

fredrike commented 8 years ago

Hi @montoyaedu,

Yes you are right, just extending Bank.java should do it. Take a look at some of the other bank-implementations to get an idea how it can be done. Unfortunately there exists no reference implementation so look through a few to see how it can be done and best practice.

Please submit a working pull-request when you have working support.

goober commented 7 years ago

@montoyaedu what is the status on this one? Are you still working on a solution or can I close the issue for now?