This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
| const downloadInvoice = async (orderUUID) => { | |
| try { | |
| console.log(`Downloading invoice for order UUID: ${orderUUID}`); | |
| const invoiceResponse = await fetch('https://www.ubereats.com/_p/api/getInvoiceFilesV1?localeCode=fr', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json', 'x-csrf-token': 'x' }, // Remplacez 'x' par votre token CSRF réel | |
| body: JSON.stringify({ orderUUID }), | |
| }); |