Skip to content

Conversation

onahprosper
Copy link
Collaborator

@onahprosper onahprosper commented Sep 17, 2025

  • Made deleteTransferWebhook dynamic to handle both txHash and paymentOrderID
  • Added webhook deletion to UpdateReceiveAddressStatus for Transfer events
  • Prevents orphaned webhooks when Etherscan/Blockscout processes Transfer events
  • Ensures immediate cleanup when transfer is received, not delayed until OrderCreated
  • Function auto-detects UUID format for paymentOrderID vs txHash lookup

Description

Describe the purpose of this PR along with any background information and the impacts of the proposed change. For the benefit of the community, please do not assume prior context.

Provide details that support your chosen implementation, including: breaking changes, alternatives considered, changes to the API, contracts etc.

References

Include any links supporting this change such as a:

If there are no references, simply delete this section.

Testing

Describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this project has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

Please include any manual steps for testing end-to-end or functionality not covered by unit/integration tests.

Also include details of the environment this PR was developed in (language/platform/browser version).

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation and tests for new/changed functionality in this PR
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not main

By submitting a PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.

- Made deleteTransferWebhook dynamic to handle both txHash and paymentOrderID
- Added webhook deletion to UpdateReceiveAddressStatus for Transfer events
- Prevents orphaned webhooks when Etherscan/Blockscout processes Transfer events
- Ensures immediate cleanup when transfer is received, not delayed until OrderCreated
- Function auto-detects UUID format for paymentOrderID vs txHash lookup
Copy link
Contributor

coderabbitai bot commented Sep 17, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/webhook-cleanup-on-etherscan-blockscout

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sundayonah
Copy link
Collaborator

💯

Copy link
Contributor

@chibie chibie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@chibie chibie merged commit 628b0c8 into stable Sep 29, 2025
1 of 2 checks passed
chibie pushed a commit that referenced this pull request Sep 30, 2025
* fix: Add comprehensive webhook cleanup for Transfer events

- Made deleteTransferWebhook dynamic to handle both txHash and paymentOrderID
- Added webhook deletion to UpdateReceiveAddressStatus for Transfer events
- Prevents orphaned webhooks when Etherscan/Blockscout processes Transfer events
- Ensures immediate cleanup when transfer is received, not delayed until OrderCreated
- Function auto-detects UUID format for paymentOrderID vs txHash lookup

* fix: update documentation for webhook handling and order status updates

* fix: update transfer webhook deletion to use transaction hash and add cleanup for old webhooks

* fix: implement cleanup for old webhooks and enhance webhook handling

* fix: remove outdated webhook cleanup function and streamline transfer webhook deletion
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.

3 participants