Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chargehound

Package Overview
Dependencies
Maintainers
4
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chargehound

Automatically fight disputes

  • 6.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
190
increased by128.92%
Maintainers
4
Weekly downloads
 
Created
Source

Chargehound node.js bindings

Build Status npm version

Installation

npm install chargehound

Usage

Every resource is accessed via the chargehound instance:

var chargehound = require('chargehound')('{ YOUR_API_KEY }');

Requests

Every resource method accepts an optional callback as the last argument:

chargehound.Disputes.submit('dp_123', {fields: {customer_name: 'Susie'}},
  function (err, dispute) {
    err; // null if no error occurred
    dispute; // the submitted dispute object
  }
);

Additionally, every resource method returns a promise, so you don't have to use the regular callback. E.g.

chargehound.Disputes.submit('dp_123', {fields: {customer_name: 'Susie'}})
  .then(function (dispute) {
    // Success
  .catch(function (err) {
    // Deal with an error
  });

Responses

Responses from the API are automatically parsed from JSON and returned as JavaScript objects.

Responses also include the HTTP status code on the response object as the status field.

chargehound.Disputes.retrieve('dp_123').then(dispute => {
  console.log(dispute.state)
  // 'needs_response'
  console.log(dispute.response.status)
  // 200
});

Documentation

Disputes

Errors

Development

To build and install from the latest source:

$ git clone git@github.com:chargehound/chargehound-node.git
$ npm install

The source code is written in ES6. For development you will need Node.js >= v8.

Run the tests using npm:

$ npm test

Deployment

To deploy a new version of the SDK, perform the following steps:

  1. Update the CHANGELOG to describe what feature have been added.
  2. Bump the version number in package.json
  3. Rebuild and deploy the package with: npm publish
  4. Confirm the new package version is available at https://www.npmjs.com/package/chargehound

Keywords

FAQs

Package last updated on 05 Oct 2023

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