public function createTransaction(Customweb_Payment_Authorization_Iframe_ITransactionContext $transactionContext, $failedTransaction) { $transaction = new Customweb_Saferpay_Authorization_Transaction($transactionContext); $transaction->setAuthorizationMethod(self::AUTHORIZATION_METHOD_NAME); $transaction->setLiveTransaction(!$this->getConfiguration()->isTestMode()); return $transaction; }
/** * Copy important data from the initial transaction to the new transaction. * * @param Customweb_Saferpay_Authorization_Transaction $initialTransaction * @param Customweb_Saferpay_Authorization_Transaction $recurringTransaction */ protected function useInitialTransactionData(Customweb_Saferpay_Authorization_Transaction $initialTransaction, Customweb_Saferpay_Authorization_Transaction $recurringTransaction) { $recurringTransaction->setCardRefId($initialTransaction->getCardRefId()); $recurringTransaction->setCardExpiryDate($initialTransaction->getCardExpiryMonth(), $initialTransaction->getCardExpiryYear()); $recurringTransaction->setOwnerName($initialTransaction->getOwnerName()); $recurringTransaction->setTruncatedPAN($initialTransaction->getTruncatedPAN()); $recurringTransaction->setMpiSessionId(null); }
protected function processFormData(Customweb_Saferpay_Authorization_Transaction $transaction, $parameters) { if ($transaction->isUseExistingAlias()) { $transaction->setTransactionState(Customweb_Saferpay_Authorization_Transaction::STATE_ALIAS_EXISTS); $parameters = array_merge($parameters, $transaction->getTransactionContext()->getCustomParameters()); $this->processAuthorization($transaction, $parameters); } else { $this->createAlias($transaction, $parameters); } }
public function __construct(Customweb_Saferpay_Authorization_Transaction $transaction, Customweb_Saferpay_Configuration $configuration, Customweb_DependencyInjection_IContainer $container) { parent::__construct($transaction->getTransactionContext(), $configuration, $container); $this->transaction = $transaction; }
/** * @param Customweb_Saferpay_Authorization_Transaction $transaction * @return Customweb_Payment_Authorization_IAdapter */ protected function getAdapterInstanceByTransaction(Customweb_Saferpay_Authorization_Transaction $transaction) { return $this->getAdapterFactory()->getAuthorizationAdapterByName($transaction->getMotoAuthorizationMethodName()); }
/** * This method desides based on the response parameters from Saferpay if * 3D secure is possible. * * @param array $parameters */ protected function is3DSecurePossible(Customweb_Saferpay_Authorization_Transaction $transaction, $parameters) { return !$transaction->isMoto() && $parameters['RESULT'] == 0 && $parameters['ECI'] == self::ECI_LIABILITY_SHIFT_CUSTOMER_ENROLLED; }
/** * Stores the alias with a hash of the shipping address the alias was created with. * This is used for fraud prevention as an alias can only be resused without * entering the cvc when the shipping address did not change. * * @param Customweb_Saferpay_Authorization_Transaction $transaction */ protected function setAliasAddress(Customweb_Saferpay_Authorization_Transaction $transaction) { $cardrefId = $transaction->getCardRefId(); $orderContext = $transaction->getTransactionContext()->getOrderContext(); $aliasContext = array($cardrefId => $this->getShippingAddressHash($orderContext)); $transaction->getPaymentCustomerContext()->updateMap($aliasContext); }
public function getAuthorizationParameters(Customweb_Saferpay_Authorization_Transaction $transaction, array $parameters) { // We send always the expiration date instead of updating them in the database of the PSP. $parameters['EXP'] = $transaction->getCardExpiryDate(); return $parameters; }