Skip to content

Conversation

@delovoyhomie
Copy link

@delovoyhomie delovoyhomie commented Jan 26, 2026

Closes #1750

@github-actions

This comment has been minimized.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thanks for the thorough TON Pay docs update; I’ve suggested several targeted edits in ecosystem/ton-pay/webhooks.mdx—please apply the inline suggestions to align the content with the shared style and code guidelines.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@delovoyhomie
Copy link
Author

/review

@github-actions

This comment has been minimized.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thanks for expanding the TON Pay webhook docs. I’ve left several suggestions in ecosystem/ton-pay/webhooks.mdx to align phrasing, link text, and callout usage with the style guide, so please apply the inline suggestions.

delovoyhomie and others added 2 commits January 26, 2026 17:00
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@delovoyhomie delovoyhomie marked this pull request as draft January 28, 2026 08:02
@aigerimu aigerimu self-assigned this Jan 29, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@aigerimu aigerimu marked this pull request as ready for review January 29, 2026 08:16
@github-actions

This comment has been minimized.

@aigerimu
Copy link
Contributor

/review

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thanks for the detailed TON Pay webhook docs update. I’ve left several suggestions in ecosystem/ton-pay/webhooks.mdx: please apply the inline suggestions.

Comment on lines +355 to +383
const order = await db.getOrderByReference(webhookData.data.reference);
if (!order) {
console.error("Order not found:", webhookData.data.reference);
return res.status(200).json({ received: true }); // Acknowledge to prevent retry
}
```

1. Verify the amount matches the expected payment amount.

```ts
if (parseFloat(webhookData.data.amount) !== order.expectedAmount) {
console.error("Amount mismatch:", {
expected: order.expectedAmount,
received: webhookData.data.amount,
});
return res.status(200).json({ received: true }); // Acknowledge to prevent retry
}
```

1. Verify the payment currency or token.

```ts
if (webhookData.data.asset !== order.expectedAsset) {
console.error("Asset mismatch:", {
expected: order.expectedAsset,
received: webhookData.data.asset,
});
return res.status(200).json({ received: true }); // Acknowledge to prevent retry
}

Choose a reason for hiding this comment

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

[HIGH] Trailing explanatory comments on code lines in TypeScript examples

Several validation snippets in this section use trailing inline comments on the same line as executable code, for example return res.status(200).json({ received: true }); // Acknowledge to prevent retry on lines 358, 370, 382, and similar patterns further down the file. The style guide requires explanatory comments in examples to appear on their own line immediately above the code, and forbids trailing end-of-line comments for general-purpose languages. Keeping these inline comments makes the examples visually noisy and inconsistent with the commenting standard across the docs.

Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!

Comment on lines +403 to +406
### Complete validation example

```ts expandable
import { verifySignature, type WebhookPayload } from "@ton-pay/api";

Choose a reason for hiding this comment

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

[HIGH] Partial TypeScript snippets missing “Not runnable” label

The “Complete validation example” TypeScript block starting at line 403 relies on undefined symbols such as app, db, and processOrderCompletion, making it a partial excerpt rather than a standalone runnable program. The extended style guide requires all partial snippets to be explicitly labeled “Not runnable” above the fenced block so readers do not assume they can execute them unchanged (contribute/style-guide-extended.mdx §“Partial snippets”). Other examples on this page (for example, earlier Express and validation snippets that also reference db and helper functions) show similar partial patterns and should follow the same labeling convention.

Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!

Comment on lines +539 to +555
app.post('/webhook', async (req, res) => {
// Validate signature first
if (!verifyWebhookSignature(...)) {
return res.status(401).json({ error: 'Invalid signature' });
}

// Quick validations
if (!isValidWebhook(req.body)) {
return res.status(400).json({ error: 'Invalid webhook data' });
}

// Acknowledge after validation
res.status(200).json({ received: true });

// Process in background
processWebhookAsync(req.body).catch(console.error);
});

Choose a reason for hiding this comment

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

[HIGH] Literal ellipsis ... used as placeholder in code example

The best-practices example around lines 539–555 includes if (!verifyWebhookSignature(...)) {, using a literal ... as a stand-in for arguments. This makes the code invalid TypeScript/JavaScript and directly violates the rule that examples must be copy-pasteable and must not use literal ellipses that change syntax. Readers copying this snippet will encounter a syntax error or need to guess the missing arguments, which undermines trust in the documentation.

Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@delovoyhomie delovoyhomie merged commit 58b1418 into ton-pay-branch Jan 29, 2026
8 checks passed
@delovoyhomie delovoyhomie deleted the pr/ton-pay-webhooks branch January 29, 2026 11:23
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