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

ghost-payment-service

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ghost-payment-service - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

78

lib/stripe/stripeService.js

@@ -28,32 +28,3 @@ 'use strict';

* @param {object} data
* @param {string} data.cardId
* @param {string} data.customerId
* @return Promise
*/
deleteCard (data) {
return new Promise((resolve, reject) => {
this._stripe.customers.deleteCard(data.customerId, data.cardId, (err, confirmation) => {
if (err) reject(err);
else resolve(confirmation);
})
})
}
/**
* @param {object} data
* @param {string} data.customerId
* @return Promise
*/
deleteCustomer (data) {
return new Promise((resolve, reject) => {
this._stripe.customers.del(data.customerId, (err, confirmation) => {
if (err) reject(err);
else resolve(confirmation);
})
})
}
/**
* @param {object} data
* @param {string} data.customerId
* @param {object} data.card

@@ -102,2 +73,14 @@ * @param {string} data.card.number

* @param {object} data
*/
createCustomer (data) {
return new Promise((resolve, reject) => {
this._stripe.customers.create(data, (err, customer) => {
if (err) reject(err);
else resolve(customer)
})
})
}
/**
* @param {object} data
* @param {int} data.amount

@@ -120,9 +103,11 @@ * @param {string} data.interval

}
/**
* @param {object} data
* @param {string} data.customerId
* @param {string} data.planId
*/
createCustomer (data) {
createSubscription (data) {
return new Promise((resolve, reject) => {
this._stripe.customers.create(data, (err, customer) => {
return this._stripe.customers.update(data.customerId, { plan: data.planId }, (err, customer) => {
if (err) reject(err);

@@ -136,2 +121,31 @@ else resolve(customer)

* @param {object} data
* @param {string} data.cardId
* @param {string} data.customerId
* @return Promise
*/
deleteCard (data) {
return new Promise((resolve, reject) => {
this._stripe.customers.deleteCard(data.customerId, data.cardId, (err, confirmation) => {
if (err) reject(err);
else resolve(confirmation);
})
})
}
/**
* @param {object} data
* @param {string} data.customerId
* @return Promise
*/
deleteCustomer (data) {
return new Promise((resolve, reject) => {
this._stripe.customers.del(data.customerId, (err, confirmation) => {
if (err) reject(err);
else resolve(confirmation);
})
})
}
/**
* @param {object} data
* @param {int} data.limit

@@ -138,0 +152,0 @@ */

{
"name": "ghost-payment-service",
"version": "1.1.2",
"version": "1.1.3",
"description": "nodejs client to interact with the authorize.net & stripe apis",

@@ -5,0 +5,0 @@ "main": "index.js",

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