1.0.21-alpha.19 • Published 4 years ago

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

Weekly downloads
1
License
ISC
Repository
gitlab
Last release
4 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

4 years ago

1.0.21-alpha.10

4 years ago

1.0.21-alpha.11

4 years ago

1.0.21-alpha.12

4 years ago

1.0.21-alpha.13

4 years ago

1.0.21-alpha.14

4 years ago

1.0.21-alpha.15

4 years ago

1.0.21-alpha.16

4 years ago

1.0.21-alpha.17

4 years ago

1.0.21-alpha.18

4 years ago

1.0.21-alpha.6

4 years ago

1.0.21-alpha.5

4 years ago

1.0.21-alpha.8

4 years ago

1.0.21-alpha.7

4 years ago

1.0.21-alpha.9

4 years ago

1.0.21-alpha.4

4 years ago

1.0.21-alpha.3

4 years ago

1.0.21-alpha.2

4 years ago

1.0.21-alpha.1

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago