/** * @param \Orm\Zed\Payone\Persistence\SpyPaymentPayone $payment * @param \Generated\Shared\Transfer\PaymentDetailTransfer $paymentDetailTransfer * * @return void */ protected function savePaymentDetail(SpyPaymentPayone $payment, PaymentDetailTransfer $paymentDetailTransfer) { $paymentDetailEntity = new SpyPaymentPayoneDetail(); $paymentDetailEntity->setSpyPaymentPayone($payment); $paymentDetailEntity->fromArray($paymentDetailTransfer->toArray()); $paymentDetailEntity->save(); }
/** * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer * * @return \Generated\Shared\Transfer\PayonePaymentTransfer */ protected function getPayment(OrderTransfer $orderTransfer) { $payment = $this->queryContainer->getPaymentByOrderId($orderTransfer->getIdSalesOrder())->findOne(); $paymentDetail = $payment->getSpyPaymentPayoneDetail(); $paymentDetailTransfer = new PaymentDetailTransfer(); $paymentDetailTransfer->fromArray($paymentDetail->toArray(), true); $paymentTransfer = new PayonePaymentTransfer(); $paymentTransfer->fromArray($payment->toArray(), true); $paymentTransfer->setPaymentDetail($paymentDetailTransfer); return $paymentTransfer; }