Skip to content

Commit

Permalink
iZettle fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
bardsley committed Nov 26, 2024
1 parent 7ac66a9 commit ff2bd12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/api/izettle/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ export async function POST(request: Request) {
// console.log("payload:",payload, payload.products.map((product) => product.category))
const channel = "card-payments"

const tills = payload?.products?.length > 0 ? payload.products.map((product) => product?.sku) as string[] : ["NOTILL"]
const tills = payload.products.map((product) => product?.sku || "notill" ) as string[]
const notification = {
amount: payload.amount,
created: payload.created,
timestamp: payload.timestamp,
payment_ref: payload.payments.map((payment) => payment.attributes.referenceNumber).join(' , '),
payment_ref: payload.payments.map((payment) => payment?.attributes?.reference).join(' , '),
purchaseUuid: payload.purchaseUuid,
tills: tills
// products: payload.products.map((product) => { return { name: product.sku , till: product?.category?.name?.toLowerCase()?.replaceAll(" ", ""), Uuid: product['productUuid'] }} ) as string[],
Expand Down

0 comments on commit ff2bd12

Please sign in to comment.