<?php

/**
 * [BEGIN_COT_EXT]
 * Hooks=payments.billing.emptypid
 * [END_COT_EXT]
 */

defined('COT_CODE') or die('Wrong URL');

if(empty($pid))
{
  if($from_type == 'ads') {
    $options = array();
    $options['desc'] = $L['payments_balance_billing_desc'];
    $options['code'] = $payment_id;
    $options['indodji'] = ($indodji ? 1 : 0);

    $pid = cot_payments_create_order('balance', $summ, $options, $billservice);

    if($pid > 0) {
      cot_redirect(cot_url('payments', 'm=billing&pid=' . $pid . '&billservice=' . $billservice, '', true));
      exit;
    }
  }
}