0.7.1 • Published 2 years ago

@finteqhub/sdk-js v0.7.1

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

processing-sdk

Use new FinteqHubProcessing(apiUrl: string, fingerprintVisitorId: string, merchantId: string, sessionId: string) to create an instance of the FinteqHubProcessing object. The FinteqHubProcessing object is your entrypoint to FinteqHub processing SDK.

const processing = new FinteqHubProcessing('api-url', 'fingerprint-visitor-id', 'merchant-id', 'session-id');

API

processing.getSession()

Use processing.getSession to get session information.

processing
  .getSession()
  .then(result => console.log(result))
  .catch(error => console.warn(error));

processing.submitForm(data)

Use processing.submitForm to submit transaction. When called, processing.submitForm will attempt to complete any required actions to process the transaction. This method returns promise which resolves with response ({ "type": "redirect", "redirectUrl": string}) or error that describes the failure.

processing
  .submitForm(data)
  .then(result => console.log(result))
  .catch(error => console.warn(error));

Usage

import { FinteqHubProcessing } from "@finteqhub/sdk-js";
import FingerprintJS from "@fingerprintjs/fingerprintjs";

const fp = await FingerprintJS.load();
const result = await fp.get();

const processing = new FinteqHubProcessing(apiUrl, result.visitorId, merchantId, sessionId);
const session = await processing.getSession();

const data = {/** collect data from form and session **/}

processing
  .submitForm(data)
  .then(result => console.log(result))
  .catch(error => console.warn(error));
0.7.1

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.3.0

3 years ago

0.5.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.5.2

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago