paystack-node
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -0,1 +1,7 @@ | ||
<a name="0.2.4"></a> | ||
# 0.2.4 (2020-02-25) | ||
### Bug Fixes | ||
- Fixed outdated endpoints by [@navicstein](https://github.com/navicstein) | ||
<a name="0.2.3"></a> | ||
@@ -2,0 +8,0 @@ # 0.2.3 (2020-02-04) |
@@ -5,3 +5,3 @@ 'use strict' | ||
PayStack.prototype.version = '0.2.1' | ||
PayStack.prototype.version = '0.2.4' | ||
@@ -8,0 +8,0 @@ const Fees = function (cap, additionalCharge, percentage, threshold) { |
{ | ||
"name": "paystack-node", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "A NodeJS wrapper for the Paystack API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -250,2 +250,3 @@ # Paystack | ||
- paystack.verifyTransaction() | ||
- paystack.partialDebit() | ||
- plans | ||
@@ -252,0 +253,0 @@ - paystack.createPlan() |
@@ -12,3 +12,3 @@ 'use strict' | ||
send_json: true, | ||
params: { first_name: String, last_name: String, email$: String, phone: String }, | ||
params: { first_name: String, last_name: String, email$: String, phone: String, metadata: Object }, | ||
route_params: null | ||
@@ -23,6 +23,7 @@ }, | ||
method: 'GET', | ||
path: '/customer/{:customer_id}', | ||
alternate_route_params_keymap: { email_or_id_or_customer_code: 'customer_id' }, | ||
path: '/customer/{:email_or_id_or_customer_code}', | ||
send_json: false, | ||
params: null, | ||
route_params: { customer_id: String } | ||
route_params: { email_or_id_or_customer_code: String } | ||
}, | ||
@@ -44,10 +45,11 @@ | ||
Update customer | ||
@params: customer_id, first_name, last_name, email (required), phone | ||
@params: id_or_customer_code, first_name, last_name, email (required), phone | ||
*/ | ||
updateCustomer: { | ||
method: 'PUT', | ||
path: '/customer/{:customer_id}', | ||
alternate_route_params_keymap: { id_or_customer_code: 'customer_id' }, | ||
path: '/customer/{:id_or_customer_code}', | ||
send_json: true, | ||
params: { first_name: String, last_name: String, email$: String, phone: String }, | ||
route_params: { customer_id: String } | ||
params: { first_name: String, last_name: String, email$: String, phone: String, metadata: Object }, | ||
route_params: { id_or_customer_code: String } | ||
}, | ||
@@ -69,3 +71,3 @@ | ||
White/Blacklist Customer | ||
@params: customer_id (required), risk_action | ||
@params: customer (required), risk_action | ||
@@ -78,3 +80,3 @@ @info: [ 'allow' to whitelist or 'deny' to blacklist ] | ||
send_json: true, | ||
params: { customer_id$: String, risk_action: String }, | ||
params: { customer$: String, risk_action: String }, | ||
param_defaults: { risk_action: 'allow' }, | ||
@@ -81,0 +83,0 @@ route_params: null |
@@ -6,3 +6,3 @@ 'use strict' | ||
Initialize Transaction | ||
@params: reference, callback_url, amount, email, plan, invoice_limit | ||
@params: reference, callback_url, amount, email, plan, subaccount, transaction_charge, bearer, channels, invoice_limit, metadata | ||
*/ | ||
@@ -13,4 +13,4 @@ initializeTransaction: { | ||
send_json: true, | ||
params: { reference: String, callback_url: String, amount$: Number, email$: String, plan: String, invoice_limit: Number, metadata: String }, | ||
param_defaults: { invoice_limit: 0 }, | ||
params: { reference: String, callback_url: String, amount$: Number, email$: String, plan: String, subaccount: String, transaction_charge: Number, bearer: String, channels: Array, invoice_limit: Number, metadata: String }, | ||
param_defaults: { invoice_limit: 0, bearer: 'account' }, | ||
route_params: null | ||
@@ -41,3 +41,3 @@ }, | ||
params: { perPage: Number, page: Number, customer: Number, status: String, from: Date, to: Date, amount: Number }, | ||
param_defaults: { perPage: 50, page: 1, customer: 0, amount: 0 }, | ||
param_defaults: { perPage: 50, page: 1 }, | ||
route_params: null | ||
@@ -61,3 +61,3 @@ }, | ||
Charge Authorization | ||
@params: reference, authorization_code, amount, plan, currency, email, metadata, subaccount, transaction_charge, bearer, invoice_limit, queue | ||
@params: reference, authorization_code, amount, plan, currency, email, metadata, subaccount, transaction_charge, bearer, invoice_limit | ||
*/ | ||
@@ -68,4 +68,4 @@ chargeAuthorization: { | ||
send_json: true, | ||
params: { reference: String, authorization_code$: String, amount$: Number, plan: String, currency: String, email$: String, metadata: Object, subaccount: String, transaction_charge: Number, bearer: String, invoice_limit: Number, queue: Boolean }, | ||
param_defaults: { amount: 0, currency: 'NGN', transaction_charge: 0, bearer: 'account', invoice_limit: 0 }, | ||
params: { reference: String, authorization_code$: String, amount$: Number, plan: String, currency: String, email$: String, metadata: Object, subaccount: String, transaction_charge: Number, bearer: String, invoice_limit: Number }, | ||
param_defaults: { amount: 0, currency: 'NGN', bearer: 'account', invoice_limit: 0 }, | ||
route_params: null | ||
@@ -109,3 +109,3 @@ }, | ||
params: { from: Date, to: Date, settled: Boolean, payment_page: Number, customer: Number, currency: String, settlement: Number, amount: Number, status: String }, | ||
param_defaults: { payment_page: 0, customer: 0, settlement: 0, amount: 0, status: 'success' }, | ||
param_defaults: { status: 'success' }, | ||
route_params: null | ||
@@ -129,3 +129,3 @@ }, | ||
Check Authorization | ||
@params: from, to, settled, payment_page, customer, currency, settlement, amount, status | ||
@params: authorization_code, currency, email, amount | ||
*/ | ||
@@ -137,6 +137,19 @@ checkAuthorization: { | ||
params: { authorization_code$: String, amount$: Number, email$: String, currency: String }, | ||
param_defaults: { amount: 0, currency: 'NGN' }, | ||
param_defaults: { currency: 'NGN' }, | ||
route_params: null | ||
}, | ||
/* | ||
Partial Debit | ||
@params: authorization_code, currency, email, amount, at_least, reference | ||
*/ | ||
partialDebit: { | ||
method: 'POST', | ||
path: '/transaction/partial_debit', | ||
send_json: true, | ||
params: { authorization_code$: String, amount$: Number, email$: String, currency$: String, at_least: Number, reference: String }, | ||
param_defaults: { currency: 'NGN' }, | ||
route_params: null | ||
} | ||
} |
@@ -136,3 +136,3 @@ 'use strict' | ||
offset) { | ||
let _value = values[string] | ||
let _value = values[string] || (isTypeOf(config.alternate_route_params_keymap, 'object') ? config.alternate_route_params_keymap[string] : false) | ||
if (config.route_params_numeric === true) { | ||
@@ -145,3 +145,3 @@ if (!isNumeric(_value)) { | ||
_value, | ||
config.route_params[string] | ||
(config.route_params[string] || String) | ||
) | ||
@@ -206,3 +206,3 @@ ? _value | ||
if (httpReqOptions[label][param] === null) { | ||
throw new Error(`param: "${param}" is not of type ${_type.name}; please provided as needed`) | ||
throw new Error(`param: "${param}" is not of type ${_type.name || _type}; please provided as needed`) | ||
} | ||
@@ -209,0 +209,0 @@ } |
52486
1381
326