You are here

protected function Payflow::executeTransaction in Commerce PayPal 8

Post a transaction to the Payflow server and return the response.

Parameters

array $parameters: The parameters to send (will have base parameters added).

Return value

array The response body data in array format.

5 calls to Payflow::executeTransaction()
Payflow::capturePayment in src/Plugin/Commerce/PaymentGateway/Payflow.php
Captures the given authorized payment.
Payflow::createPayment in src/Plugin/Commerce/PaymentGateway/Payflow.php
Creates a payment.
Payflow::createPaymentMethod in src/Plugin/Commerce/PaymentGateway/Payflow.php
Creates a payment method with the given payment details.
Payflow::refundPayment in src/Plugin/Commerce/PaymentGateway/Payflow.php
TODO: Find a way to store the capture ID.
Payflow::voidPayment in src/Plugin/Commerce/PaymentGateway/Payflow.php
Voids the given payment.

File

src/Plugin/Commerce/PaymentGateway/Payflow.php, line 302

Class

Payflow
Provides the PayPal Payflow payment gateway.

Namespace

Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway

Code

protected function executeTransaction(array $parameters) {
  $body = $this
    ->prepareBody($parameters);
  $response = $this->httpClient
    ->post($this
    ->getApiUrl(), [
    'headers' => [
      'Content-Type' => 'text/namevalue',
      'Content-Length' => strlen($body),
    ],
    'body' => $body,
    'timeout' => 0,
  ]);
  return $this
    ->prepareResult($response
    ->getBody()
    ->getContents());
}