コード例 #1
0
ファイル: OrderManager.php プロジェクト: spryker/Payone
 /**
  * @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();
 }
コード例 #2
0
ファイル: PaymentManager.php プロジェクト: spryker/Payone
 /**
  * @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;
 }