@param array $data
@param string|null $type

@return AbstractPaymentMethod
424651
public function factoryFromArray(array $data, $type = null)
    {
        if ($type === null) {
            if (array_key_exists('type', $data)) {
                $type = $data['type'];
                unset($data['type']);
            } else {
                throw new \InvalidArgumentException(
                    'Parameter type not specified in PaymentDataFactory.factoryFromArray()'
                );
            }
        }

        $paymentData = $this->factory($type);
        $this->fillModel($paymentData, $data);

        return $paymentData;
    }
1269425
public function pack(string $type, array $data): string
    {
        return $this->getPacker()->pack($type, $data);
    }
1241352
private function convertArrayToPg($data, ArrayType $type)
    {
        $array = [];

        foreach ($data as $row) {
            $array[] = $this->toPg($row, $type->getSubType());
        }

        return new Set($array, $type);
    }
843639
public function sendData($data)
    {
        $response = $this->gocardless->payments()->update($data['paymentId'], $data['paymentData']);

        return $this->response = new PaymentResponse($this, $response);
    }
327164
public function fromPg($data, $type, Session $session)
    {
        $data = trim($data);

        return
            $data !== ''
            ? $this->createObjectFrom($data)
            : null
            ;
    }
307328
public static function createFromData(array $data)
    {
        if (!isset($data['method'])) {
            throw new DomainException(self::MSG_REQUIRED_METHOD);
        }

        switch ($data['method']) {
            case PaymentMethod::METHOD_ACH:
                $paymentInstrument = new AchInstrument($data);

                break;
            case PaymentMethod::METHOD_CASH:
                $paymentInstrument = new CashInstrument($data);

                break;
            case PaymentMethod::METHOD_PAYMENT_CARD:
                $paymentInstrument = new PaymentCardInstrument($data);

                break;
            case PaymentMethod::METHOD_PAYPAL:
                $paymentInstrument = new PayPalInstrument($data);

                break;
            default:
                throw new DomainException(
                    sprintf(self::MSG_UNSUPPORTED_METHOD, implode(',', self::$supportMethods))
                );
        }

        return $paymentInstrument;
    }
563955
private function convertCompositeToPg($data, TypeInterface $type)
    {
        $mapping = $this->getMapping($type);

        if ($normalizer = $this->getNormalizer($type)) {
            $data = $normalizer->toPg($data, [
                'mapping' => $mapping,
            ]);
        }

        $fragments = [];

        foreach ($mapping as $field => $fieldType) {
            if (!isset($data[$field])) {
                $fragments[$field] = $fieldType instanceof ArrayType ? new Set([], $fieldType) : new Value('null');

                continue;
            }

            $fragments[$field] = $this->toPg($data[$field], $fieldType);
        }

        return new Row($fragments, $type);
    }
257355
public function create(array &$data = null) {
		$modelClass = $this->getModelClass();

		$model = $modelClass::factory($data);
		$model->setDatagate($this);

		if ($this->hasLocator()) {
			$model->setLocator($this->getLocator());
		}

		if (empty($data)) {
			$model->forceInsert();
		}

		return $model;
	}
510826
public function createAndSubmitForm($type, $data = null, callable $validCallback = null)
    {
        $form = $this->createForm($type, $data);

        if ($this->isPost()) {
            $form->handleRequest($this->getRequest());

            if ($form->isValid()) {
                if ($validCallback) {
                    $response = $validCallback($form->getData(), $form);

                    if($response instanceof Response)

                        return $response;
                }
            }
        }

        return $form->createView();
    }
834415
public function build( $data = null, $type = null ) {

		if ( ! empty( $data ) ) {
			$this->set_data( $data );
		}

		if ( ! empty( $type ) && in_array( $type, $this->types, true ) ) {
			$this->type = $type;
		}

		if ( method_exists( $this, "build_{$this->type}" ) ) {
			call_user_func( array( $this, 'build_' . $this->type ) );
		}

		return $this->data;
	}
134274
private function setPayRequestDetails($data)
    {
        $this->post = $this->setRequestData([
            'actionType'   => 'PAY',
            'currencyCode' => $this->currency,
            'receiverList' => [
                'receiver' => $data['receivers'],
            ],
            'returnUrl'       => $data['return_url'],
            'cancelUrl'       => $data['cancel_url'],
            'requestEnvelope' => $this->setEnvelope(),
            'feesPayer'       => $data['payer'],
        ])->filter(function ($value, $key) {
            return (($key === 'feesPayer') && empty($value)) ? null : $value;
        });
    }
34695
public function sendData($data)
    {
        $response = $this->gocardless->payments()->retry($data['paymentId']);

        return $this->response = new PaymentResponse($this, $response);
    }
798694
public function createPaymentForm(array $data)
    {
        $this->ensureApiIsConfigured();

        try {
            $data = $this
                ->getRequestOptionsResolver()
                ->resolve($data);
        } catch (ExceptionInterface $e) {
            throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
        }

        $fields = [
            'TPE'         => $this->config['tpe'],
            'date'        => $data['date'],
            'montant'     => $data['amount'] . $data['currency'],
            'reference'   => $data['reference'],
            'texte-libre' => $data['comment'],
            'version'     => static::VERSION,
            'lgue'        => $data['locale'],
            'societe'     => $this->config['company'],
            'mail'        => $data['email'],
        ];

        $macData = array_values($fields);

        $fields['texte-libre'] = $this->htmlEncode($data['comment']);

        if (!empty($data['schedule'])) {
            $macData[] = $fields['nbrech'] = count($data['schedule']);

            $count = 0;
            foreach ($data['schedule'] as $datum) {
                $count++;
                $macData[] = $fields['dateech' . $count] = $datum['date'];
                $macData[] = $fields['montantech' . $count] = $datum['amount'] . $data['currency'];
            }

            // Fills empty schedule
            for ($i = 2 * $count + 10; $i < 18; $i++) {
                $macData[] = null;
            }

            $options = [];
            foreach ($data['options'] as $key => $value) {
                $options = "$key=$value";
            }
            $macData[] = $fields['options'] = implode('&', $options);
        }

        $fields['MAC'] = $this->computeMac($macData);

        $fields['url_retour'] = $data['return_url'];
        $fields['url_retour_ok'] = $data['success_url'];
        $fields['url_retour_err'] = $data['failure_url'];

        return [
            'action' => $this->getEndpointUrl(static::TYPE_PAYMENT),
            'method' => 'POST',
            'fields' => $fields,
        ];
    }
252556
public function make( array $data = null )
    {

        if( !$this->makeableSafetyCheck() ) {
            return null;
        }

        $entity = $this->entityFactory();
        if( $data !== null ) {
            $entity->set(
                $data,
                // as data is a array the second argument doesn't make much sense here
                null,
                // set the inital values and see that the correct input validation happens
                $entity->inputValidate
             );
        }
        return $entity;

    }
1193042
public function format(Int $money, String $type = NULL) : String
    {
        return Converter::money($money, $type);
    }
1300939
protected function createOrder(array $data = null)
    {
        $order = new Order();
        if ($data !== null) {
            $order->setData($data);
        }
        return $order;
    }
398845
public function log($type = null, $data = [])
    {
        if (!func_num_args()) {
            return $this->_log;
        }
        $this->report($type, $this->log()->add($type, $data));
    }