0.0.23 • Published 3 months ago

@embedded-banking-fundr/rabobank-invoice-finance-uat v0.0.23

Weekly downloads
-
License
-
Repository
-
Last release
3 months ago

Rabobank Invoice Finance Component

Install

To incorporate the Rabobank Invoice Finance component into your project, install it using npm or yarn:

NPM

npm i @embedded-banking-fundr/rabobank-invoice-finance@stable

Attributes/Properties

Use these attributes and properties to identify the partner and pre-fill information into the widget:

JSON PathAttribute/PropertyDescriptionTypeExample
partner-idpartner-idIdentifier for the partner widget.String"DLS_Widget"
kvk-numberkvk-numberKVK number for the company.String"33236408"
campaigncampaignCampaign name.(discussed with marketing)String
contact-detailscontact-detailsContact person's details.String (JSON)"John"
contact-details.nameContact person's name.String"John"
contact-details.phoneContact person's phone number.String"123-456-7890"
contact-details.emailContact person's email address.String"johndoe@example.com"
contact-details.surnameContact person's surname.String"Doe"
invoicesinvoicesList of invoices.Array (JSON)
invoices[0].invoiceIdID of the invoice.Array (JSON)"INV123456"
invoices[0].invoiceAmountInvoice amount.String"1000.00"
invoices[0].issuerDateDate the invoice was issued.String"2023-09-13"
invoices[0].deadlineDateDeadline date for invoice payment.String"2023-10-13"
invoices[0].debtorNameName of the debtor.String"John Doe"
invoices[0].debtorKvkKVK number of the debtor.String"42136408"
invoiceDocumentsinvoiceDocumentsThe invoiceString (JSON)
invoiceDocuments.filenameThe file nameString"invoice.pdf"
invoiceDocuments.dataUrlThe invoice as a base64 data urlString'data:application/pdf;base64,JV...

Usage in Different Frameworks

REACT

import React from 'react';
import { authenticateRaboWidget } from '@embedded-banking-fundr/rabobank-invoice-finance/lib';

authenticateRaboWidget('API_KEY');

const InvoiceFinanceWrapper = ({ kvkNumber, contactDetails, invoices, invoiceDocuments }) => {
  const partnerId = 'partnerId';
  return (
    <div>
      <invoice-finance
        partner-id={partnerId}
        kvk-number={kvkNumber}
        contact-details={contactDetails}
        invoices={invoices}
        invoice-documents={invoiceDocuments}
      ></invoice-finance>
    </div>
  );
};

export default InvoiceFinanceWrapper;

ANGULAR

Update your app.module.ts to include "CUSTOM_ELEMENTS_SCHEMA":

import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
...

@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule
    ],
    providers: [],
    bootstrap: [AppComponent],
    schemas:[CUSTOM_ELEMENTS_SCHEMA]
})

Then, define your component:

import { Component, ElementRef, Input, ViewChild } from '@angular/core';
import { authenticateRaboWidget } from '@embedded-banking-fundr/rabobank-invoice-finance/lib';

@Component({
  selector: 'app-invoice-finance-wrapper',
  template:
    '<invoice-finance #invoiceFinance partner-id="{{partnerId}}" kvk-number="{{kvkNumber}}" campaign="{{campaign}}" contact-details="{{contactDetails}}" invoices="{{invoices}}" invoice-documents="{{invoiceDocuments}}"></invoice-finance>',
})
export class InvoiceFinanceWrapperComponent {
  @ViewChild('invoice-finance') invoiceFinance: ElementRef | undefined;
  constructor() {
    authenticateRaboWidget('apiKey');
  }
  partnerId: string = 'partnerId';
  @Input() kvkNumber: string | undefined;
  @Input() campaign: string | undefined;
  @Input() contactDetails: string | undefined;
  @Input() invoices: string | undefined;
  @Input() invoiceDocuments: string | undefined;
}

VUE

Coming soon.

Styling

Adjust the component's appearance through CSS variables:

<style>
  invoice-finance {
    --rabobank-color-primary: #123456;
    --rabobank-color-secondary: #abcdef;
    --rabobank-svg-primary: #123456;
    --rabobank-svg-primary-light: rgba(18, 52, 86, 0.69);
    --rabobank-svg-secondary: #abcdef;
  }
</style>

Event Handling

The component emits several events that you can subscribe to for notifications about various interactions and states. Below is a list of events with their descriptions:

Subscribing to Events

To react to these events, you can subscribe to them anywhere in your application using the subscribeToEvent function. Here's how you can subscribe and handle an event:

import { subscribeToEvent } from '@embedded-banking-fundr/rabobank-invoice-finance/lib';

// Example: Subscribing to the 'started' event
const subscription = subscribeToEvent('started', (data) => {
  console.log('Invoice finance process started', data);
});

// Remember to unsubscribe when you're done listening to the event
subscription.unsubscribe();

Available Events and Data

Event NameDescriptionData
startedEmitted when user starts the journey.{ partnerId, caseId }
abandonEmitted when a user abandons the invoice process, or on time out{ partnerId, caseId, invoiceId? }
concludedEmitted when the invoice finance process is completed and the user closes the widget.{ partnerId, caseId, invoiceId? }
exitEmitted after both abandon and concluded.{ partnerId, caseId, invoiceId? }

This event handling system allows you to monitor and react to various states and interactions within the invoice finance process.

0.0.159

3 months ago

0.0.157

3 months ago

0.0.156

3 months ago

0.0.159-next.0

3 months ago

0.0.160

3 months ago

0.0.156-next.0

3 months ago

0.0.153

3 months ago

0.0.152

3 months ago

0.0.151

3 months ago

0.0.144-next.0

3 months ago

0.0.65

3 months ago

0.0.148

3 months ago

0.0.147

3 months ago

0.0.142

3 months ago

0.0.141

3 months ago

0.0.146

3 months ago

0.0.144

3 months ago

0.0.143

3 months ago

0.0.63

3 months ago

0.0.64

3 months ago

0.0.60

3 months ago

0.0.61

3 months ago

0.0.54

3 months ago

0.0.55

3 months ago

0.0.56

3 months ago

0.0.57

3 months ago

0.0.59-next.0

3 months ago

0.0.40

3 months ago

0.0.41

3 months ago

0.0.42

3 months ago

0.0.43

3 months ago

0.0.44

3 months ago

0.0.45

3 months ago

0.0.46

3 months ago

0.0.47

3 months ago

0.0.37

3 months ago

0.0.38

3 months ago

0.0.39

3 months ago

0.0.30

3 months ago

0.0.31

3 months ago

0.0.32

3 months ago

0.0.33

3 months ago

0.0.34

3 months ago

0.0.35

3 months ago

0.0.36

3 months ago

0.0.26

3 months ago

0.0.27

3 months ago

0.0.28

3 months ago

0.0.51

3 months ago

0.0.52

3 months ago

0.0.53

3 months ago

0.0.50

3 months ago

0.0.30-next.0

3 months ago

0.0.48

3 months ago

0.0.49

3 months ago

0.0.24

3 months ago

0.0.25

3 months ago

0.0.23

8 months ago

0.0.22

8 months ago

0.0.21

8 months ago

0.0.20

8 months ago

0.0.19

8 months ago

0.0.18

8 months ago

0.0.17

8 months ago

0.0.16

8 months ago

0.0.15

8 months ago

0.0.14

8 months ago

0.0.13

8 months ago

0.0.12

8 months ago

0.0.11

9 months ago

0.0.10

9 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.1

10 months ago