コード例 #1
0
 }
 //EXCLUDE ITEMS THAT CANCELLED
 foreach ($items as $key => $i) {
     if (!in_array($i['jng_sp_orders_items_id'], $arr_joid)) {
         unset($items[$key]);
     }
 }
 if ($is_sp) {
     if (strtoupper($order["payment_method"]) == strtoupper(PAYMENT_METHOD_PREPAYMENT)) {
         $payi->createFromOrderSP($order, $items, '+1 month');
     } else {
         $payi->createFromOrderSP($order, $items);
     }
 } else {
     if ($order["payment_method"] == PAYMENT_METHOD_BANK_TRANSFER) {
         $payi->createFromOrderJNG($order, $items, '+1 month');
     } else {
         $payi->createFromOrderJNG($order, $items);
     }
 }
 if (count($order) == 0 || count($items) == 0 || $payi->detail['invoice_complete_status'] != 'R') {
     $result = "{$order_id},1";
 } else {
     //--PREPARE PARAMETERS
     $request = array();
     //--STANDARD PARAMETERS
     $request['mid'] = PAYONE_MERCHANT_ID;
     //will be set later below, keep this blank so we only need to update 1 location
     $request['portalid'] = '';
     $request['key'] = md5(PAYONE_PORTAL_KEY);
     $request['mode'] = PAYONE_MODE;
コード例 #2
0
$order_counter = 0;
foreach ($orders_array as $order_id) {
    $pdf->AddPage();
    $order = $class_o->retrieveDetail($order_id, true);
    $items = $class_o->retrieveProducts($order_id, true);
    foreach ($items as $key => $item) {
        if ($class_o->productStatusIsCancelled($item['status'])) {
            unset($items[$key]);
        }
    }
    $print_delivery_note = false;
    $invoice = new payone_invoice();
    //echo "<pre>";var_dump($items);die();
    if (strtoupper($order['payment_method']) == strtoupper(PAYMENT_METHOD_BANK_TRANSFER)) {
        //Vorkasse
        $invoice->createFromOrderJNG($order, $items, '+1 month');
    } elseif (strtoupper($order['payment_method']) == strtoupper(PAYMENT_METHOD_DIRECT_DEBIT)) {
        //Bankeinzug
        $invoice->createFromOrderJNG($order, $items, '+0 days');
    } elseif (strtoupper($order['payment_method']) == strtoupper(PAYMENT_METHOD_INVOICE)) {
        //Rechnung
        $invoice->createFromOrderJNG($order, $items);
    } else {
        //Paypal invoice
        $invoice->createFromOrderJNG($order, $items, '+0 days', '2');
    }
    $invoice_id = tep_db_insert_id();
    if ($invoice_id != '') {
        $invoice = new payone_invoice("invoice_id", $invoice_id);
    } else {
        $invoice = new payone_invoice("invoice_order_id", $order_id, "invoice_order_type='J'");
コード例 #3
0
$order_counter = 0;
foreach ($orders_array as $order_id) {
    $pdf->AddPage();
    $order = $class_o->retrieveDetail($order_id, true);
    $items = $class_o->retrieveProducts($order_id, true);
    foreach ($items as $key => $item) {
        if ($class_o->productStatusIsCancelled($item['status'])) {
            unset($items[$key]);
        }
    }
    $print_delivery_note = false;
    $class_pi = new payone_invoice();
    //        echo "<pre>";var_dump($items);die();
    if (strtoupper($order['payment_method']) == strtoupper(PAYMENT_METHOD_BANK_TRANSFER)) {
        //Vorkasse
        $class_pi->createFromOrderJNG($order, $items, '+1 month');
    } elseif (strtoupper($order['payment_method']) == strtoupper(PAYMENT_METHOD_DIRECT_DEBIT)) {
        //Bankeinzug
        $class_pi->createFromOrderJNG($order, $items, '+0 days');
    } elseif (strtoupper($order['payment_method']) == strtoupper(PAYMENT_METHOD_INVOICE)) {
        //Rechnung
        $class_pi->createFromOrderJNG($order, $items);
    } else {
        //Paypal invoice
        $class_pi->createFromOrderJNG($order, $items, '+0 days', '2');
    }
    $invoice_id = tep_db_insert_id();
    if ($invoice_id != '') {
        $class_pi = new payone_invoice("invoice_id", $invoice_id);
    } else {
        $class_pi = new payone_invoice("invoice_order_id", $order_id, "invoice_order_type='J'");
コード例 #4
0
        $pi_create_counter['jg']++;
        $order = $class_o->retrieveDetail($order_id, true);
        $items = $class_o->retrieveProducts($order_id, true);
        foreach ($items as $key => $item) {
            if ($class_jo->statusIsCancelled($item['status'])) {
                unset($items[$key]);
                break 1;
            }
        }
        //echo "<pre>";var_dump($order);die();
        //Order Items
        //DISABLED THIS => PAYONE INVOICE WILL BE CREATED FOR ALL VORKASSE, EVENTHOUGH ALL ITEMS ARE CANCELLED
        //if(count($items)>0) {
        //PREPARE INVOICE DATA//
        //echo "<pre>";var_dump($items);die();
        $payi->createFromOrderJNG($order, $items, $prepayment_due_date, '0', '0');
        if (tep_db_insert_id() != '') {
            $l_invoice_id = tep_db_insert_id();
            $pi_success_create['jg'][] = $order_id;
            $logger->write("JGO{$order_id} invoice created (id = {$l_invoice_id})");
        } else {
            $pi_failed_create['jg'][] = $order_id;
            $logger->write("JGO{$order_id} invoice failed created");
        }
        //}
    }
} else {
    $logger->write("no orders ready");
}
//CREATE INVOICE FOR SP PREPAYMENT
$sp_vorkasse_handled_with_payone = "2, 10";