コード例 #1
0
ファイル: BitPayPayment.php プロジェクト: bitpay/xcart-plugin
 public function processReturn(\XLite\Model\Payment\Transaction $transaction)
 {
     parent::processReturn($transaction);
     $result = \XLite\Core\Request::getInstance()->status;
     $status = 'Paid' == $result ? $transaction::STATUS_PENDING : $transaction::STATUS_FAILED;
     $this->transaction->setStatus($status);
 }
コード例 #2
0
ファイル: PaypalWPS.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Get allowed currencies
  * https://developer.paypal.com/docs/classic/api/currency_codes/
  *
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return array
  */
 protected function getAllowedCurrencies(\XLite\Model\Payment\Method $method)
 {
     return array_merge(parent::getAllowedCurrencies($method), array('AUD', 'BRL', 'CAD', 'CZK', 'DKK', 'EUR', 'HKD', 'HUF', 'ILS', 'JPY', 'MYR', 'MXN', 'NOK', 'NZD', 'PHP', 'PLN', 'GBP', 'RUB', 'SGD', 'SEK', 'CHF', 'TWD', 'THB', 'TRY', 'USD'));
 }
コード例 #3
0
 public function isConfigured(\XLite\Model\Payment\Method $method)
 {
     return parent::isConfigured($method) && $method->getSetting('integrationkey');
 }
コード例 #4
0
ファイル: Coinify.php プロジェクト: CoinifySoftware/x-cart
 public function isConfigured(\XLite\Model\Payment\Method $method)
 {
     return parent::isConfigured($method) && $method->getSetting('apiKey') && $method->getSetting('apiSecret') && $method->getSetting('ipnSecret');
 }
コード例 #5
0
ファイル: PaypalAdaptive.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Multivendor must be enabled
  *
  * @param \XLite\Model\Order          $order  Order
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return boolean
  */
 public function isApplicable(\XLite\Model\Order $order, \XLite\Model\Payment\Method $method)
 {
     return $this->canEnable($method) && parent::isApplicable($order, $method);
 }
コード例 #6
0
 /**
  * Process input errors
  *
  * @param array $data Input data
  *
  * @return array
  */
 public function getInputErrors(array $data)
 {
     $errors = parent::getInputErrors($data);
     foreach ($this->getInputDataLabels() as $k => $t) {
         if (!isset($data[$k]) || !$data[$k]) {
             $errors[] = \XLite\Core\Translation::lbl('X field is required', array('field' => $t));
         }
     }
     return $errors;
 }
コード例 #7
0
ファイル: AXPayments.php プロジェクト: kewaunited/xcart
 /**
  * Constructor
  *
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $this->client = new \XLite\Module\CDev\XPaymentsConnector\Core\XPaymentsClient();
 }
コード例 #8
0
ファイル: AuthorizeNetSIM.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Generate transaction ID
  *
  * @param \XLite\Model\Payment\Transaction $transaction Transaction
  * @param string                           $prefix      Prefix OPTIONAL
  *
  * @return string
  */
 public function generateTransactionId(\XLite\Model\Payment\Transaction $transaction, $prefix = null)
 {
     return substr(preg_replace('/\\W/Ss', '', parent::generateTransactionId($transaction, $prefix)), 0, 20);
 }
コード例 #9
0
ファイル: TwoCheckout.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Get allowed currencies
  *
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return array
  */
 protected function getAllowedCurrencies(\XLite\Model\Payment\Method $method)
 {
     return array_merge(parent::getAllowedCurrencies($method), array($method->getSetting('currency')));
 }
コード例 #10
0
ファイル: Quantum.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Log redirect form
  *
  * @param array $list Form fields list
  *
  * @return void
  */
 protected function logRedirect(array $list)
 {
     $list = $this->maskCell($list, 'gwlogin');
     parent::logRedirect($list);
 }
コード例 #11
0
ファイル: OgoneEcommerce.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Process return
  *
  * @param \XLite\Model\Payment\Transaction $transaction Return-owner transaction
  *
  * @return void
  */
 public function processReturn(\XLite\Model\Payment\Transaction $transaction)
 {
     parent::processReturn($transaction);
     $request = \XLite\Core\Request::getInstance();
     static::log(array('request' => $request->getData()));
     $status = '';
     $notes = array();
     if ($request->type == 'accept') {
         $status = $transaction::STATUS_SUCCESS;
         $this->setDetail('result', 'Accept', 'Result');
         $notes[] = 'Accept';
     } elseif ($request->type == 'cancel') {
         $status = $transaction::STATUS_CANCELED;
         $this->setDetail('result', 'Cancel', 'Result');
         $notes[] = 'Cancel';
     } elseif ($request->type == 'decline') {
         $status = $transaction::STATUS_FAILED;
         $this->setDetail('result', 'Decline', 'Result');
         $notes[] = 'Decline';
     } elseif ($request->type == 'exception') {
         $status = $transaction::STATUS_FAILED;
         $this->setDetail('result', 'Exception', 'Result');
         $notes[] = 'Exception';
     } else {
         $status = $transaction::STATUS_FAILED;
         $this->setDetail('result', 'Result is incorrect', 'Result');
         $notes[] = 'Result is incorrect';
     }
     if (!$request->orderID) {
         $status = $transaction::STATUS_FAILED;
         $this->setDetail('order_checking', 'Order ID is empty', 'Checking');
         $notes[] = 'Order ID is empty';
     }
     $fields = $request->getGetData();
     unset($fields['SHASIGN'], $fields['target'], $fields['type'], $fields[self::RETURN_TXN_ID]);
     $hash = $this->generateSign($fields, $this->getSetting('shaOut'));
     if ($hash != $request->SHASIGN) {
         $status = $transaction::STATUS_FAILED;
         $this->setDetail('sha_verification', 'SHA verification failed', 'Verification');
         $notes[] = 'SHA verification failed';
     }
     if (!$this->checkTotal($request->amount)) {
         $status = $transaction::STATUS_FAILED;
         $this->setDetail('total_checking', 'Total checking failed', 'Checking');
         $notes[] = 'Total checking failed';
     }
     if (!$this->checkCurrency($request->CURRENCY)) {
         $status = $transaction::STATUS_FAILED;
         $this->setDetail('currency_checking', 'Currency checking failed', 'Checking');
         $notes[] = 'Currency checking failed';
     }
     $this->transaction->setStatus($status);
     $this->transaction->setNote(implode('. ', $notes));
 }
コード例 #12
0
ファイル: SagePayForm.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Check - payment method is configured or not
  *
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return boolean
  */
 public function isConfigured(\XLite\Model\Payment\Method $method)
 {
     return parent::isConfigured($method) && $method->getSetting('vendorName') && $method->getSetting('password') && $this->isMcryptDecrypt();
 }
コード例 #13
0
ファイル: EPDQ.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Define saved into transaction data schema
  *
  * @return array
  */
 protected function defineSavedData()
 {
     $data = parent::defineSavedData();
     $data['orderID'] = 'Order reference';
     $data['amount'] = 'Order amount';
     $data['currency'] = 'Currency of the order';
     $data['TRXDATE'] = 'Transaction date';
     $data['PM'] = 'Payment method';
     $data['BRAND'] = 'Payment method info';
     $data['ACCEPTANCE'] = 'Acceptance code returned by acquirer';
     $data['STATUS'] = 'Transaction status code';
     $data['PAYID'] = 'Payment reference in ePDQ system';
     $data['NCERROR'] = 'Error code';
     return $data;
 }
コード例 #14
0
ファイル: ESelectHPP.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Check - payment method is configured or not
  *
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return boolean
  */
 public function isConfigured(\XLite\Model\Payment\Method $method)
 {
     return parent::isConfigured($method) && $method->getSetting('store_id') && $method->getSetting('hpp_key');
 }
コード例 #15
0
 /**
  * Check - payment method is configured or not
  *
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return boolean
  */
 public function isConfigured(\XLite\Model\Payment\Method $method)
 {
     return parent::isConfigured($method) && $method->getSetting('testPublicKey') && $method->getSetting('testSecretKey');
 }