1.0.15 • Published 1 year ago

dineup-nodejs v1.0.15

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

DineUp Node.js Server Library

This library provides convenient access to the DineUp API for server-side applications.

Requires Node.js v16+

Installation

Install the package with:

npm install dineup-nodejs --save

Usage

This package requires a DineUp API key. If you are a partner with DineUp, contact us to get your API keys.

const dineup = require('dineup-nodejs')('sk_test_...');

dineup.createOrder({
  ...
})
  .then(order=> console.log(order))
  .catch(error=> console.error(error));

Or using ES modules and async/await

import DineUp from 'dineup-nodejs';
const dineup = new DineUp('sk_test_...');

const order = await dineup.createOrder({
  ...
})

console.log(order);

Typescript

This package includes TypeScript types

Documentation

createOrder(options: CreateOrderOptions): Promise<Order>

createOrder creates a new order for the specified airport, flight and customer.

CreateOrderOptions {
  airport_code: string        // IATA code
  customer_email: string
  customer_first_name: string
  customer_last_name: string
  type: "embed";              // Currently only embed order type is supported
  embed_view_style: "flat";   // Currently only flat view style is supported
  flight_date: Date
  flight_identifier: string   // flight designator or tail number
}

getOrder(id: string): Promise<Order>

confirmOrder(id: string): Promise<Order>

confirmOrder creates a submitted order and sets submitted_line_items from the cart_line_items

Types

Order {
  flight_identifier: string;
  id: string;
  client_secret: string;
  cart_line_items: LineItem[];
  submitted_line_items: LineItem[];
  state: OrderState;
}

LineItem {
  id: string;
  amount: number;
  image_url: string;
  name: string;
  product_id: string;
  quantity: number;
  special_request: string;
}

OrderState = {
  Created,
  Started,
  Captured,
  Paid,
  Delivered,
  Completed,
  Failed,
  Cancelled
};
1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago