Zen Cart Logo
Forums / Addon Payment Modules / Using Order ID instead of Transaction ID for Purchase Order Field in Payflow Pro

Using Order ID instead of Transaction ID for Purchase Order Field in Payflow Pro

Locked

Views: 3,162

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
26 Jan 2010, 6:23 PM
#1
elizabeth avatar

elizabeth

New Zenner

Join Date:
Oct 2004
Posts:
36
Plugin Contributions:
0

Using Order ID instead of Transaction ID for Purchase Order Field in Payflow Pro

I know some of you are using the Payflow Pro payment module for ZC 1.3.8. What I'd like to do is store the order number in paypal's purchase order field (instead of the transaction ID that is currently there). I've searched the forums and scoured the ZC mod source code, as well as the Paypal SDK. I'm not sure at what point I would stick this in, as I see no reference to the PONUM field, which is where I think it's going. I'm not sure where along the line the transID is getting stored there.

Anybody made that change in their code and want to share, or have some insight in that?

Thanks much!

26 Jan 2010, 7:20 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Using Order ID instead of Transaction ID for Purchase Order Field in Payflow Pro

The problem is that in Zen Cart v1.xx, the store "order number" isn't yet generated when payment is collected. That number is assigned after payment is completed. That's why the number is not sent.

27 Jan 2010, 4:05 PM
#3
elizabeth avatar

elizabeth

New Zenner

Join Date:
Oct 2004
Posts:
36
Plugin Contributions:
0

Re: Using Order ID instead of Transaction ID for Purchase Order Field in Payflow Pro

DrByte:

The problem is that in Zen Cart v1.xx, the store "order number" isn't yet generated when payment is collected. That number is assigned after payment is completed. That's why the number is not sent.

Hmm, ok, thanks. We were using this with 1.3.7 and we were somehow grabbing that number, so I went back and checked the old code. It was providing the next expected order number, lines 269-272:

<code> // Calculate the next expected order id $last_order_id = $db->Execute("select * from " . TABLE_ORDERS . " order by orders_id desc limit 1"); $new_order_id = $last_order_id->fields['orders_id']; $new_order_id = ($new_order_id + 1); </code>

Guess that works, but probably not foolproof ;) It may be enough for our purposes though; maybe I can do a post-transaction verification somehow. Thanks for the insight.

Cheers!
E.