Exemple #1
0
 public function isNotAcceptableForInvoice(Invoice $invoice)
 {
     if ($invoice->rebill_times) {
         return "Interkassa cannot handle products with recurring payment plan";
     }
     return parent::isNotAcceptableForInvoice($invoice);
 }
Exemple #2
0
 public function isNotAcceptableForInvoice(Invoice $invoice)
 {
     if (!in_array($invoice->rebill_times, array(0, IProduct::RECURRING_REBILLS))) {
         return 'Can not handle invoice with defined rebill times';
     }
     return parent::isNotAcceptableForInvoice($invoice);
 }
 public function isNotAcceptableForInvoice(Invoice $invoice)
 {
     if ($invoice->rebill_times && $invoice->first_period != $invoice->second_period) {
         return "WorldPay cannot handle products with different first and second period";
     }
     return parent::isNotAcceptableForInvoice($invoice);
 }
Exemple #4
0
 public function isNotAcceptableForInvoice(Invoice $invoice)
 {
     if ($err = parent::isNotAcceptableForInvoice($invoice)) {
         return $err;
     }
     if ($invoice->rebill_times >= 1 && ($err = $this->checkPeriod(new Am_Period($invoice->first_period)))) {
         return array($err);
     }
     if ($invoice->rebill_times >= 2 && ($err = $this->checkPeriod(new Am_Period($invoice->second_period)))) {
         return array($err);
     }
 }
Exemple #5
0
 public function isNotAcceptableForInvoice(Invoice $invoice)
 {
     if ($ret = parent::isNotAcceptableForInvoice($invoice)) {
         return $ret;
     }
     foreach ($invoice->getItems() as $item) {
         if (!(double) $item->first_total && (double) $item->second_total) {
             return array("2Checkout does not support products with free trial");
         }
         if ($item->rebill_times && $item->second_period != $item->first_period) {
             return array(___("2Checkout is unable to handle billing for product [{$item->item_title}] - second_period must be equal to first_period"));
         }
     }
 }
Exemple #6
0
 public function isNotAcceptableForInvoice(Invoice $invoice)
 {
     if ($invoice->first_period != $invoice->second_period) {
         return ___('Can not handle this billing terms');
     }
     if ($invoice->rebill_times != IProduct::RECURRING_REBILLS) {
         return ___('Can not handle this billing terms');
     }
     $period = new Am_Period($invoice->first_period);
     if (!in_array($period->getUnit(), array('m', 'w', 'y')) || $period->getCount() != 1) {
         return ___('Can not handle this billing terms');
     }
     return parent::isNotAcceptableForInvoice($invoice);
 }
Exemple #7
0
 public function isNotAcceptableForInvoice(Invoice $invoice)
 {
     if ($err = parent::isNotAcceptableForInvoice($invoice)) {
         return $err;
     }
     if ($invoice->rebill_times >= 1 && ($err = $this->checkPeriod(new Am_Period($invoice->first_period)))) {
         return array($err);
     }
     if ($invoice->rebill_times >= 2 && ($err = $this->checkPeriod(new Am_Period($invoice->second_period)))) {
         return array($err);
     }
     if ($invoice->rebill_times != IProduct::RECURRING_REBILLS && $invoice->rebill_times > 52) {
         return array('PayPal can not handle subscription terms with number of rebills more than 52');
     }
 }
Exemple #8
0
 public function isNotAcceptableForInvoice(Invoice $invoice)
 {
     if ($invoice->rebill_times) {
         $first_period = new Am_Period($invoice->first_period);
         if (!(double) $invoice->first_total) {
             return ___('Can not handle this billing terms');
         }
         if ($invoice->first_period != $invoice->second_period && $first_period->getUnit() != 'd') {
             return ___('Can not handle this billing terms');
         }
         if (!in_array($invoice->second_period, array_keys($this->rebill_type_map))) {
             return ___('Can not handle this billing terms');
         }
     }
     return parent::isNotAcceptableForInvoice($invoice);
 }
Exemple #9
0
 function isNotAcceptableForInvoice(Invoice $invoice)
 {
     if (!$invoice->first_total) {
         return "Free trials are not supported!";
     }
     if ($invoice->rebill_times) {
         try {
             $this->getPeriod($invoice->second_period);
         } catch (Exception $e) {
             return $e->getMessage();
         }
     }
     return parent::isNotAcceptableForInvoice($invoice);
 }