2.0.4 • Published 2 days ago

paytools-3ds v2.0.4

Weekly downloads
-
License
To be used with t...
Repository
-
Last release
2 days ago

Introduction

This is a javascript library that performs ThreeD Secure authentication.

Getting Started

  1. Installation process Use: npm i paytools-3ds Put library in your scripts folder.

  2. Software dependencies None.

  3. Latest releases 1.0.0 - base version.

  4. API references The library contains a single api.

Call: perform3ds(sessionToken, iFrameElementId, cardData, callback);

Parameters

sessionToken Token obtained from the Orchestra service (see testing below)

iFrameElementId {string} Id of element in which a challenge iFrame is to be created

cardData {Object} The card details to be authenticated in the following format:

{
    cardType: "", // 'Visa', 'MasterCard', 'AMEX', 'Discover'
    cardNumber: "",
    expirationYear: number,
    expirationMonth: number,
    cardHolderName: ""
};

callback The callback function to be invoked upon completion. It accepts the authentication results object. The results object has a member named 'messageType' and optional members, based on the MessageType.

result structure { messageType: "", ... other members }

Authenticated message { messageType: "Authenticated", threeDs: { authenticationValue: "", eci: "", xID: "", version: "", } }

Rejected message { messageType: "Rejected", reason: "" }

CardNotEnrolled message { messageType: "CardNotEnrolled" }

TechnicalProblem message { messageType: "TechnicalProblem", reason: "", reference: "" }

Build and Test

In order to use the library, you will need to have an account with Orchestra. Use https://www.pcibooking.net

In order to obtain a session token, you should use the POST /threeDsSessions api. See full documentation at https://www.pcibooking.net/orchestra

You may use the index.html as an example for using the library.