You are here

public static function PayPalPaymentIPNController::process in PayPal for Payment 7

Processes an IPN.

Parameters

array $ipn_variables:

Return value

\PaymentStatusItem The new payment status item.

3 calls to PayPalPaymentIPNController::process()
PayPalPaymentIPNControllerTest::testProcess in paypal_payment_ipn/tests/PayPalPaymentIPNControllerTest.test
Test process().
paypal_payment_ipn_post in paypal_payment_ipn/paypal_payment_ipn.module
Processes an IPN request based on POST data.
paypal_payment_pps_return in paypal_payment_pps/paypal_payment_pps.module
Return callback.

File

paypal_payment_ipn/includes/PayPalPaymentIPNController.inc, line 165

Class

PayPalPaymentIPNController
Provides IPN functionality.

Code

public static function process(array $ipn_variables) {
  $pid = self::PID($ipn_variables['invoice']);
  $payment = entity_load_single('payment', $pid);
  if ($payment->method->controller instanceof PayPalPaymentIPNPaymentMethodControllerInterface) {
    $payment->method->controller
      ->PayPalProcessIPN($payment, $ipn_variables);
  }
  $new_status = new PaymentStatusItem(self::convertStatus($ipn_variables));
  $new_status->ipn = new PayPalPaymentIPN($ipn_variables);
  $payment
    ->setStatus($new_status);
  entity_save('payment', $payment);
  return $new_status;
}