New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

trailpack-proxy-generics

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trailpack-proxy-generics

Generics - Trailpack for Proxy Engine

  • 0.0.17
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

trailpack-proxy-generics

NPM version Build status Dependency Status Code Climate

Generic features that require adapters built with love from Cali-Style

Looking for Proxy Engine?

Generics are common features that every web application needs but implements differently. The result of a Generic is a normalized way of handling these different services. For example: Email Provider, Payment Processors, Tax Provider, Shipping Provider, Fulfillment, Geolocation, whatever you need!

Can you think of a generic we missed? Create a PR!

Install

$ npm install --save trailpack-proxy-generics

Configure

// config/main.js
module.exports = {
  packs: [
    // ... other trailpacks
    require('trailpack-proxy-generics')
  ]
}
// config/proxyGenerics.js
module.exports = {
  // ... any generic
  payment_processor: {
      adapter: require('<adpater>'),
      options: {
          whatever_key: '<what ever you need here>'
      }
  }
}

Usage

Many different modules in Proxy Engine will rely on a generic to complete a task. Generics are easy to create and use.

Validation

Every Generic call is validated twice:

  • When data is passed to the generic.
  • When there is a successful response from the generic.

This allows for generics to stay consistent with their requests and responses.

Currently Supported Generics

Email Provider

The Email Provider handles sending emails from different email providers eg. Mandrill, MailGun

EmailGenericService.send

Sends an Email

EmailGenericService.sendTemplate

Sends an Email Template

Creating an Email Provider Generic
Supported Email Providers

Geolocation Provider

The Geolocation Provider handles resolving geography

GeolocationGenericService.locate

Resolves the geolocation of an address, validates an address, normalizes an address.

Creating a Geolocation Provider Generic
Supported Geolocation Providers

Payment Processor

The Payment Processor handles payments from different merchant processors/terminals eg. Stripe, Authorize.net.

PaymentGenericService.authorize

Authorizes a purchase

PaymentGenericService.capture

Captures an authorized purchase

PaymentGenericService.sale

Authorizes and captures a purchase

PaymentGenericService.void

Voids an authorized purchase

PaymentGenericService.refund

Partially Refunds/Refunds a purchase

Creating a Payment Processor Generic
Supported Payment Processors

Tax Provider

The Tax Provider handles sales tax for items sold from different tax providers eg. TaxBundle

TaxGenericService.getRate

Gets the tax rate for a purchase.

Creating a Tax Provider Generic
Supported Tax Providers

Shipping Provider (TODO)

The Shipping Provider handles shipping rates from a location to a destination from different shipping providers eg. Shipstation, USPS, FedEx, UPS

ShippingGenericService.getRate

Gets a single carrier rate.

ShippingGenericService.getRates

Gets all carrier rates

Creating a Shipping Provider Generic
Supported Shipping Providers

Fulfillment Provider (TODO)

The Fulfillment Provider handles fulfillment events from a location to a destination from different fulfillment providers eg. Shipstation

FulfillmentGenericService.createOrder

Creates an order in fulfillment

FulfillmentGenericService.createOrders

Creates multiple orders in fulfillment

FulfillmentGenericService.updateOrder

Updates an order in fulfillment

FulfillmentGenericService.updateOrders

Updates multiple orders in fulfillment

FulfillmentGenericService.destroyOrder

Destroys an order in fulfillment

FulfillmentGenericService.destroyOrders

Destroys multiple orders in fulfillment

FulfillmentGenericService.getOrder

Retrieves an order in fulfillment

FulfillmentGenericService.getOrders

Retrieves multiple orders in fulfillment

FulfillmentGenericService.holdOrder

Creates an order hold in fulfillment

FulfillmentGenericService.holdOrders

Creates multiple order holds in fulfillment

Creating a Fulfillment Provider Generic
Supported Fulfillment Providers

Data Store Provider

The Data Store provider handles uploads and downloads to a remote data store eg. AWS, Gcloud

DataStoreGenericService.upload

Uploads a buffer to a data store

DataStoreGenericService.uploadFile

Uploads a file to a data store

DataStoreGenericService.uploadFiles

Uploads files to a data store

Creating a Data Store Provider Plugin
Supported Data Store Providers

Keywords

FAQs

Package last updated on 31 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc