public static function payment_request_line_items(SI_Invoice $invoice)
 {
     $i = 0;
     $total = 0;
     // we can add individual item info if there's actually an item cost
     foreach ($invoice->get_line_items() as $position => $data) {
         if ($data['total']) {
             $nvpData['L_NAME' . $i] = html_entity_decode(strip_tags($data['desc']), ENT_QUOTES, 'UTF-8');
             $nvpData['L_AMT' . $i] = si_get_number_format($data['rate'] * $data['qty']);
             $nvpData['L_NUMBER' . $i] = $position;
             $nvpData['L_QTY' . $i] = 1;
             $total += si_get_number_format($data['rate'] * $data['qty']);
             $i++;
         }
         if (floatval($data['total']) !== floatval($data['rate'] * $data['qty'])) {
             $nvpData['L_NAME' . $i] = __('Adjustment: ', 'sprout-invoices') . ' ' . html_entity_decode(strip_tags($data['desc']), ENT_QUOTES, 'UTF-8');
             $nvpData['L_AMT' . $i] = si_get_number_format($data['total'] - $data['rate'] * $data['qty']);
             $nvpData['L_NUMBER' . $i] = $position . '.1';
             $nvpData['L_QTY' . $i] = 1;
             $total += si_get_number_format($data['total'] - $data['rate'] * $data['qty']);
             $i++;
         }
     }
     if ($invoice->get_deposit() && $invoice->get_deposit() < $invoice->get_balance()) {
         $nvpData['L_NAME' . $i] = __('Deposit Adjustment', 'sprout-invoices');
         $nvpData['L_AMT' . $i] = si_get_number_format($invoice->get_deposit() - $total);
         $nvpData['L_NUMBER' . $i] = time() . '_dep';
         $nvpData['L_QTY' . $i] = '1';
         $i++;
     }
     // payment adjustments and discounts are overlooked for deposits.
     if ($invoice->get_deposit()) {
         return $nvpData;
     }
     $payments_total = $invoice->get_payments_total();
     if ($payments_total > 0) {
         $nvpData['L_NAME' . $i] = __('Payment Adjustment', 'sprout-invoices');
         $nvpData['L_AMT' . $i] = -si_get_number_format($payments_total);
         $nvpData['L_NUMBER' . $i] = time() . '_pay';
         $nvpData['L_QTY' . $i] = '1';
         $i++;
     }
     $discount = $invoice->get_discount_total();
     if ($discount > 0.0) {
         $nvpData['L_NAME' . $i] = __('Invoice Discount', 'sprout-invoices');
         $nvpData['L_AMT' . $i] = -si_get_number_format($discount);
         $nvpData['L_NUMBER' . $i] = time() . '_discount';
         $nvpData['L_QTY' . $i] = '1';
         $i++;
     }
     return $nvpData;
 }