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

ghost-payment-service

Package Overview
Dependencies
Maintainers
3
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.2.6 to 1.2.7

8

lib/authorizeNet/authorizeNetService.js

@@ -120,3 +120,3 @@ 'use strict';

.then(result => {
if (!result._original || result._original.errors) reject(this._buildChargeError(result._original.errors));
if (!result._original || result._original.errors) reject(AuthorizeNetService._buildChargeError(result._original.errors));
resolve(_.mapValues(result._original, (val) => _.head(val))); // auth net returns an object where each value is an array, map to normal object

@@ -181,5 +181,3 @@ })

return _.map(paymentProfiles, paymentProfile => {
console.log('paymentProfile', paymentProfile);
return {

@@ -226,3 +224,3 @@ customerPaymentProfileId: _.get(paymentProfile, 'customerPaymentProfileId', null),

.catch(err => {
if (moment(data.createdAt).add('2', 'days').isAfter(moment()) && err.message == 'The referenced transaction does not meet the criteria for issuing a credit.') {
if (moment(data.createdAt).add('2', 'days').isAfter(moment()) && err.message === 'The referenced transaction does not meet the criteria for issuing a credit.') {
return resolve(this._authorizeClient.voidTransaction(data.paymentId));

@@ -241,3 +239,3 @@ } else {

static _buildChargeError (errors) {
if (!Array.isArray(errors) || !errors.length || !errors[0].error[0].errorText) return 'Unable to complete transaction.';
if (!_.isArray(errors) || _.isEmpty(errors) || !errors[0].error[0].errorText) return 'Unable to complete transaction.';
return errors[0].error[0].errorText;

@@ -244,0 +242,0 @@ }

{
"name": "ghost-payment-service",
"version": "1.2.6",
"version": "1.2.7",
"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