Anytime Connect

Documentation

Version : 1.0

Getting started

The purpose of Anytime Connect

The purpose of Anytime Connect is to allow an Anytime customer to give you privileges on his account.

When the privileges are granted, you will receive an API token that will allow you to use our API as if you were the Anytime customer itself.

Partner ID

First of all, you need to get a unique partner ID from our Anytime BankStore in your customer area.

To retrieve a partner ID, you will need to :

  • Log in into your account.
  • Go into the BankStore section and click on the Anytime Connect button.
  • You will need to setup your website domain name.
  • The partner ID will be generated and you will be able to use Anytime Connect.

Installation guide

The script you have to include

(function() {
    var acs = document.createElement("script");
    document.body.appendChild(acs);
    acs.type = "text/javascript";
    acs.src = '//connect.anyti.me/[PARTNER_ID]/[LANG]/client.js';
    acs.onload = function() {
        // Your code here...
    };
})();

The PARTNER_ID is a 64 characters string and the LANG can be "fr" or "en"

You have to create a div tag with the id anytime-connect

<div id="anytime-connect" data-custom-ref="[YOUR_USER_REF]"></div>

When the user will click on the button, a popup will be displayed asking him to log in into his Anytime Account.

YOUR_USER_REF must be filled if you want to receive push notifications when a token is created/revoked for one of your user. All the data defined here will be automatically associated to the pushed data. (max length: 255 characters)

Beware! Do not fill this attribute with sensitive data, or easy guessable data like incremental user IDs. For more security, please crypt the data you put here with a strong key. As this string is shown to the end user, we are not responsible of what he can potentially do with it.

The push notifications are sent with POST method in an array of data to the callback url you have set up in your partner account.

Utilization

AC variable

If the script is included, you will have access to the AC object in javascript.

Binding an event

To bind an event, you will have to use the add function of AC object :

AC.add("onLoginSucceeded", function() {
    console.log('My login succeeded event!');
});

Retrieve a token

To retrieve a token that has been created, you have to bind onTokenCreated event :

AC.add("onTokenCreated", function(event) {
    console.log(event.token);
});

You can bind several function to each event

AC.add("onLoginSucceeded", function(event) {
    console.log('My login succeeded event 1!');
});
AC.add("onLoginSucceeded", function(event) {
    console.log('My login succeeded event 2!');
});

Events list

Event name Event family Event is triggered
onLoginSucceeded Identification events When the user is successfully logged-in into his account
onLoginFailed Identification events When the user has failed to log-in his account
onTokenCreated Identification events When the token has been created
onDisplayLoginFormScreen Screen events When the login screen is displayed
onDisplayScopeAcceptanceScreen Screen events When the scope acceptance page is displayed
onDisplayPopup Popup events When the popup is displayed
onClosePopup Popup events When the popup is closed
onClickLoginButton Click events When the user clicks on the login button
onClickQuitButton Click events When the user clicks on the quit button when he completed the process
onClickRefuseButton Click events When the user click on the refuse button in the scope acceptation screen
onError Error events If a technical error occurs.

Webhooks list

If you are using a firewall, ensure that your server allow the traffic from the IP address below:

185.8.76.132

Oauth tokens related webhooks

  • token_created: When a user log in and accept the scope, a token is created and this push notification is sent.
  • token_revoked: When a user revoke his token, this push notification is sent.

Exemple of push notification data

Array
(
    [notification] => Array
        (
            [reference] => d5ec5399f34be7fcaaeadb64ad6236550a4c19ea
            [created_at] => 2017-01-30T10:17:48+01:00
            [context] => anytime-connect
            [current_try] => 1
            [max_tries] => 3
            [data] => Array
                (
                    [hash] => [HASH]
                    [timestamp] => 1486118847.1801
                    [event_name] => token_created
                    [webhook] => https://your.webhook.com/index.php
                    [token] => THE_CREATED_TOKEN
                    [custom_reference] => YOUR_CUSTOM_REF
                )

        )

)

HASH is a SHA256 value calculated by concatenating the timestamp in the data, the character "|" and your partner reference: SHA256(timestamp|partnerRef)

Array
(
    [notification] => Array
        (
            [reference] => d5ec5399f34be7fcaaeadb64ad6236550a4c19ea
            [created_at] => 2017-01-30T10:17:48+01:00
            [context] => anytime-connect
            [current_try] => 1
            [max_tries] => 3
            [data] => Array
                (
                    [hash] => [HASH]
                    [timestamp] => 1486118847.1801
                    [event_name] => token_revoked
                    [webhook] => https://your.webhook.com/index.php
                    [token] => THE_REVOKED_TOKEN
                    [custom_reference] => YOUR_CUSTOM_REF
                )

        )

)

HASH is a SHA256 value calculated by concatenating the timestamp in the data, the character "|" and your partner reference: SHA256(timestamp|partnerRef)

Card statements related webhook

Our webhook will send you the card transactions in realtime.

Array
(
    [notification] => Array
        (
            [reference] => d5ec5399f34be7fcaaeadb64ad6236550a4c19ea
            [created_at] => 2017-01-30T10:17:48+01:00
            [context] => anytime-connect
            [current_try] => 1
            [max_tries] => 3
            [data] => Array
                (
                    [hash] => [HASH]
                    [timestamp] => 1483365005.8193
                    [event_name] => card_transaction_received
                    [request_id] => 109605
                    [type_response] => async
                    [body] => Array
                        (
                            [method] => card_last_tx
                            [card_ref] => ANY0000000000
                            [acc_id] => xxx
                            [transaction] => Array
                                (
                                    [txid] => 11111111111
                                    [mcc] => 5942
                                    [amount] => 98.32
                                    [amount_fx] => 98.32
                                    [currency] => EUR
                                    [fx] => 1.000000
                                    [fx_fee] => 0
                                    [status] => S
                                    [type] => D
                                    [balance_after] => 0.00
                                    [date] => 2017-02-02 14:14:48
                                    [description] => FNAC DIRECT - RUE DES BATEAUX LAVOIRS, IVRY SUR SEIN,94768,FRA,FRA
                                )

                        )

                )

        )

)

The documentation regarding the data tag is available on our API documentation in the webhook section.

HASH is a SHA256 value calculated by concatenating the timestamp in the data, the character "|" and your partner reference: SHA256(timestamp|partnerRef)