protected function capture($transaction, $amount, $id) { $builder = new Customweb_Saferpay_BackendOperation_Adapter_Capture_ParameterBuilder($transaction, $this->getConfiguration(), $this->container); $parameters = $builder->buildParameters(); $parameters['ID'] = $id; // No amount must be send in case of refunds. unset($parameters['AMOUNT']); $this->performPayCompleteAction($parameters, Customweb_I18n_Translation::__('The refund could not be captured.')); }
public function partialCapture(Customweb_Payment_Authorization_ITransaction $transaction, $items, $close) { if (!$transaction instanceof Customweb_Saferpay_Authorization_Transaction) { throw new Exception("The given transaction is not instanceof Customweb_Saferpay_Authorization_Transaction."); } $amount = Customweb_Util_Invoice::getTotalAmountIncludingTax($items); // Check the transaction state $transaction->partialCaptureByLineItemsDry($items, true); $builder = new Customweb_Saferpay_BackendOperation_Adapter_Capture_ParameterBuilder($transaction, $this->getConfiguration(), $this->container); $builder->setAmount($amount); $parameters = $builder->buildParameters(); $this->performPayCompleteAction($parameters, Customweb_I18n_Translation::__('The transaction could not be captured.')); $transaction->partialCaptureByLineItems($items, true); }