Skip to content

Fix listen command#3

Open
wuzengfu wants to merge 2 commits into
hit-pay:mainfrom
wuzengfu:fix-listen-command
Open

Fix listen command#3
wuzengfu wants to merge 2 commits into
hit-pay:mainfrom
wuzengfu:fix-listen-command

Conversation

@wuzengfu

@wuzengfu wuzengfu commented Jul 1, 2026

Copy link
Copy Markdown

Description

The original implementation on hitpay listen command does not work for several reasons. This PR fixes hitpay listen command and updates the correct node version required to run this project. This change has been tested manually and it was observed that hitpay listen command now can correctly create a webhook and return the original response back to server.

List of Change

  1. Use proper array format for event types command option. Example usage: hitpay listen --events "charge.created" "charge.updated"
  2. Fix wrong webhook event header. Instead of hitpay-event-type="charge.created", it should be hitpay-event-object="charge" & hitpay-event-type="created"
  3. Add missing name field which is required for posting a new webhook
  4. Instead of always returning {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?

  • Unit Tests: npm run test.
  • Manual Testing: Tested webhooks with hitpay listen command. It will correctly return the original response message from the server on forward-url to HitPay server.

wuzengfu added 2 commits July 1, 2026 16:24
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant