26 public static function repeat(
Order $order, array $resultList)
28 $recurringID = intval($order->getField(
"RECURRING_ID"));
30 $basket = $order->getBasket();
31 foreach ($resultList as $providerName => $basketList)
33 foreach ($basketList as $basketCode => $resultData)
37 if (!empty($resultData) && is_array($resultData))
39 if (empty($resultData[
'ORDER_ID']) || intval($resultData[
'ORDER_ID']) < 0)
40 $resultData[
"ORDER_ID"] = $order->getId();
42 $resultData[
"REMAINING_ATTEMPTS"] = (defined(
"SALE_PROC_REC_ATTEMPTS") ? SALE_PROC_REC_ATTEMPTS : 3);
43 $resultData[
"SUCCESS_PAYMENT"] =
"Y";
46 \CSaleRecurring::Update($recurringID, $resultData);
48 \CSaleRecurring::Add($resultData);
50 elseif ($recurringID > 0)
52 \CSaleRecurring::Delete($recurringID);
57 if (!$basketItem = $basket->getItemByBasketCode($basketCode))
62 $resRecurring = \CSaleRecurring::GetList(
65 "USER_ID" => $order->getUserId(),
66 "PRODUCT_ID" => $basketItem->getProductId(),
67 "MODULE" => $basketItem->getField(
"MODULE"),
68 "ORDER_ID" => $order->getId(),
71 while ($recurringData = $resRecurring->Fetch())
73 \CSaleRecurring::Delete($recurringData[
"ID"]);