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.3 to 1.1.4

config/default.json

17

lib/stripe/stripeService.js

@@ -200,4 +200,19 @@ 'use strict';

}
/**
* @param {object} data
* @param {string} data.cardId
* @param {string} data.customerId
* @return Promise
*/
setDefaultCard (data) {
return new Promise((resolve, reject) => {
this._stripe.customers.update(data.customerId, {default_source: data.cardId}, (err, customer) => {
if (err) reject(err);
else resolve(customer);
})
})
}
/**
* @param {StripeCustomer} data

@@ -204,0 +219,0 @@ * @return Promise

4

package.json
{
"name": "ghost-payment-service",
"version": "1.1.3",
"version": "1.1.4",
"description": "nodejs client to interact with the authorize.net & stripe apis",
"main": "index.js",
"scripts": {
"test": "mocha ./test --recursive"
"test": "NODE_ENV=test mocha ./test --recursive"
},

@@ -9,0 +9,0 @@ "repository": {

@@ -26,2 +26,4 @@ const Chai = require('chai');

.then(_customer_ => stripeSetup.setupCard({ customerId: _customer_.id }))
.then(() => stripeSetup.setupCard({ customerId: customer.id }))
.then(() => stripeSetup.setupCard({ customerId: customer.id }))
.tap(_card_ => card = _card_)

@@ -72,2 +74,10 @@ .then(_card_ => stripeSetup.setupToken())

});
it('should update a customer\'s default card', () => {
return service.setDefaultCard({ cardId: card.id, customerId: customer.id })
.then(customer => {
expect(customer).to.exist;
expect(customer.default_source).to.be.equal(card.id);
})
})
});

@@ -107,3 +117,3 @@

expect(_customer_).to.exist;
expect(_customer_.id).to.be.equal(_customer_.id);
expect(_customer_.id).to.be.equal(customer.id);
})

@@ -110,0 +120,0 @@ });

Sorry, the diff of this file is not supported yet

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