Fix listen command#3
Open
wuzengfu wants to merge 2 commits into
Open
Conversation
Use proper array format for event types command option. Example usage: `hitpay listen --events "charge.created" "charge.updated"`
Fix wrong webhook event header. Instead of `hitpay-event-type="charge.created"`, it should be `hitpay-event-object="charge" & hitpay-event-type="created"`
Add missing `name` field which is **required** for posting a new webhook
Instead of always returning `{success: true}` for webhook success response. It now returns the original webhook response from user's own endpoint (forward_url)
Using node v18 gives compilation error of `undefined styleText from node:util`. The minimum node version that supports `styleText` should be v20.12.0 or higher.
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.
Description
The original implementation on
hitpay listencommand does not work for several reasons. This PR fixeshitpay listencommand and updates the correct node version required to run this project. This change has been tested manually and it was observed thathitpay listencommand now can correctly create a webhook and return the original response back to server.List of Change
hitpay listen --events "charge.created" "charge.updated"hitpay-event-type="charge.created", it should behitpay-event-object="charge" & hitpay-event-type="created"namefield which is required for posting a new webhook{success: true}for webhook success response. It now returns the original webhook response from user's own endpoint (forward_url)How Has This Been Tested?
npm run test.hitpay listencommand. It will correctly return the original response message from the server onforward-urlto HitPay server.