Skip to content

Commit

Permalink
fix: encode product name and log error (#6877)
Browse files Browse the repository at this point in the history
* fix: encode product name and log error

* fix: remove overly defensive coding

* chore: add optional

* chore: add empty fallback

---------

Co-authored-by: tshuli <shuli@open.gov.sg>
  • Loading branch information
sebastianwzq and tshuli committed Nov 8, 2023
1 parent 005e57f commit ded7341
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/modules/payments/stripe.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ const formatProductsDescriptionHtml = (products: ProductItem[]) => {
let final =
'<td class="Table-description Font Font--body" style="color: #525f7f;font-size: 15px;line-height: 36px;width: 100%;">'
products.forEach((product) => {
const productStr = `${product.data.name} x ${product.quantity}<br>`
const productName = encode(product?.data?.name || '')
const productStr = `${productName} x ${product.quantity}<br>`
final = final.concat(productStr)
})
final = final.concat('</td>')
Expand Down

0 comments on commit ded7341

Please sign in to comment.