当前位置: 首页>>代码示例>>PHP>>正文


PHP Invoice::setCancelled方法代码示例

本文整理汇总了PHP中Invoice::setCancelled方法的典型用法代码示例。如果您正苦于以下问题:PHP Invoice::setCancelled方法的具体用法?PHP Invoice::setCancelled怎么用?PHP Invoice::setCancelled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Invoice的用法示例。


在下文中一共展示了Invoice::setCancelled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cancelAction

 public function cancelAction(Invoice $invoice, $actionName, Am_Paysystem_Result $result)
 {
     $this->invoice = $invoice;
     list($payment) = $invoice->getPaymentRecords();
     $params = array('key' => $this->getConfig('key'), 'ref' => $payment->receipt_id, 'uid' => $payment->user_id, 'type' => 2);
     $params['sign'] = $this->calculateSignature($params, $this->getConfig('secret'));
     $requst = new Am_HttpRequest(self::URL_TICKET, Am_HttpRequest::METHOD_POST);
     $requst->addPostParameter($params);
     $log = $this->logRequest($requst);
     $responce = $requst->send();
     $log->add($responce);
     if ($responce->getStatus() != 200) {
         $result->setFailed('Incorrect HTTP response status: ' . $responce->getStatus());
         return;
     }
     $res = Am_Controller::decodeJson($responce->getBody());
     if ($res['result'] == 1) {
         $invoice->setCancelled();
         $result->setSuccess();
         return;
     }
     $result->setFailed($res['errors']);
 }
开发者ID:grlf,项目名称:eyedock,代码行数:23,代码来源:paymentwall.php

示例2: cancelAction

 public function cancelAction(Invoice $invoice, $actionName, Am_Paysystem_Result $result)
 {
     $invoice->setCancelled(true);
 }
开发者ID:grlf,项目名称:eyedock,代码行数:4,代码来源:Echeck.php

示例3: cancelAction

 public function cancelAction(Invoice $invoice, $actionName, Am_Paysystem_Result $result)
 {
     $payment = current($invoice->getPaymentRecords());
     try {
         $this->cancelInvoice($payment, $result);
         $invoice->setCancelled(true);
     } catch (Exception $e) {
         $result->setFailed($e->getMessage());
     }
 }
开发者ID:grlf,项目名称:eyedock,代码行数:10,代码来源:mikro-odeme.php

示例4: cancelAction

 public function cancelAction(Invoice $invoice, $actionName, Am_Paysystem_Result $result)
 {
     if ($actionName == 'cancel-admin') {
         $invoice->setCancelled(true);
     } else {
         parent::cancelAction($invoice, $actionName, $result);
     }
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:8,代码来源:monelib.php

示例5: doUpgrade

 function doUpgrade(Invoice $invoice, InvoiceItem $item, Invoice $newInvoice, ProductUpgrade $upgrade)
 {
     if (!$this->getConfig('datalink_user') || !$this->getConfig('datalink_pass')) {
         $this->getDi()->errorLogTable->log("ccBill plugin error: Datalink is not configured!");
         return;
     }
     $payments = $invoice->getPaymentRecords();
     $subscriptionId = $payments[0]->transaction_id;
     $vars = array('clientAccnum' => $this->getConfig('account'), 'usingSubacc' => $this->getConfig('subaccount_id'), 'subscriptionId' => $subscriptionId, 'newClientAccnum' => $this->getConfig('account'), 'newClientSubacc' => $this->getConfig('subaccount_id'), 'sharedAuthentication' => 1, 'action' => 'chargeByPreviousTransactionId', 'currencyCode' => $this->currency_codes[$invoice->currency], 'initialPrice' => $newInvoice->first_total, 'initialPeriod' => $this->getDays($newInvoice->first_period), 'returnXML' => 1, 'username' => $this->getConfig('datalink_user'), 'password' => $this->getConfig('datalink_pass'));
     if ($newInvoice->rebill_times) {
         $vars['recurringPrice'] = $newInvoice->second_total;
         $vars['recurringPeriod'] = $this->getDays($newInvoice->second_period);
         $vars['rebills'] = $newInvoice->rebill_times == IProduct::RECURRING_REBILLS ? 99 : $newInvoice->rebill_times;
     } else {
         $vars['recurringPrice'] = 0;
         $vars['recurringPeriod'] = 0;
         $vars['rebills'] = 0;
     }
     $r = new Am_HttpRequest($requestString = "https://bill.ccbill.com/jpost/billingApi.cgi?" . http_build_query($vars, '', '&'));
     $response = $r->send();
     if (!$response) {
         $this->getDi()->errorLogTable->log('ccBill Billing API  error: Unable to contact datalink server');
         throw new Am_Exception_InternalError('ccBill Billing API  error: Unable to contact datalink server');
     }
     $resp = $response->getBody();
     // Log datalink requests;
     $this->getDi()->errorLogTable->log(sprintf("ccBill billing API  debug:\n%s\n%s", $requestString, $resp));
     $xml = simplexml_load_string($resp);
     if ((string) $xml->approved != "1") {
         throw new Am_Exception_InternalError('ccBill Subscription Management error: Incorrect response received while attempting to upgrade subscription!');
     }
     $tr = new Am_Paysystem_Transaction_Ccbill_Upgrade($this, $xml);
     // Add payment to new invocie;
     $newInvoice->addPayment($tr);
     // Cancel old one
     $invoice->setCancelled(true);
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:37,代码来源:ccbill.php


注:本文中的Invoice::setCancelled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。