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

gocardless-api

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gocardless-api

Wrapper for GoCardless API v2

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Lightweight API wrapper for GoCardless. Uses [needle](https://www.npmjs.com/package/needle) under the hood.

Installation

npm install --save gocardless-api

Usage

Constructor

new GoCardless() => GoCardlessClient

Creates a new client instance using your GoCardless access token

const gocardless = new GoCardless(YOUR_ACCESS_TOKEN)

Client Methods

.request(options) => Promise(GoCardlessResource)

Makes an API request, then returns the resulting resource.

const gocardless = new GoCardless(YOUR_ACCESS_TOKEN)
gocardless.request({
    method: 'GET',
    resource: 'customers'
    query: {
        limit: 10
    }
})
.then(customers => {
    // customers => ...
})

The request will automatically add the following headers:

  • Authorization: Bearer <YOUR_ACCESS_TOKEN>
  • GoCardless-Version: 2015-07-06

You can override these headers using options.headers (see below)

request options Object:

method (String): HTTP request method. One of GET, PUT, PATCH or DELETE resource (String): Path to the requested resource (e.g. customers, mandates/123) data (Object): Data to accompany PUT or PATCH requests query (Object): Query string as key=>value pairs (e.g. { limit: 10 }) options (Object): Additional request options. Passed directly to [needle](https://www.npmjs.com/package/needle).

Keywords

FAQs

Package last updated on 28 Apr 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