You are here

protected function Payflow::prepareBody in Commerce PayPal 8

Prepares the request body to name/value pairs.

Parameters

array $parameters: The request parameters.

Return value

string The request body.

1 call to Payflow::prepareBody()
Payflow::executeTransaction in src/Plugin/Commerce/PaymentGateway/Payflow.php
Post a transaction to the Payflow server and return the response.

File

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

Class

Payflow
Provides the PayPal Payflow payment gateway.

Namespace

Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway

Code

protected function prepareBody(array $parameters = []) {
  $parameters = $this
    ->getParameters($parameters);
  $values = [];
  foreach ($parameters as $key => $value) {
    $values[] = strtoupper($key) . '=' . $value;
  }
  return implode('&', $values);
}