Example #1
0
 public function refund(Varien_Object $payment, $amount)
 {
     if (Mage::getStoreConfig('billmate/settings/activation')) {
         $k = Mage::helper('billmateinvoice')->getBillmate(true, false);
         $invoiceId = $payment->getMethodInstance()->getInfoInstance()->getAdditionalInformation('invoiceid');
         $values = array('number' => $invoiceId);
         $paymentInfo = $k->getPaymentInfo($values);
         if ($paymentInfo['PaymentData']['status'] == 'Paid' || $paymentInfo['PaymentData']['status'] == 'Factoring') {
             $values['partcredit'] = false;
             $result = $k->creditPayment(array('PaymentData' => $values));
             if (isset($result['code'])) {
                 Mage::throwException(utf8_encode($result['message']));
             }
             if (!isset($result['code'])) {
                 $payment->setTransactionId($result['number']);
                 $payment->setIsTransactionClosed(1);
             }
         }
     }
     return $this;
 }
Example #2
0
 /**
  * @return bool
  */
 protected function canUseOrderId(Varien_Object $payment)
 {
     $methodInstance = $payment->getMethodInstance();
     return $this->getConfig()->getInlineOrderReference() == Netresearch_OPS_Model_Payment_Abstract::REFERENCE_ORDER_ID && ($methodInstance instanceof Netresearch_OPS_Model_Payment_DirectLink && 0 < strlen(trim($methodInstance->getConfigPaymentAction())));
 }
Example #3
0
 public function authorize(Varien_Object $payment, $amount)
 {
     if ($amount <= 0) {
         Mage::throwException(Mage::helper('paygate')->__('Invalid amount for capture.'));
     }
     $method = $payment->getMethodInstance();
     $capture = false;
     if ($method->getConfigData('payment_action') == self::ACTION_AUTHORIZE_CAPTURE) {
         $capture = true;
     }
     $this->collectPayment($payment, $amount, $capture);
     $token = isset($_POST['payfortToken']) ? $_POST['payfortToken'] : false;
     $email = isset($_POST['payfortEmail']) ? $_POST['payfortEmail'] : false;
     $payment->setAdditionalInformation('payment_type', $this->getConfigData('payment_action'));
     $payment->setAdditionalInformation('token', array('token' => $token, 'email' => $email));
     return $this;
 }
Example #4
0
 /**
  * Method sets additional request parameters due to the type of the payment method
  * @param Varien_Object $request
  * @param Varien_Object $payment
  */
 protected function _setAdditionalRequestParameters($request, $payment)
 {
     if (!$payment->getMethodInstance() instanceof Enterprise_Pbridge_Model_Payment_Method_Paypal_Interface) {
         return;
     }
     $request->setData('additional_params', array('BNCODE' => Mage::getModel('paypal/config')->getBuildNotationCode()));
 }