- A coldfusion application.
- A component to process PayPal transactions.
- A new function to process refunds by transaction ID.
So I had everything tested on the developer site. Things couldn't look better even. I am a great programmer... Until American Express cards keep failing with a peculiar message about invalid field "ORIGID". I pour through the code and see nothing.
But when the component is reloaded into the CF application, credit card processing works again. How strange is that? It must be something with the struct getting messed up.
Not until the next day does it fully dawn on me!
Every PayPal transaction request used the same variable name. The peculiar thing about Coldfusion is that a variable set in one component function is available to the other functions in the component UNLESS specified in the <cfset> declaration. On the development site, this was never exibited because the component is reloaded on every call. When on the live site, the component and it's variables are cached in the application.
Just reseting the struct before setting it's properties with a simple StructNew() call. So simple, but such an unexpected behavior of coldfusion. I suppose the best programmer would always redeclare their variable anyways, but this is a continuous learning process.