You are here

public function PayPalPaymentNVPAPIPaymentMethodControllerBase::NVPAPIParseResponse in PayPal for Payment 7

Parses an API response.

Parameters

string $response:

Return value

array

1 call to PayPalPaymentNVPAPIPaymentMethodControllerBase::NVPAPIParseResponse()
PayPalPaymentNVPAPIPaymentMethodControllerBase::NVPAPIRequest in paypal_payment/includes/PayPalPaymentNVPAPIPaymentMethodControllerBase.inc
Executes an API request.

File

paypal_payment/includes/PayPalPaymentNVPAPIPaymentMethodControllerBase.inc, line 79

Class

PayPalPaymentNVPAPIPaymentMethodControllerBase
A base class for payment method controllers that talk to PayPal's NVP API.

Code

public function NVPAPIParseResponse($response) {
  $nvp = array();
  foreach (explode('&', $response) as $variable) {
    $fragments = explode('=', $variable);
    if (count($fragments) == 2) {
      $nvp[$fragments[0]] = urldecode($fragments[1]);
    }
  }
  return $nvp;
}