1.0.21-alpha.19 • Published 2 years ago

@jerseydev/orca-loans v1.0.21-alpha.19

Weekly downloads
1
License
ISC
Repository
gitlab
Last release
2 years ago

Orca Loans NodeJS Client

Installation

Using npm:

$ npm install @jerseydev/orca-loans

Using yarn:

$ yarn add @jerseydev/orca-loans

Using CDN:

<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="https://storage.googleapis.com/orcaloans/assets/js/orcaloans.min.js"></script>

var OrcaLoans = orcaloans.default;

Import

// ES5
const OrcaLoans = require('@jerseydev/orca-loans');

// ES6
import OrcaLoans from "@jerseydev/orca-loans";

Examples

Initialization

OrcaLoans.init(process.env.ORCA_CLIENT_ID, process.env.ORCA_CLIENT_SECRET);

Authentication

const email = 'my@email.com';
const password = 'mypassword';

OrcaLoans.getTokens(email, password)
  .send()
  .then(authResult => {
    // set the tokens for requests that require authorization
    OrcaLoans.tokens = { accessToken: authResult.data.access_token, refreshToken: authResult.data.refresh_token };

}).catch(err => {
  
});

Cancel a request

const req = OrcaLoans.getBranches();
req.send().then(result => {
  const branches = result.data;
}).catch(err => {
  
});

req.cancel('cancelling request');

Invite an applicant

const applicantData = {
  firstName: 'John',
  lastName: 'Smith',
  email: "johnsmith@email.com",
  timezone: 'America/New_York' // US timezones only. See https://momentjs.com/timezone/docs/#/using-timezones/getting-country-zones/ for reference
};

OrcaLoans.inviteUser(applicantData).send().then(result => {
  const newUser = result.data;
}).catch(err => {

});

Find a loan officer by email

OrcaLoans.getLoanOfficerByEmail('my@loanofficer.com').send().then(result => {
  const loanOfficer = result.data;
}).catch(err => {
  
});

Create a loan application

const loanOfficer = {_id: ''}; // loan officer object
const applicant = {_id: ''}; // user object

const loanData = {
    borrowers: [{
      firstName: 'John',
      lastName: 'Smith',
      email: 'johnsmith@email.com'
    }],
    loanOfficer: loanOfficer._id, // uuid
    user: applicant._id // uuid
};

OrcaLoans.addLoanApplication(loanData).send().then(loanResult => {
                
}).catch(err => {
    
});

© 2021 Jersey Dev Inc. All rights reserved

1.0.21-alpha.19

2 years ago

1.0.21-alpha.10

2 years ago

1.0.21-alpha.11

2 years ago

1.0.21-alpha.12

2 years ago

1.0.21-alpha.13

2 years ago

1.0.21-alpha.14

2 years ago

1.0.21-alpha.15

2 years ago

1.0.21-alpha.16

2 years ago

1.0.21-alpha.17

2 years ago

1.0.21-alpha.18

2 years ago

1.0.21-alpha.6

3 years ago

1.0.21-alpha.5

3 years ago

1.0.21-alpha.8

3 years ago

1.0.21-alpha.7

3 years ago

1.0.21-alpha.9

3 years ago

1.0.21-alpha.4

3 years ago

1.0.21-alpha.3

3 years ago

1.0.21-alpha.2

3 years ago

1.0.21-alpha.1

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago