fix: stop sending client-computed price on order creation

createOrder() sent a discount-applied price per line item that the
client computed itself, with no server revalidation. Items now only
carry productId/name/quantity - the backend must price from its own
catalog. createPayment()'s amount (required to actually charge the
payment gateway) is unchanged; backend must revalidate it instead,
tracked in BACKEND-API-REFERENCE.md §12.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
sdarbinyan
2026-08-13 07:24:08 +04:00
parent bac415d003
commit 9fa3321322
2 changed files with 6 additions and 2 deletions

View File

@@ -424,7 +424,6 @@ export class CartComponent implements OnDestroy {
productId: String(item.itemID),
name: item.name,
quantity: item.quantity,
price: item.discount > 0 ? item.price * (1 - item.discount / 100) : item.price,
})),
customer: {
name: this.getTelegramUsername() || this.i18n.t('common.guest'),