@embedded-banking-fundr/rabobank-invoice-finance-uat v0.0.23
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 Path | Attribute/Property | Description | Type | Example |
---|---|---|---|---|
partner-id | partner-id | Identifier for the partner widget. | String | "DLS_Widget" |
kvk-number | kvk-number | KVK number for the company. | String | "33236408" |
campaign | campaign | Campaign name.(discussed with marketing) | String | |
contact-details | contact-details | Contact person's details. | String (JSON) | "John" |
contact-details.name | Contact person's name. | String | "John" | |
contact-details.phone | Contact person's phone number. | String | "123-456-7890" | |
contact-details.email | Contact person's email address. | String | "johndoe@example.com" | |
contact-details.surname | Contact person's surname. | String | "Doe" | |
invoices | invoices | List of invoices. | Array (JSON) | |
invoices[0].invoiceId | ID of the invoice. | Array (JSON) | "INV123456" | |
invoices[0].invoiceAmount | Invoice amount. | String | "1000.00" | |
invoices[0].issuerDate | Date the invoice was issued. | String | "2023-09-13" | |
invoices[0].deadlineDate | Deadline date for invoice payment. | String | "2023-10-13" | |
invoices[0].debtorName | Name of the debtor. | String | "John Doe" | |
invoices[0].debtorKvk | KVK number of the debtor. | String | "42136408" | |
invoiceDocuments | invoiceDocuments | The invoice | String (JSON) | |
invoiceDocuments.filename | The file name | String | "invoice.pdf" | |
invoiceDocuments.dataUrl | The invoice as a base64 data url | String | '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 Name | Description | Data |
---|---|---|
started | Emitted when user starts the journey. | { partnerId, caseId } |
abandon | Emitted when a user abandons the invoice process, or on time out | { partnerId, caseId, invoiceId? } |
concluded | Emitted when the invoice finance process is completed and the user closes the widget. | { partnerId, caseId, invoiceId? } |
exit | Emitted 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.
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago