From e138e50cbe1c59fa67ce4e5922e7fd7b41d533ca Mon Sep 17 00:00:00 2001 From: matheusgnreis Date: Wed, 27 Mar 2024 23:23:56 -0300 Subject: [PATCH] chore(order): get correct id from data --- functions/lib/appmax/order.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/lib/appmax/order.js b/functions/lib/appmax/order.js index fb95555..ea97076 100644 --- a/functions/lib/appmax/order.js +++ b/functions/lib/appmax/order.js @@ -29,8 +29,8 @@ const createOrder = async (items, amount, customer_id, token) => { }) console.log('created order', JSON.stringify(data)) - if (data) { - return data.order_id + if (data && data.status === 200) { + return data.data && data.data.id } return null }