see 'order_id' => $order->order_id,
$order is undefined here and is set twice
'order_id' => $response['order_id']

i think you want to remove 'order_id' => $order->order_id

function commerce_paypal_ec_response_capture_to_ipn($response) {
  //[AUTHORIZATIONID] => 2XK37250HF054033G
  //[TIMESTAMP] => 2012-04-26T22:32:05Z
  //[CORRELATIONID] => 64b9f801bc7fd
  //[ACK] => Success
  //[VERSION] => 88.0
  //[BUILD] => 2840849
  //[TRANSACTIONID] => 4SP62657MF722500N
  //[PARENTTRANSACTIONID] => 2XK37250HF054033G
  //[RECEIPTID] => 0292-6201-9458-9117
  //[TRANSACTIONTYPE] => expresscheckout
  //[PAYMENTTYPE] => instant
  //[ORDERTIME] => 2012-04-26T22:32:03Z
  //[AMT] => 220.00
  //[FEEAMT] => 8.88
  //[TAXAMT] => 0.00
  //[CURRENCYCODE] => USD
  //[PAYMENTSTATUS] => Completed
  //[PENDINGREASON] => None
  //[REASONCODE] => None
  //[PROTECTIONELIGIBILITY] => PartiallyEligible
  //[PROTECTIONELIGIBILITYTYPE] => ItemNotReceivedEligible

  $ipn = array(
    'auth_id' => $response['AUTHORIZATIONID'],
    'ipn_id' => $response['RECEIPTID'],
    'txn_id' => $response['TRANSACTIONID'],
    'txn_type' => $response['TRANSACTIONTYPE'],
    'order_id' => $order->order_id,
    'transaction_id' => $response['transaction_id'],
    'mc_gross' => $response['AMT'],
    'mc_currency' => $response['CURRENCYCODE'],
    'mc_fee' => $response['FEEAMT'],
    'payment_status' => $response['PAYMENTSTATUS'],
    'payment_type' => $response['PAYMENTTYPE'],
    'pending_reason' => $response['PENDINGREASON'],
    'order_id' => $response['order_id'],
  );

  return $ipn; 
}

Comments

citlacom’s picture

Status: Active » Closed (fixed)

Thanks for the report @e-anima was fixed in commit http://drupalcode.org/project/commerce_paypal_ec.git/commit/6d18a52