0.1.29 • Published 7 months ago

@strivve/strivve-cx v0.1.29

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

Strivve CX

Varying levels of customizable Javascript Components which easily drop into desktop and mobile web applications as well as native applications as reqired.

Documentation

https://swch.github.io/Strivve-UX-Components/

Install via CDN

<script src="https://cdn.jsdelivr.net/npm/@strivve/strivve-cx"></script>

Usage

<body>
  <div id="account-link"></div>
</body>
<script src="https://cdn.jsdelivr.net/npm/@strivve/strivve-cx"></script>
<script>
  Strivve.mountLinkingJourney({
    element_id: 'account-link',
    api_instance: 'customer-dev',
    card: {
      pan: '4111111111111111',
      cvv: '321',
      expiration_month: '2',
      expiration_year: '24',
      name_on_card: 'Jane',
    },
  });
</script>

Install as package

npm install @strivve/strivve-cx

Usage

import Strivve from '@strivve/strivve-cx';

Strivve.mountLinkingJourney({
  element_id: 'account-link',
  api_instance: 'customer-dev',
  card: {
    pan: '4111111111111111',
    cvv: '321',
    expiration_month: '2',
    expiration_year: '24',
    name_on_card: 'Jane',
    address: {
      city: 'Seattle',
      postal_code: '98177',
      country: 'USA',
      first_name: 'Jane',
      last_name: 'Smith',
      email: 'jane@test.com',
      phone_number: '2065555555',
      address1: 'test',
      state: 'test',
      subnational: 'WA',
      is_primary: true,
    },
  },
});

Config

nameparamsdescription
element_idstringrequired
api_instancestringrequired
cardCardConfigoptional
card_idstringoptional
appearanceAppearanceoptional
localizationLocalizationoptional
grantstringoptional
select_sitemountSelectSiteViewOptionsoptional
account_linkmountAccountLinkViewOptionsoptional

Card

nameparamsdescription
panstringUnique Personal Account Reference number for this card, to be used for card lookup. Generated automatically from PAN, expiration date, and username if using the SDK.
cvvstring-
expiration_monthstring-
expiration_yearstring-
name_on_cardstring-
addressAddressrequired

Address

nameparamsdescription
citystringrequired
postal_codestringrequired
first_namestringrequired
last_namestringrequired
emailstringrequired
phone_numberstringrequired
address1stringrequired
address2stringoptional
statestringrequired
subnationalstringrequired
is_primarybooleanrequired
countrystringoptional
postal_otherstringoptional

Service, Core and Component

We can use parts of the functions and components.

const service = Strivve.createService({ api_instance: 'customer-dev' });

const core = Strivve.createCore({
  service,
  card: {
    pan: '4111111111111111',
    cvv: '321',
    expiration_month: '2',
    expiration_year: '24',
    name_on_card: 'Jane',
  },
});

const component = Strivve.createComponent({ core });

component.mountAccountLinkView('account-link', {
  site_id: '1',
});

component.mountSelectSiteView('select-sites', {
  submit: (selected) => {
    alert(selected.map((item) => item.name).join(', '));
  },
});
0.1.27

7 months ago

0.1.28

7 months ago

0.1.29

7 months ago

0.1.25

8 months ago

0.1.26

8 months ago

0.1.23

9 months ago

0.1.24

9 months ago

0.1.21

9 months ago

0.1.22

9 months ago

0.1.20

9 months ago

0.1.17

10 months ago

0.1.18

10 months ago

0.1.19

9 months ago

0.1.13

1 year ago

0.1.14

11 months ago

0.1.15

11 months ago

0.1.16

10 months ago

0.1.12

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago