Are you trying to reference the product id or the Model number? The original code referenced the order_product_id (see below) but that created a problem when I tried to specifiy which product was affected by a particular affiliate campaign. To solve the problem, I changed the reference to model. It has worked ever since. It sounds like you are trying to reference the item by product Id which is generated within ubercart . The model number is the number you define when you create a product.
Let me know if this helps at all....
here is a part of what I told Peter at the time..
I changed the referenced variable in your pap module as follows
line 331 // $return .= "sale". $i .".setProductID('". $sale->order_product_id."');\n";
correction $return .= "sale". $i .".setProductID('". $sale->model."');\n";