fix: cleanup deps, fix bugs, restore CustomRequest & voucher charge#203
Open
knofte wants to merge 1 commit intoFlutterwave:masterfrom
Open
fix: cleanup deps, fix bugs, restore CustomRequest & voucher charge#203knofte wants to merge 1 commit intoFlutterwave:masterfrom
knofte wants to merge 1 commit intoFlutterwave:masterfrom
Conversation
1. Remove unused production dependencies (axios, q, bluebird, chai-as-promised-also-chain); move eslint-config-prettier to devDependencies. Removes axios entirely — the codebase already uses native fetch. Fixes Flutterwave#168 (Cloudflare Workers compatibility). 2. Fix repository URLs in package.json — pointed to the old Flutterwave-node-v3 repo instead of the current Node-v3. 3. Bump node-forge from pinned 1.3.2 to ^1.3.3 (security fix). 4. Remove committed .DS_Store and add it to .gitignore. 5. Restore CustomRequest feature (fixes Flutterwave#117) — uncommented and modernized to use async/await with the existing _rave.request() pattern instead of the old q/morx dependencies. 6. Restore voucher charge service — was entirely commented out, causing Charge.voucher() to throw TypeError. Rewritten using the modern async/await pattern matching other charge services. 7. Fix operator precedence bug in rave.base.js: - `'POST' || 'PUT'` always evaluates to 'POST' (dead code) - `requestMethod == 'POST' || 'PUT'` always truthy ('PUT' is truthy) - Fixed to proper `requestMethod === 'POST' || requestMethod === 'PUT'` - Also: `datakey == 'body' ? true : false` simplified to `datakey === 'body'` - Removed unused `var q = require('q')` import 8. Fix broken anchor link in documentation/transactions.md — "Verify transaction with reference" linked to #verify-transaction instead of #verify-transaction-with-reference.
Author
|
@corneliusyaovi for your checks - let me know if you need help with anything else in this SDK. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A combined housekeeping + bug fix PR addressing several open issues and long-standing problems:
1. Remove unused production dependencies
dependencies:axios,q,bluebird,chai-as-promised-also-chaindevDependencies:eslint-config-prettier,bluebirdfetch—axioswas only referenced in commented-out codevar q = require('q')fromrave.base.js(imported but never used)XMLHttpRequestincompatibility2. Fix repository URLs in
package.jsonFlutterwave-node-v3(old repo name) instead ofNode-v33. Bump
node-forgefrom1.3.2to^1.3.3node-forgeis used for 3DES-ECB encryption of card payment data4. Remove
.DS_Storefrom repo, add to.gitignore5. Restore
CustomRequestfeature (fixes #117)rave.custom.jsandservices/rave.custom.request.jswere entirely commented outasync/await+_rave.request()pattern (noq/morxdependencies)flw.CustomRequest.custom('/v3/some-endpoint', data)6. Restore voucher charge service
services/charge/rave.voucher.jswas entirely commented out, butlib/rave.charge.jsstill required and exported itflw.Charge.voucher(data)threwTypeError: voucher_charge is not a function7. Fix operator precedence bug in
rave.base.js8. Fix broken anchor link in
documentation/transactions.md#verify-transactioninstead of#verify-transaction-with-referenceTest plan
npm installworks with reduced dependency setflw.Charge.voucher(data)with voucher payment dataflw.CustomRequest.custom(path, data)with a valid API path