Create new transfer
@param \MangoPay\Transfer $transfer
@return \MangoPay\Transfer Transfer object returned from API
348500
public function Create($transfer, $idempotencyKey = null)
    {
        return $this->CreateObject('transfers_create', $transfer, '\MangoPay\Transfer', null, null, $idempotencyKey);
    }
91597
public function transferCustomerService($account = '')
    {
        $this->message = [
            'CreateTime'   => time(),
            'ToUserName'   => $this->getOpenid(),
            'FromUserName' => $this->getToOpenid(),
            'MsgType'      => 'transfer_customer_service',
        ];
        empty($account) || $this->message['TransInfo'] = ['KfAccount' => $account];
        return $this;
    }
1302511
public function createTransaction($conn = null, $queryMode = Client::NEOCLIENT_QUERY_MODE_WRITE)
    {
        $transaction = new Transaction($conn, $this, $queryMode);

        return $transaction;
    }
448477
protected function convertToPdfTransfer(TransferInterface $transfer, $containerName)
    {
        $documentBuilder = $this->getConverter($containerName);

        $pdfTransfer = new PdfTransfer();
        $pdfTransfer = $documentBuilder->convertToPdfTransfer($transfer, $pdfTransfer);

        return $pdfTransfer;
    }
775978
protected function addPhpName(array $table, PropelSchemaTableTransfer $transfer): PropelSchemaTableTransfer
    {
        if (isset($table['phpName'])) {
            $transfer->setPhpName($table['phpName']);
        }

        if ($transfer->getPhpName() === null) {
            $defaultPropelPhpName = str_replace('_', '', ucwords($transfer->getTableName(), '_'));
            $transfer->setPhpName($defaultPropelPhpName);
        }

        return $transfer;
    }
637633
protected function createPaymentTransfer(OrderTransfer $orderTransfer): ComputopApiRequestTransfer
    {
        $computopApiRequestTransfer = parent::createPaymentTransfer($orderTransfer);
        $computopApiRequestTransfer->setCapture(
            $this->getCaptureType(ComputopApiConfig::PAYMENT_METHOD_PAY_NOW)
        );
        $computopApiRequestTransfer->setOrderDesc($this->getOrderDesc($this->computopApiService, $orderTransfer));

        return $computopApiRequestTransfer;
    }
1153187
public function addTransaction(Transaction $transaction)
    {
        $transaction->setAdvert($this);
        $this->transactions->add($transaction);

        return $this;
    }
1179024
public function newAction(StockTransfer $stockTransfer)
    {
        $stocktransferitem = new StockTransferItem();
        $stocktransferitem->setStockTransfer($stockTransfer);
        $form = $this->createForm(new StockTransferItemType(), $stocktransferitem);

        return array(
            'stocktransferitem' => $stocktransferitem,
            'form' => $form->createView(),
        );
    }
204822
public function deleteDocument(TransferInterface $transfer, $containerName)
    {
        $this->checkTransferMethods($transfer);

        $fileName = $transfer->getFileName();
        $relativePath = $transfer->getRelativePath();

        return $this->fileUploadFacade->deleteFile($containerName, $fileName, $relativePath);
    }
1242764
public function mapBrandTransfer(FosBrandEntityTransfer $brandEntityTransfer): BrandTransfer
    {
        $brandTransfer = new BrandTransfer();

        $brandTransfer->fromArray($brandEntityTransfer->toArray(), true);

        return $brandTransfer;
    }
1361521
public function create($transport)
    {
        if (is_string($transport)) {
            $transport = $this->registry->getTransport($transport);
        }

        if (!$transport instanceof TransportInterface) {
            throw new \InvalidArgumentException('transport should a string or a TransportInterface');
        }

        // If MonologExtension loaded, we inject its logger in Jobflow
        if (null !== ($extension = $this->registry->getExtension('Rezzza\Jobflow\Extension\Monolog\MonologExtension'))) {
            $this->logger = $extension->getLogger();
        }

        return new Jobflow(
            $transport,
            $this->jobFactory,
            new JobMessageFactory,
            new JobContextFactory,
            new ExecutionContextFactory,
            null,
            $this->logger
        );
    }
944224
public function addTransaction(Transaction $transaction)
    {
        $transaction->setAgreement($this);
        $this->transactions->add($transaction);

        return $this;
    }
1351625
public function placeRequest(TransferInterface $transferObject) {
        
        if ($this->gatewayResponseHolder->hasCallbackResponse()) {
            $response = $this->gatewayResponseHolder->getGatewayResponse();

            $this->logger->debug([
                'action'    => 'callback',
                'response'  => $response,
            ]);

            return $response;
        }

        // Prepare the transfert data
        $this->prepareTransfer($transferObject);

        // Update the email field for guest users
        $this->updateGuestEmail($this->body);

        // Prepare some log data
        $log = [
            'request'           => $this->body,
            'request_uri'       => $this->fullUri,
            'request_headers'   => $transferObject->getHeaders(),
            'request_method'    => $this->getMethod(),
        ];

        $result = [];

        $client = $this->clientFactory;
        $client->setConfig($transferObject->getClientConfig());
        
        $client->setMethod($this->getMethod());

        switch($this->getMethod()) {
            case \Zend_Http_Client::GET:
                $client->setRawData( json_encode($this->body) ) ;
                break;
            case \Zend_Http_Client::POST:
                $client->setRawData( json_encode($this->body) ) ;
                break;
            default:
                throw new \LogicException( sprintf('Unsupported HTTP method %s', $transferObject->getMethod()) );
        }

        $client->setHeaders($transferObject->getHeaders());
        $client->setUri($this->fullUri);
        
        try {
            $response           = $client->request();
            
            $result             = json_decode($response->getBody(), true);
            $log['response']    = $result;

            if( array_key_exists('errorCode', $result) ) {
                $exception = new ApiClientException($result['message'], $result['errorCode'], $result['eventId']);

                $this->messageManager->addErrorMessage( $exception->getFullMessage() );

                throw $exception;
            }
        }
        catch (Zend_Http_Client_Exception $e) {
            throw new ClientException(__($e->getMessage()));
        }
        finally {
            $this->logger->debug($log);
        }

        return $result;
    }
1039749
public function refundPayment(PayoneRefundTransfer $refundTransfer)
    {
        $payonePaymentTransfer = $refundTransfer->getPayment();

        $paymentEntity = $this->getPaymentEntity($payonePaymentTransfer->getFkSalesOrder());
        $paymentMethodMapper = $this->getPaymentMethodMapper($paymentEntity);
        $requestContainer = $paymentMethodMapper->mapPaymentToRefund($paymentEntity);
        $requestContainer->setAmount(0 - $paymentEntity->getSpyPaymentPayoneDetail()->getAmount());
        $requestContainer = $this->prepareOrderItems($refundTransfer->getOrder(), $requestContainer);
        $requestContainer = $this->prepareOrderShipment($refundTransfer->getOrder(), $requestContainer);
        $requestContainer = $this->prepareOrderDiscount($refundTransfer->getOrder(), $requestContainer);

        $this->setStandardParameter($requestContainer);

        $apiLogEntity = $this->initializeApiLog($paymentEntity, $requestContainer);

        $rawResponse = $this->executionAdapter->sendRequest($requestContainer);
        $responseContainer = new RefundResponseContainer($rawResponse);

        $this->updateApiLogAfterRefund($apiLogEntity, $responseContainer);

        $responseMapper = new RefundResponseMapper();
        $responseTransfer = $responseMapper->getRefundResponseTransfer($responseContainer);

        return $responseTransfer;
    }
282268
public function create(Transaction &$transaction)
    {
        $data = $transaction->exportData();
        $endpoint = '/admin/transactions.json';
        $response = $this->request(
            $endpoint, 'POST', array(
            'transaction' => $data
            )
        );
        $transaction->setData($response['transaction']);
    }
1152594
public function Create($wallet, $idempotencyKey = null)
    {
        return $this->CreateObject('wallets_create', $wallet, '\MangoPay\Wallet', null, null, $idempotencyKey);
    }
557492
public function expandProductAbstractTransferWithBrand(ProductAbstractTransfer $productAbstractTransfer): ProductAbstractTransfer
    {
        $productAbstractTransfer->setBrandCollection(new BrandCollectionTransfer());

        $brandCollection = $this->brandReader->getBrandCollectionByIdProductAbstractId(
            $productAbstractTransfer
        );

        if ($brandCollection->getBrands()->count() > 0) {
            $productAbstractTransfer->setBrandCollection($brandCollection);
        }

        return $productAbstractTransfer;
    }