0.11.1 โ€ข Published 9 months ago

@belvo/payments-atoms v0.11.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Belvo Payments Atoms

Library of native web components and utilities that aims to facilitate integrating with Belvo's Payments products.

Visit the documentation for more detailed instructions or Storybook if you want to play around with the web components.

๐Ÿ“™ Examples

React

Next.js

Biometric PIX Playground

๐Ÿš€ Getting started

Installation

npm install @belvo/payments-atoms

Web components initialization

Add a default import from @belvo/payments-atoms and call its init function with a callback so you're able to retrieve the selected payer institution. For example:

import BelvoPaymentsAtoms from '@belvo/payments-atoms'

BelvoPaymentsAtoms.init({
  bankShortcuts: {
    // This callback is executed when the user selects a bank.
    // It returns the payer institution, containing its id, display_name and icon_logo.
    callback: (payerInstitution) => setPayerInstitutionId(payerInstitution.id),
  },
})

Usage Example

Once initialized, simply add the desired web component wherever you wish in your web application.

<belvo-payments-grid />

Biometric PIX

import { biometricPix } from '@belvo/payments-atoms'

biometricPix.collectEnrollmentInformation(accountTenure)
biometricPix.requestEnrollmentConfirmation(biometricRegistrationRequest)
biometricPix.requestPaymentAuthorization(biometricPaymentRequest)

๐Ÿ‡น๐Ÿ‡ธ TypeScript

Belvo Payments Atoms has TypeScript support and provides a set of types that you can import into your project. We export them by default and you are able to import them as named imports like:

import type { Callback, Country, Institution, BiometricRegistrationRequest } from '@belvo/payments-atoms'

:busts_in_silhouette: Contributing

If you wish to submit a pull request, please be sure check the items on this list:

Setting up the project

  1. Fork the repository and clone it.
  2. Install the dependencies on the repository:

    npm install
  3. Start storybook:

    npm run storybook

Setting up the docs

Make sure you have the latest Ruby version installed.

  1. Open up your terminal and install the bundler gem on version 2.4.22:

    gem install bundler -v 2.4.22
  2. Go to the docs folder and install the dependencies:

    bundle install
  3. Run bundle exec jekyll serve to serve the docs locally.

๐Ÿงช Automated testing

Unit tests

Once you have all the dependencies installed, execute the following command to run unit tests:

npm run test

Or run the following if you want them to run with coverage:

npm run coverage

Lint and Prettier

VSCode settings

#.vscode/settings.json

{
  "editor.formatOnSave": true,
  "prettier.requireConfig": true,
  "vetur.validation.template": false,
  "eslint.format.enable": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}
0.4.9

11 months ago

0.4.8

11 months ago

0.2.13

12 months ago

0.2.12

12 months ago

0.2.11

12 months ago

0.2.10

12 months ago

0.3.0

12 months ago

0.3.2

12 months ago

0.3.1

12 months ago

0.7.0

10 months ago

0.3.3

12 months ago

0.10.1

9 months ago

0.4.10

11 months ago

0.1.20

1 year ago

0.1.21

1 year ago

0.1.22

1 year ago

0.1.23

1 year ago

0.1.24

1 year ago

0.10.0

9 months ago

0.4.13

11 months ago

0.4.11

11 months ago

0.4.12

11 months ago

0.8.1

10 months ago

0.4.5

11 months ago

0.8.0

10 months ago

0.4.4

11 months ago

0.4.7

11 months ago

0.4.6

11 months ago

0.1.19

1 year ago

0.4.1

11 months ago

0.4.0

11 months ago

0.4.3

11 months ago

0.4.2

11 months ago

0.11.0

9 months ago

0.11.1

9 months ago

0.9.0

9 months ago

0.9.1

9 months ago

0.5.0

11 months ago

0.5.1

11 months ago

0.2.1

12 months ago

0.2.0

1 year ago

0.2.7

12 months ago

0.2.6

12 months ago

0.2.9

12 months ago

0.2.8

12 months ago

0.2.3

12 months ago

0.2.2

12 months ago

0.2.5

12 months ago

0.6.0

10 months ago

0.2.4

12 months ago

0.1.10

1 year ago

0.1.11

1 year ago

0.1.12

1 year ago

0.1.13

1 year ago

0.1.14

1 year ago

0.1.15

1 year ago

0.1.2

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.16

1 year ago

0.1.17

1 year ago

0.1.18

1 year ago

0.1.0

1 year ago

0.1.1

1 year ago

0.0.56

2 years ago

0.0.55

2 years ago

0.0.54

2 years ago

0.0.51

2 years ago

0.0.52

2 years ago

0.0.53

2 years ago

0.0.50

2 years ago

0.0.49

2 years ago

0.0.48

2 years ago

0.0.47

2 years ago

0.0.46

2 years ago

0.0.40

2 years ago

0.0.41

2 years ago

0.0.42

2 years ago

0.0.43

2 years ago

0.0.44

2 years ago

0.0.45

2 years ago

0.0.39

2 years ago

0.0.37

2 years ago

0.0.38

2 years ago

0.0.36

2 years ago

0.0.32

2 years ago

0.0.33

2 years ago

0.0.34

2 years ago

0.0.35

2 years ago

0.0.31

2 years ago

0.0.30

2 years ago

0.0.29

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.25

2 years ago

0.0.26

2 years ago

0.0.27

2 years ago

0.0.28

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago