trailpack-proxy-generics
Advanced tools
Comparing version 0.0.26 to 0.0.27
@@ -5,4 +5,6 @@ 'use strict' | ||
module.exports = joi.object().keys({ | ||
account_foreign_key: joi.any(), | ||
account_foreign_id: joi.any(), | ||
foreign_key: joi.any(), | ||
foreign_id: joi.any().required(), | ||
}).unknown() |
@@ -6,2 +6,4 @@ 'use strict' | ||
gateway: joi.string().required(), | ||
account_foreign_key: joi.any(), | ||
account_foreign_id: joi.any(), | ||
foreign_key: joi.any().required(), | ||
@@ -8,0 +10,0 @@ foreign_id: joi.any().required(), |
@@ -6,3 +6,5 @@ 'use strict' | ||
account_foreign_id: joi.any().required(), | ||
account_foreign_key: joi.any(), | ||
foreign_id: joi.any().required(), | ||
foreign_key: joi.any() | ||
}).unknown() |
@@ -6,5 +6,7 @@ 'use strict' | ||
gateway: joi.string(), | ||
account_foreign_key: joi.any(), | ||
account_foreign_id: joi.any(), | ||
foreign_key: joi.any(), | ||
foreign_id: joi.any(), | ||
foreign_id: joi.any().required(), | ||
data: joi.object() | ||
}).unknown() |
@@ -6,2 +6,4 @@ 'use strict' | ||
gateway: joi.string(), | ||
account_foreign_key: joi.any(), | ||
account_foreign_id: joi.any(), | ||
foreign_key: joi.any(), | ||
@@ -8,0 +10,0 @@ foreign_id: joi.any(), |
{ | ||
"name": "trailpack-proxy-generics", | ||
"version": "0.0.26", | ||
"version": "0.0.27", | ||
"description": "Generics - Trailpack for Proxy Engine", | ||
@@ -5,0 +5,0 @@ "homepage": "https://cali-style.com", |
@@ -55,3 +55,5 @@ 'use strict' | ||
const res = { | ||
gateway: 'default', | ||
gateway: 'payment_processor', | ||
foreign_key: 'customer', | ||
foreign_id: customer.id, | ||
data: customer | ||
@@ -62,10 +64,52 @@ } | ||
createCustomerSource(source) { | ||
return Promise.resolve(source) | ||
const res = { | ||
gateway: 'payment_processor', | ||
account_foreign_key: source.account_foreign_key, | ||
account_foreign_id: source.account_foreign_id, | ||
foreign_key: 'customer', | ||
foreign_id: source.id, | ||
data: source | ||
} | ||
return Promise.resolve(res) | ||
} | ||
findCustomer(customer) { | ||
const res = { | ||
gateway: 'payment_processor', | ||
foreign_key: 'customer', | ||
foreign_id: customer.id, | ||
data: customer | ||
} | ||
return Promise.resolve(res) | ||
} | ||
findCustomerSource(source) { | ||
const res = { | ||
gateway: 'payment_processor', | ||
account_foreign_key: source.account_foreign_key, | ||
account_foreign_id: source.account_foreign_id, | ||
foreign_key: 'customer', | ||
foreign_id: source.id, | ||
data: source | ||
} | ||
return Promise.resolve(res) | ||
} | ||
updateCustomer(customer) { | ||
return Promise.resolve(customer) | ||
const res = { | ||
gateway: 'payment_processor', | ||
foreign_key: 'customer', | ||
foreign_id: customer.id, | ||
data: customer | ||
} | ||
return Promise.resolve(res) | ||
} | ||
updateCustomerSource(source) { | ||
return Promise.resolve(source) | ||
const res = { | ||
gateway: 'payment_processor', | ||
account_foreign_key: source.account_foreign_key, | ||
account_foreign_id: source.account_foreign_id, | ||
foreign_key: 'source', | ||
foreign_id: source.foreign_id, | ||
data: source | ||
} | ||
return Promise.resolve(res) | ||
} | ||
} |
@@ -91,3 +91,4 @@ 'use strict' | ||
PaymentGenericService.updateCustomer({ | ||
email: 'scott@awesome.com' | ||
email: 'scott@awesome.com', | ||
foreign_id: 1 | ||
}) | ||
@@ -104,3 +105,4 @@ .then(customer => { | ||
PaymentGenericService.createCustomerSource({ | ||
id: 1 | ||
account_foreign_id: 1, | ||
token: 1 | ||
}) | ||
@@ -117,3 +119,4 @@ .then(source => { | ||
PaymentGenericService.updateCustomerSource({ | ||
id: 1 | ||
account_foreign_id: 1, | ||
foreign_id: 1 | ||
}) | ||
@@ -120,0 +123,0 @@ .then(source => { |
88614
2829