123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Sales\Model\Order\Payment\Transaction;
- use Magento\Sales\Api\Data\OrderInterface;
- use Magento\Sales\Api\Data\OrderPaymentInterface;
- use Magento\Sales\Api\Data\TransactionInterface;
- /**
- * Interface BuilderInterface
- * Create transaction,
- * prepare its insertion into hierarchy and add its information to payment and comments
- */
- interface BuilderInterface
- {
- /**
- * Sets payment data for creating transaction
- *
- * @param OrderPaymentInterface $payment
- * @return $this
- */
- public function setPayment(OrderPaymentInterface $payment);
- /**
- * Sets order for creating transaction
- *
- * @param OrderInterface $order
- * @return $this
- */
- public function setOrder(OrderInterface $order);
- /**
- * Sets sales entity for creating transaction
- * If the sales document is specified, it will be linked to the transaction as related for future usage.
- * Currently transaction ID is set into the sales object
- * This method writes the added transaction ID into last_trans_id field of the payment object
- *
- * @param \Magento\Sales\Model\AbstractModel $document
- * @return $this
- */
- public function setSalesDocument(\Magento\Sales\Model\AbstractModel $document);
- /**
- * Sets failSafe flag
- * To make sure transaction object won't cause trouble before saving, use $failsafe = true
- *
- * @param bool $failSafe
- * @return $this
- */
- public function setFailSafe($failSafe);
- /**
- * Sets message
- *
- * @param string $message
- * @return $this
- */
- public function setMessage($message);
- /**
- * Sets transaction id
- * For getting rid of TransactionId in Payment model in future
- *
- * @param string|null $transactionId
- * @return $this
- */
- public function setTransactionId($transactionId);
- /**
- * Sets an array to additional information
- *
- * @param array $value
- * @return $this
- */
- public function setAdditionalInformation(array $value);
- /**
- * Add element to additional information
- *
- * @param string $key
- * @param string $value
- * @return $this
- */
- public function addAdditionalInformation($key, $value);
- /**
- * Resets state
- *
- * @return $this
- */
- public function reset();
- /**
- * Build transaction.
- * Transaction type is required
- *
- * @param string $type
- * @return TransactionInterface
- */
- public function build($type);
- }
|