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

trailpack-proxy-generics

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trailpack-proxy-generics - npm Package Compare versions

Comparing version 0.0.32 to 0.0.33

lib/schemas/paymentProvider/removeCustomerSource.js

17

api/services/PaymentGenericService.js

@@ -220,3 +220,20 @@ 'use strict'

}
/**
*
* @param source
* @param adapter
* @returns {*|Promise.<TResult>}
*/
removeCustomerSource(source, adapter){
return lib.Validator.validatePaymentProvider.removeCustomerSource(source)
.then(values => {
adapter = this._init(adapter)
return adapter.removeCustomerSource(source)
.then(source => {
return lib.Validator.validatePaymentProvider.removeCustomerSourceSuccess(source)
})
})
}
}

2

lib/schemas/paymentProvider/index.js

@@ -25,1 +25,3 @@ exports.authorize = require('./authorize')

exports.updateCustomerSourceSuccess = require('./updateCustomerSourceSuccess')
exports.removeCustomerSource = require('./removeCustomerSource')
exports.removeCustomerSourceSuccess = require('./removeCustomerSourceSuccess')

@@ -344,2 +344,22 @@ 'use sticy'

},
removeCustomerSource: (config) => {
return new Promise((resolve, reject) => {
joi.validate(config, lib.Schemas.paymentProvider.removeCustomerSource, (err, value) => {
if (err) {
return reject(new Errors.ValidationError(err))
}
return resolve(value)
})
})
},
removeCustomerSourceSuccess: (config) => {
return new Promise((resolve, reject) => {
joi.validate(config, lib.Schemas.paymentProvider.removeCustomerSourceSuccess, (err, value) => {
if (err) {
return reject(new Errors.ValidationError(err))
}
return resolve(value)
})
})
},
void: (config) => {

@@ -346,0 +366,0 @@ return new Promise((resolve, reject) => {

2

package.json
{
"name": "trailpack-proxy-generics",
"version": "0.0.32",
"version": "0.0.33",
"description": "Generics - Trailpack for Proxy Engine",

@@ -5,0 +5,0 @@ "homepage": "https://cali-style.com",

@@ -133,2 +133,13 @@ 'use strict'

}
removeCustomerSource(source) {
const res = {
gateway: 'payment_processor',
account_foreign_id: source.account_foreign_id,
account_foreign_key: 'customer',
foreign_key: 'source',
foreign_id: source.foreign_id,
payment_details: source
}
return Promise.resolve(res)
}
}

@@ -138,2 +138,15 @@ 'use strict'

})
it('should remove customer source', (done) => {
PaymentGenericService.removeCustomerSource({
account_foreign_id: 1,
foreign_id: 1
})
.then(source => {
done()
})
.catch(err => {
done(err)
})
})
})
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