Had everything working in sandbox, using PHP AIM.
Management decided to give price breaks, so now I have to check a button on the form and assign the transaction amount based on the user input.
For some reason this is breaking:
$transaction = new AuthorizeNetAIM(API_Login_ID,Transaction_Key);//my test ID and Key if (defined(PKG_PRICE)) { die("PKG_PRICE is defined..."); $transaction->amount = PKG_PRICE; } else { echo "making a good assignment now..."; $transaction->amount = $this_pkg_price; } echo "the transaction amount is supposed to be $this_pkg_price, but it's coming up as: "; echo ($transaction->amount);exit;
And my output is "making a good assignment now", then "making a good assignment now
the transaction amount is supposed to be 2950, but it's coming up as: "
$transaction passes is_object(). $this_pkg_price is obviously set.
It's 4 PM here and must be something simple....
Solved! Go to Solution.
11-19-2013 02:16 PM
Well, not sure why it's not working that way --- like I said, it seemed to have been working before.
As I suspected, though, it does work if we use our own variable as the first arg to the AuthorizeandCapture function:
$response = $transaction->authorizeAndCapture($my_special_price_variable);
I can code around that. Thanks for the help.
11-21-2013 09:48 AM
is null or just your echo is not displaying? why did you have that is a seperated line?
11-19-2013 03:05 PM
@RaynorC1emen7 wrote:is null or just your echo is not displaying? why did you have that is a seperated line?
Heavy debugging, Raynor.
11-20-2013 06:28 AM
To further elaborate, "null" is an understatement. $transaction->amount is (apparently) not even set.
I'm currently operating under the assumption that the cause of this issue is that the variable is protected inside the AuthorizeNetAIM object.
However, I could swear that the code was working last week with simply "$transaction->amount = $variable;"
I'm sure I'll knock it, given enough time ... would appreciate any insight, though.
11-20-2013 10:01 AM
are you sure you wasn't using
setFields
$transaction->amount isn't it for the response?
11-20-2013 11:14 AM - edited 11-20-2013 11:14 AM
Well, not sure why it's not working that way --- like I said, it seemed to have been working before.
As I suspected, though, it does work if we use our own variable as the first arg to the AuthorizeandCapture function:
$response = $transaction->authorizeAndCapture($my_special_price_variable);
I can code around that. Thanks for the help.
11-21-2013 09:48 AM