public function toArray($request): array 	{ 		$lang = $request->lang;  		return [ 			'items' => collect($this->getProducts())->map(function ($item) use ($lang) { 				return [  					'item_id' => $item->getDiscountableItem()->id, 					'item_name' => $item->getDiscountableItem()->determineTranslation($lang, 'name'), 					'price' => $this->round($item->getPrice()), 					'second_price' => convertToSecondCurrency($item->getPrice()), 					'discounts' => collect($item->getDiscounts())->map(function ($discount) { 						return [ 							'discount_name' => $discount->getName(), 							'discount_id' => $discount->getId(), 							'amount' => $this->round($discount->getAmount()), 							'second_amount' => convertToSecondCurrency($discount->getAmount()), 							'type' => $discount->getType(),  						]; 					}),  					'item_weight' => $item->getDiscountableItem()->weight, 					'quantity' => $item->getQuantity(), 					'total_price' => $this->round($item->getTotalPrice()), 					'second_total_price' => convertToSecondCurrency($item->getTotalPrice()), 					'tax_rate' => $item->getTaxRate() . ' %', 					'total_tax' => $this->round($item->getTotalTax()), 					'second_total_tax' => convertToSecondCurrency($item->getTotalTax()), 					'total_discounts' => $this->round($item->getTotalDiscounts()), 					'second_total_discounts' => convertToSecondCurrency($item->getTotalDiscounts()), 					'total_price_with_discounts' => $this->round($item->getTotalPriceWithDiscounts()), 					'second_total_price_with_discount' => convertToSecondCurrency($item->getTotalPriceWithDiscounts()), 				]; 			}), 			'total' => [ 				'total_items_quantity' => $this->getNumberOfProducts(), 				'order_price' => $this->round($this->getTotalPrice()), 				'second_order_price' => convertToSecondCurrency($this->getTotalPrice()), 				'order_wise_discounts' => collect($this->getOrderWiseDiscounts())->map(function ($discount) { 					return [ 						'discount_name' => $discount->getName(), 						'discount_id' => $discount->getId(), 						'amount' => $this->round($discount->getAmount()), 						'second_amount' => convertToSecondCurrency($discount->getAmount()), 						'type' => $discount->getType(),  					]; 				}), 				'order_discounts' => $this->round($this->getTotalDiscounts()), 				'second_order_discounts' => convertToSecondCurrency($this->getTotalDiscounts()), 				'order_price_minus_discounts' => $this->round($this->getTotalWithDiscounts()), 				'second_order_price_minus_discounts' => convertToSecondCurrency($this->getTotalWithDiscounts()), 				'order_tax' => $this->round($this->getTotalTax()), 				'second_order_tax' => convertToSecondCurrency($this->getTotalTax()), 				'shipping' => [ 					'price' => $this->round($this->getShipping()), 					'second_price' => convertToSecondCurrency($this->getShipping()), 					'number_of_packages' => $this->getTotalNumberOfPackages(), 				], 				'final_price_with_shipping_added' => $this->round($this->getTotalWithShippingAdded()), 				'second_final_price_with_shipping_added' => convertToSecondCurrency($this->getTotalWithShippingAdded()),  			], 			'r1' => request()->r1, 			'currency' => Setting::getMainCurrency(), 			'created_at' => formatTimestamp(), 		]; 	}