You are here

protected function Payflow::prepareResult in Commerce PayPal 8

Prepares the result of a request.

Parameters

string $body: The result.

Return value

array An array of the result values.

1 call to Payflow::prepareResult()
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 281

Class

Payflow
Provides the PayPal Payflow payment gateway.

Namespace

Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway

Code

protected function prepareResult($body) {
  $responseParts = explode('&', $body);
  $result = [];
  foreach ($responseParts as $bodyPart) {
    list($key, $value) = explode('=', $bodyPart, 2);
    $result[strtolower($key)] = $value;
  }
  return $result;
}