當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Am_Paysystem_Abstract類代碼示例

本文整理匯總了PHP中Am_Paysystem_Abstract的典型用法代碼示例。如果您正苦於以下問題:PHP Am_Paysystem_Abstract類的具體用法?PHP Am_Paysystem_Abstract怎麽用?PHP Am_Paysystem_Abstract使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Am_Paysystem_Abstract類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createInvoices

 /**
  *
  * @param User 
  * @param Am_Paysystem_Abstract $payplugin
  * @param array $product_ids array of product_id to use for generation
  * @param int $invCnt count of invoices per user
  * @param int $invVar variation of count of invoices per user
  * @param int $prdCnt count of products per invoice
  * @param int $prdVar variation of products per invoice 
  */
 public function createInvoices($user, $payplugin, $product_ids, $invCnt, $invVar, $prdCnt, $prdVar)
 {
     $invoiceLimit = $this->getLimit($invCnt, $invVar);
     for ($j = 1; $j <= $invoiceLimit; $j++) {
         //subscribe user for some subscriptions
         $invoice = $this->getDi()->invoiceTable->createRecord();
         $productLimit = $this->getLimit($prdCnt, $prdVar);
         for ($k = 1; $k <= $productLimit; $k++) {
             $invoice->add(Am_Di::getInstance()->productTable->load(array_rand($product_ids)), 1);
         }
         $invoice->setUser($user);
         $invoice->setPaysystem($payplugin->getId());
         $invoice->calculate();
         $invoice->save();
         $transaction = new Am_Paysystem_Transaction_Manual($payplugin);
         $transaction->setAmount($invoice->first_total)->setInvoice($invoice)->setTime(new DateTime('-' . rand(0, 200) . ' days'))->setReceiptId('demo-' . uniqid() . microtime(true));
         $invoice->addPayment($transaction);
         //            $cc = $this->createCcRecord($user);
         //
         //            Am_Paysystem_Transaction_CcDemo::_setTime(new DateTime('-'.rand(0,200).' days'));
         //            $payplugin->doBill($invoice, true, $cc);
         $transaction = null;
         unset($transaction);
         $invoice = null;
         unset($invoice);
     }
 }
開發者ID:subashemphasize,項目名稱:test_site,代碼行數:37,代碼來源:AdminBuildDemoController.php

示例2: __construct

 public function __construct(Am_Paysystem_Abstract $plugin, Am_Request $request, Zend_Controller_Response_Http $response, $invokeArgs)
 {
     $DR = preg_replace("/\\s/", "+", $request->get('DR', $_GET['DR']));
     $rc4 = new Crypt_RC4($plugin->getConfig('secret', 'ebskey'));
     $QueryString = base64_decode($DR);
     $rc4->decrypt($QueryString);
     $QueryString = split('&', $QueryString);
     foreach ($QueryString as $param) {
         $param = split('=', $param);
         $request->setParam($param[0], $param[1]);
     }
     parent::__construct($plugin, $request, $request, $invokeArgs);
 }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:13,代碼來源:ebs.php

示例3: createInvoices

 /**
  *
  * @param User
  * @param Am_Paysystem_Abstract $payplugin
  * @param array $product_ids array of product_id to use for generation
  * @param int $invCnt count of invoices per user
  * @param int $invVar variation of count of invoices per user
  * @param int $prdCnt count of products per invoice
  * @param int $prdVar variation of products per invoice
  * @param int $start timestamp period begin
  * @param int $end timestamp period end
  */
 public function createInvoices($user, $payplugin, $product_ids, $invCnt, $invVar, $prdCnt, $prdVar, $start, $end, $coupons = array())
 {
     $invoiceLimit = $this->getLimit($invCnt, $invVar);
     for ($j = 1; $j <= $invoiceLimit; $j++) {
         $tm = mt_rand($start, $end);
         /* @var $invoice Invoice */
         $invoice = $this->getDi()->invoiceTable->createRecord();
         $productLimit = max(1, $this->getLimit($prdCnt, $prdVar));
         for ($k = 1; $k <= $productLimit; $k++) {
             try {
                 $product = Am_Di::getInstance()->productTable->load(array_rand($product_ids));
                 if (!($err = $invoice->isProductCompatible($product))) {
                     $invoice->add($product, 1);
                 }
             } catch (Am_Exception_InputError $e) {
             }
         }
         if (!count($invoice->getItems())) {
             continue;
         }
         if (count($coupons) && rand(1, 5) == 5) {
             $invoice->setCouponCode($coupons[array_rand($coupons)]);
             $invoice->validateCoupon();
         }
         $invoice->tm_added = sqlTime($tm);
         $invoice->setUser($user);
         $invoice->calculate();
         $invoice->setPaysystem($payplugin->getId());
         $invoice->save();
         $this->getDi()->setService('dateTime', new DateTime('@' . $tm));
         if ($invoice->isZero()) {
             $tr = new Am_Paysystem_Transaction_Free($this->getDi()->plugins_payment->loadGet('free'));
             $tr->setInvoice($invoice)->setTime(new DateTime('@' . $tm))->process();
         } else {
             $tr = new Am_Paysystem_Transaction_Manual($payplugin);
             $tr->setAmount($invoice->first_total)->setInvoice($invoice)->setTime(new DateTime('@' . $tm))->setReceiptId('demo-' . substr(sprintf('%.4f', microtime(true)), -7))->process();
             //recurring payments
             $i = 1;
             while ((double) $invoice->second_total && $invoice->rebill_date < sqlDate($end) && $invoice->rebill_times >= $i && !$invoice->isCancelled()) {
                 $this->getDi()->setService('dateTime', new DateTime('@' . amstrtotime($invoice->rebill_date)));
                 $tr = new Am_Paysystem_Transaction_Manual($payplugin);
                 $tr->setAmount($invoice->second_total)->setInvoice($invoice)->setTime(new DateTime('@' . amstrtotime($invoice->rebill_date)))->setReceiptId('demo-rebill-' . $i++ . '-' . substr(sprintf('%.4f', microtime(true)), -7))->process();
                 if (rand(1, 5) == 5) {
                     //20% probability
                     $invoice->setCancelled(true);
                 }
             }
             //            $cc = $this->createCcRecord($user);
             //
             //            Am_Paysystem_Transaction_CcDemo::_setTime(new DateTime('-'.rand(0,200).' days'));
             //            $payplugin->doBill($invoice, true, $cc);
         }
         $tr = null;
         unset($tr);
         $invoice = null;
         unset($invoice);
     }
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:70,代碼來源:DemoBuilder.php

示例4: isNotAcceptableForInvoice

 public function isNotAcceptableForInvoice(Invoice $invoice)
 {
     if ($invoice->rebill_times) {
         return "Interkassa cannot handle products with recurring payment plan";
     }
     return parent::isNotAcceptableForInvoice($invoice);
 }
開發者ID:irovast,項目名稱:eyedock,代碼行數:7,代碼來源:interkassa.php

示例5: isNotAcceptableForInvoice

 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);
 }
開發者ID:subashemphasize,項目名稱:test_site,代碼行數:7,代碼來源:worldpay.php

示例6: directAction

 public function directAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     list($action, $status, $id) = explode("-", $request->getActionName());
     if ($action != 'status') {
         if ($action != 'ipn' && $action != 'thanks' || $request->get('transaction_status') == 'SETTLED') {
             parent::directAction($request, $response, $invokeArgs);
         }
         return;
     }
     if (!in_array($status, array('return', 'ok', 'fail'))) {
         throw new Am_Exception_InternalError("Bad status-request {$status}");
     }
     if (!$id) {
         throw new Am_Exception_InternalError("Invoice ID is absent");
     }
     if (!($this->invoice = $this->getDi()->invoiceTable->findFirstByPublicId($id))) {
         throw new Am_Exception_InternalError("Invoice not found by id [{$id}]");
     }
     switch ($status) {
         case 'return':
             $url = $request->get('transactionStatus') == 'REJECTED' ? $this->getCancelUrl() : $this->getReturnUrl();
             break;
         case 'ok':
             $url = $this->getReturnUrl();
             break;
         case 'fail':
             $url = $this->getCancelUrl();
             break;
     }
     $response->setRedirect($url);
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:31,代碼來源:paymento.php

示例7: init

 function init()
 {
     parent::init();
     $this->getDi()->productTable->customFields()->add(new Am_CustomFieldText('web_id', '2000Charge.com website ID'));
     $this->getDi()->productTable->customFields()->add(new Am_CustomFieldText(self::PRICEPOINT, 'Mapping code given by 2000Charge'));
     $this->getDi()->productTable->customFields()->add(new Am_CustomFieldSelect('payment_option', 'Payment Option', 'Display Only Specified Payment Options', null, array('options' => $this->payment_options)));
 }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:7,代碼來源:charge2000.php

示例8: directAction

 function directAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     if ($request->getActionName() == 'ipn') {
         echo 'OK';
     }
     return parent::directAction($request, $response, $invokeArgs);
 }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:7,代碼來源:paymentwall.php

示例9: directAction

 public function directAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     if ($request->getFiltered('INVNUM', $request->getFiltered('INVOICE')) == '') {
         $response->setRedirect($this->getRootUrl() . '/thanks');
     } else {
         parent::directAction($request, $response, $invokeArgs);
     }
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:8,代碼來源:payflow-link.php

示例10: init

 function init()
 {
     parent::init();
     $opt = array('' => 'Using plugin settings');
     if ($this->isConfigured()) {
         Am_Di::getInstance()->productTable->customFields()->add(new Am_CustomFieldSelect('bitpay_speed_risk', 'Bitpay speed/risk', null, null, array('options' => $opt + $this->transactionSpeedOptions)));
     }
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:8,代碼來源:bitpay.php

示例11: directAction

 public function directAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     if ($request->getActionName() == 'thanks') {
         return $this->thanksAction($request, $response, $invokeArgs);
     } else {
         return parent::directAction($request, $response, $invokeArgs);
     }
 }
開發者ID:subashemphasize,項目名稱:test_site,代碼行數:8,代碼來源:clickbank.php

示例12: directAction

 public function directAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     try {
         parent::directAction($request, $response, $invokeArgs);
     } catch (Am_Exception_Paysystem_TransactionInvalid $ex) {
         //nothing
     }
     echo 'ok';
 }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:9,代碼來源:ccnow.php

示例13: directAction

 function directAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     try {
         parent::directAction($request, $response, $invokeArgs);
     } catch (Exception $e) {
         $this->getDi()->errorLogTable->logException($e);
     }
     echo "<!--success-->";
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:9,代碼來源:multicards.php

示例14: _initSetupForm

 public function _initSetupForm(Am_Form_Setup $form)
 {
     $form->addText('vendor_name')->setLabel(array('Client ID', 'Your Client ID will be supplied when your service is activated. 
                                         It will be in the format “ABC01”, where ABC is your organisation’s
                                         unique three letter code. 
                                         It is used for logging into the NAB Transact administration, reporting and search tool.'));
     $form->addAdvCheckbox('testing')->setLabel('Test Mode');
     parent::_initSetupForm($form);
 }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:9,代碼來源:nab.php

示例15: getConfig

 function getConfig($key = null, $default = null)
 {
     switch ($key) {
         case 'auto_create':
             return true;
         default:
             return parent::getConfig($key, $default);
     }
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:9,代碼來源:justclick.php


注:本文中的Am_Paysystem_Abstract類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。