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


PHP Am_Paysystem_Result::setErrorMessages方法代码示例

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


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

示例1: _process

 public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
 {
     $vars = $this->getConfig();
     $vars['Amount'] = $invoice->first_total;
     $vars['Currency'] = $invoice->currency;
     $vars['ReturnUrl'] = $this->getPluginUrl('thanks');
     $vars['CancelUrl'] = $this->getCancelUrl();
     $vars['MerchantInvoice'] = $invoice->public_id;
     $vars['MerchantReference'] = $invoice->public_id;
     $vars['CustomerFirstName'] = $invoice->getFirstName();
     $vars['CustomerLastName'] = $invoice->getLastName();
     $vars['CustomerAddress'] = $invoice->getStreet();
     $vars['CustomerCity'] = $invoice->getCity();
     $vars['CustomerState'] = $invoice->getState();
     $vars['InvoiceDescription'] = $invoice->getLineDescription();
     $vars['CustomerCountry'] = $invoice->getCountry();
     $vars['CustomerPhone'] = $invoice->getPhone();
     $vars['CustomerEmail'] = $invoice->getEmail();
     $r = new Am_HttpRequest($this->getUrl() . '?' . http_build_query($vars, '', '&'));
     $response = $r->send()->getBody();
     if (!$response) {
         $this->getDi()->errorLogTable->log('Plugin eWAY: Got empty response from API server');
         $result->setErrorMessages(array(___("An error occurred while handling your payment.")));
         return;
     }
     $xml = simplexml_load_string($response);
     if (!empty($xml->Error)) {
         $this->getDi()->errorLogTable->log('Plugin eWAY: Got error from API: ' . (string) $xml->Error);
         $result->setErrorMessages(array(___("An error occurred while handling your payment.")));
         return;
     }
     $action = new Am_Paysystem_Action_Redirect($xml->URI);
     $result->setAction($action);
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:34,代码来源:eway-sp.php

示例2: validateResponseStatus

 public function validateResponseStatus(Am_Paysystem_Result $result)
 {
     if ($this->response->getStatus() != 200) {
         $result->setErrorMessages(array("Received invalid response from payment server: " . $this->response->getStatus()));
         return false;
     }
     return true;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:8,代码来源:CreditCard.php

示例3: _doBill

 public function _doBill(Invoice $invoice, $doFirst, CcRecord $cc, Am_Paysystem_Result $result)
 {
     $token = $invoice->getUser()->data()->get(self::TOKEN);
     if (!$token) {
         return $result->setErrorMessages(array(___('Payment failed')));
     }
     if ($doFirst && doubleval($invoice->first_total) <= 0) {
         // free trial
         $tr = new Am_Paysystem_Transaction_Free($this);
         $tr->setInvoice($invoice);
         $tr->process();
         $result->setSuccess($tr);
     } else {
         $tr = new Am_Paysystem_Transaction_Paymill($this, $invoice, $doFirst);
         $tr->run($result);
     }
 }
开发者ID:grlf,项目名称:eyedock,代码行数:17,代码来源:paymill.php

示例4: _process

 public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
 {
     include_once dirname(__FILE__) . '/SOPGClassicMerchantClient.php';
     $client = new SOPGClassicMerchantClient($this->getConfig('testing') ? self::TEST_API_URL : self::LIVE_API_URL);
     $mtid = $invoice->public_id;
     //$this->generateMtid();
     // SEE par.2
     if ($invoice->first_total > 1000) {
         throw new InvalidArgumentException('The maximum amount value of dispositions is 1000.00');
     }
     // see par.2
     $request = array($this->getConfig('login'), $this->getConfig('password'), $mtid, null, sprintf('%.2f', $invoice->first_total), $invoice->currency, urlencode($this->getReturnUrl()), urlencode($this->getPluginUrl('cancelpaysafecart') . "?id=" . $invoice->getSecureId('CANCEL')), $invoice->getUserId(), urlencode($this->getPluginUrl()), null);
     $this->logRequest($request);
     $response = call_user_func_array(array($client, 'createDisposition'), $request);
     $this->logResponse(get_object_vars($response));
     if ($response->resultCode != 0 || $response->errorCode != 0) {
         // SEE par.4
         $result->setErrorMessages(array('Transaction could not be initiated due to connection problems.'));
         //$result->setErrorMessages(array('Error during request to paysafecard server'));
         // see par.4
         return;
     }
     $a = new Am_Paysystem_Action_Redirect($this->getConfig('testing') ? self::TEST_REDIRECT_URL : self::LIVE_REDIRECT_URL);
     $a->mid = $response->mid;
     $a->mtid = $mtid;
     $a->amount = sprintf('%.2f', $invoice->first_total);
     $a->currency = $invoice->currency;
     $result->setAction($a);
 }
开发者ID:grlf,项目名称:eyedock,代码行数:29,代码来源:paysafecard.php


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