/** * @return string */ public function getMode() { $mode = $this->config->getMode(); if ($mode === static::MODE_LIVE) { return static::MODE_LIVE; } return static::MODE_TEST; }
/** * @param \Generated\Shared\Transfer\PayonePaymentTransfer $paymentTransfer * * @return \Orm\Zed\Payone\Persistence\SpyPaymentPayone */ protected function savePayment(PayonePaymentTransfer $paymentTransfer) { $payment = new SpyPaymentPayone(); $payment->fromArray($paymentTransfer->toArray()); if ($payment->getReference() === null) { $orderEntity = $payment->getSpySalesOrder(); $payment->setReference($this->config->generatePayoneReference($paymentTransfer, $orderEntity)); } $payment->save(); return $payment; }