eldan88 Posted May 9, 2013 Share Posted May 9, 2013 Hey Guys! I am trying to check to see if more then one constant is defined before processing a payment. However I cant seem to find a way to check if API and transaction_key constant is defined. Below is the code I am trying to work, so far I just have one constant defined Any help would be super apperciated. define("API", "API_LOGIN"); define ("transaction_key", "TRANSACTION_KEY"); if(defined("API" )) { $amount = '10.00'; $card_number = '4007000000027'; $exp_date = '10/16'; $transaction = new AuthorizeNetAIM(API, transaction_key); $transaction->amount = $amount; $transaction->card_num = $card_number; $transaction->exp_date = $exp_date; } Quote Link to comment https://forums.phpfreaks.com/topic/277841-how-to-check-if-more-than-1-constant-is-defined/ Share on other sites More sharing options...
Solution Psycho Posted May 9, 2013 Solution Share Posted May 9, 2013 if(defined("API") && defined("transaction_key")) { Quote Link to comment https://forums.phpfreaks.com/topic/277841-how-to-check-if-more-than-1-constant-is-defined/#findComment-1429320 Share on other sites More sharing options...
eldan88 Posted May 11, 2013 Author Share Posted May 11, 2013 if(defined("API") && defined("transaction_key")) { Thank you. Seemed like a no brainder Quote Link to comment https://forums.phpfreaks.com/topic/277841-how-to-check-if-more-than-1-constant-is-defined/#findComment-1429634 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.