A QCodo powered CMS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

806 lines
42 KiB

  1. <?php
  2. /**
  3. * This is a MetaControl class, providing a QForm or QPanel access to event handlers
  4. * and QControls to perform the Create, Edit, and Delete functionality
  5. * of the AuthorizeNetTransaction class. This code-generated class
  6. * contains all the basic elements to help a QPanel or QForm display an HTML form that can
  7. * manipulate a single AuthorizeNetTransaction object.
  8. *
  9. * To take advantage of some (or all) of these control objects, you
  10. * must create a new QForm or QPanel which instantiates a AuthorizeNetTransactionMetaControl
  11. * class.
  12. *
  13. * Any and all changes to this file will be overwritten with any subsequent
  14. * code re-generation.
  15. *
  16. * @package Quinta CMS
  17. * @subpackage MetaControls
  18. * property-read AuthorizeNetTransaction $AuthorizeNetTransaction the actual AuthorizeNetTransaction data class being edited
  19. * property QLabel $IdControl
  20. * property-read QLabel $IdLabel
  21. * property QListBox $OrderIdControl
  22. * property-read QLabel $OrderIdLabel
  23. * property QLabel $CreationDateControl
  24. * property-read QLabel $CreationDateLabel
  25. * property QTextBox $ResponseCodeControl
  26. * property-read QLabel $ResponseCodeLabel
  27. * property QTextBox $ResponseSubcodeControl
  28. * property-read QLabel $ResponseSubcodeLabel
  29. * property QTextBox $ResponseReasonCodeControl
  30. * property-read QLabel $ResponseReasonCodeLabel
  31. * property QTextBox $ResponseReasonTextControl
  32. * property-read QLabel $ResponseReasonTextLabel
  33. * property QTextBox $AuthorizationCodeControl
  34. * property-read QLabel $AuthorizationCodeLabel
  35. * property QTextBox $TransactionIdControl
  36. * property-read QLabel $TransactionIdLabel
  37. * property QTextBox $TransactionTypeControl
  38. * property-read QLabel $TransactionTypeLabel
  39. * property QFloatTextBox $AmountControl
  40. * property-read QLabel $AmountLabel
  41. * property QTextBox $AvsResponseCodeControl
  42. * property-read QLabel $AvsResponseCodeLabel
  43. * property QTextBox $CcvResponseCodeControl
  44. * property-read QLabel $CcvResponseCodeLabel
  45. * property QTextBox $CavResponseCodeControl
  46. * property-read QLabel $CavResponseCodeLabel
  47. * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
  48. * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
  49. */
  50. class AuthorizeNetTransactionMetaControlGen extends QBaseClass {
  51. // General Variables
  52. protected $objAuthorizeNetTransaction;
  53. protected $objParentObject;
  54. protected $strTitleVerb;
  55. protected $blnEditMode;
  56. // Controls that allow the editing of AuthorizeNetTransaction's individual data fields
  57. protected $lblId;
  58. protected $lstOrder;
  59. protected $lblCreationDate;
  60. protected $txtResponseCode;
  61. protected $txtResponseSubcode;
  62. protected $txtResponseReasonCode;
  63. protected $txtResponseReasonText;
  64. protected $txtAuthorizationCode;
  65. protected $txtTransactionId;
  66. protected $txtTransactionType;
  67. protected $txtAmount;
  68. protected $txtAvsResponseCode;
  69. protected $txtCcvResponseCode;
  70. protected $txtCavResponseCode;
  71. // Controls that allow the viewing of AuthorizeNetTransaction's individual data fields
  72. protected $lblOrderId;
  73. protected $lblResponseCode;
  74. protected $lblResponseSubcode;
  75. protected $lblResponseReasonCode;
  76. protected $lblResponseReasonText;
  77. protected $lblAuthorizationCode;
  78. protected $lblTransactionId;
  79. protected $lblTransactionType;
  80. protected $lblAmount;
  81. protected $lblAvsResponseCode;
  82. protected $lblCcvResponseCode;
  83. protected $lblCavResponseCode;
  84. // QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References
  85. // QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References
  86. /**
  87. * Main constructor. Constructor OR static create methods are designed to be called in either
  88. * a parent QPanel or the main QForm when wanting to create a
  89. * AuthorizeNetTransactionMetaControl to edit a single AuthorizeNetTransaction object within the
  90. * QPanel or QForm.
  91. *
  92. * This constructor takes in a single AuthorizeNetTransaction object, while any of the static
  93. * create methods below can be used to construct based off of individual PK ID(s).
  94. *
  95. * @param mixed $objParentObject QForm or QPanel which will be using this AuthorizeNetTransactionMetaControl
  96. * @param AuthorizeNetTransaction $objAuthorizeNetTransaction new or existing AuthorizeNetTransaction object
  97. */
  98. public function __construct($objParentObject, AuthorizeNetTransaction $objAuthorizeNetTransaction) {
  99. // Setup Parent Object (e.g. QForm or QPanel which will be using this AuthorizeNetTransactionMetaControl)
  100. $this->objParentObject = $objParentObject;
  101. // Setup linked AuthorizeNetTransaction object
  102. $this->objAuthorizeNetTransaction = $objAuthorizeNetTransaction;
  103. // Figure out if we're Editing or Creating New
  104. if ($this->objAuthorizeNetTransaction->__Restored) {
  105. $this->strTitleVerb = QApplication::Translate('Edit');
  106. $this->blnEditMode = true;
  107. } else {
  108. $this->strTitleVerb = QApplication::Translate('Create');
  109. $this->blnEditMode = false;
  110. }
  111. }
  112. /**
  113. * Static Helper Method to Create using PK arguments
  114. * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
  115. * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
  116. * static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to
  117. * edit, or if we are also allowed to create a new one, etc.
  118. *
  119. * @param mixed $objParentObject QForm or QPanel which will be using this AuthorizeNetTransactionMetaControl
  120. * @param integer $intId primary key value
  121. * @param QMetaControlCreateType $intCreateType rules governing AuthorizeNetTransaction object creation - defaults to CreateOrEdit
  122. * @return AuthorizeNetTransactionMetaControl
  123. */
  124. public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  125. // Attempt to Load from PK Arguments
  126. if (strlen($intId)) {
  127. $objAuthorizeNetTransaction = AuthorizeNetTransaction::Load($intId);
  128. // AuthorizeNetTransaction was found -- return it!
  129. if ($objAuthorizeNetTransaction)
  130. return new AuthorizeNetTransactionMetaControl($objParentObject, $objAuthorizeNetTransaction);
  131. // If CreateOnRecordNotFound not specified, throw an exception
  132. else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
  133. throw new QCallerException('Could not find a AuthorizeNetTransaction object with PK arguments: ' . $intId);
  134. // If EditOnly is specified, throw an exception
  135. } else if ($intCreateType == QMetaControlCreateType::EditOnly)
  136. throw new QCallerException('No PK arguments specified');
  137. // If we are here, then we need to create a new record
  138. return new AuthorizeNetTransactionMetaControl($objParentObject, new AuthorizeNetTransaction());
  139. }
  140. /**
  141. * Static Helper Method to Create using PathInfo arguments
  142. *
  143. * @param mixed $objParentObject QForm or QPanel which will be using this AuthorizeNetTransactionMetaControl
  144. * @param QMetaControlCreateType $intCreateType rules governing AuthorizeNetTransaction object creation - defaults to CreateOrEdit
  145. * @return AuthorizeNetTransactionMetaControl
  146. */
  147. public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  148. $intId = QApplication::PathInfo(0);
  149. return AuthorizeNetTransactionMetaControl::Create($objParentObject, $intId, $intCreateType);
  150. }
  151. /**
  152. * Static Helper Method to Create using QueryString arguments
  153. *
  154. * @param mixed $objParentObject QForm or QPanel which will be using this AuthorizeNetTransactionMetaControl
  155. * @param QMetaControlCreateType $intCreateType rules governing AuthorizeNetTransaction object creation - defaults to CreateOrEdit
  156. * @return AuthorizeNetTransactionMetaControl
  157. */
  158. public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  159. $intId = QApplication::QueryString('intId');
  160. return AuthorizeNetTransactionMetaControl::Create($objParentObject, $intId, $intCreateType);
  161. }
  162. ///////////////////////////////////////////////
  163. // PUBLIC CREATE and REFRESH METHODS
  164. ///////////////////////////////////////////////
  165. /**
  166. * Create and setup QLabel lblId
  167. * @param string $strControlId optional ControlId to use
  168. * @return QLabel
  169. */
  170. public function lblId_Create($strControlId = null) {
  171. $this->lblId = new QLabel($this->objParentObject, $strControlId);
  172. $this->lblId->Name = QApplication::Translate('Id');
  173. if ($this->blnEditMode)
  174. $this->lblId->Text = $this->objAuthorizeNetTransaction->Id;
  175. else
  176. $this->lblId->Text = 'N/A';
  177. return $this->lblId;
  178. }
  179. /**
  180. * Create and setup QListBox lstOrder
  181. * @param string $strControlId optional ControlId to use
  182. * @return QListBox
  183. */
  184. public function lstOrder_Create($strControlId = null) {
  185. $this->lstOrder = new QListBox($this->objParentObject, $strControlId);
  186. $this->lstOrder->Name = QApplication::Translate('Order');
  187. $this->lstOrder->Required = true;
  188. if (!$this->blnEditMode)
  189. $this->lstOrder->AddItem(QApplication::Translate('- Select One -'), null);
  190. $objOrderArray = Order::LoadAll();
  191. if ($objOrderArray) foreach ($objOrderArray as $objOrder) {
  192. $objListItem = new QListItem($objOrder->__toString(), $objOrder->Id);
  193. if (($this->objAuthorizeNetTransaction->Order) && ($this->objAuthorizeNetTransaction->Order->Id == $objOrder->Id))
  194. $objListItem->Selected = true;
  195. $this->lstOrder->AddItem($objListItem);
  196. }
  197. return $this->lstOrder;
  198. }
  199. /**
  200. * Create and setup QLabel lblOrderId
  201. * @param string $strControlId optional ControlId to use
  202. * @return QLabel
  203. */
  204. public function lblOrderId_Create($strControlId = null) {
  205. $this->lblOrderId = new QLabel($this->objParentObject, $strControlId);
  206. $this->lblOrderId->Name = QApplication::Translate('Order');
  207. $this->lblOrderId->Text = ($this->objAuthorizeNetTransaction->Order) ? $this->objAuthorizeNetTransaction->Order->__toString() : null;
  208. $this->lblOrderId->Required = true;
  209. return $this->lblOrderId;
  210. }
  211. /**
  212. * Create and setup QLabel lblCreationDate
  213. * @param string $strControlId optional ControlId to use
  214. * @return QLabel
  215. */
  216. public function lblCreationDate_Create($strControlId = null) {
  217. $this->lblCreationDate = new QLabel($this->objParentObject, $strControlId);
  218. $this->lblCreationDate->Name = QApplication::Translate('Creation Date');
  219. if ($this->blnEditMode)
  220. $this->lblCreationDate->Text = $this->objAuthorizeNetTransaction->CreationDate;
  221. else
  222. $this->lblCreationDate->Text = 'N/A';
  223. return $this->lblCreationDate;
  224. }
  225. /**
  226. * Create and setup QTextBox txtResponseCode
  227. * @param string $strControlId optional ControlId to use
  228. * @return QTextBox
  229. */
  230. public function txtResponseCode_Create($strControlId = null) {
  231. $this->txtResponseCode = new QTextBox($this->objParentObject, $strControlId);
  232. $this->txtResponseCode->Name = QApplication::Translate('Response Code');
  233. $this->txtResponseCode->Text = $this->objAuthorizeNetTransaction->ResponseCode;
  234. $this->txtResponseCode->MaxLength = AuthorizeNetTransaction::ResponseCodeMaxLength;
  235. return $this->txtResponseCode;
  236. }
  237. /**
  238. * Create and setup QLabel lblResponseCode
  239. * @param string $strControlId optional ControlId to use
  240. * @return QLabel
  241. */
  242. public function lblResponseCode_Create($strControlId = null) {
  243. $this->lblResponseCode = new QLabel($this->objParentObject, $strControlId);
  244. $this->lblResponseCode->Name = QApplication::Translate('Response Code');
  245. $this->lblResponseCode->Text = $this->objAuthorizeNetTransaction->ResponseCode;
  246. return $this->lblResponseCode;
  247. }
  248. /**
  249. * Create and setup QTextBox txtResponseSubcode
  250. * @param string $strControlId optional ControlId to use
  251. * @return QTextBox
  252. */
  253. public function txtResponseSubcode_Create($strControlId = null) {
  254. $this->txtResponseSubcode = new QTextBox($this->objParentObject, $strControlId);
  255. $this->txtResponseSubcode->Name = QApplication::Translate('Response Subcode');
  256. $this->txtResponseSubcode->Text = $this->objAuthorizeNetTransaction->ResponseSubcode;
  257. $this->txtResponseSubcode->MaxLength = AuthorizeNetTransaction::ResponseSubcodeMaxLength;
  258. return $this->txtResponseSubcode;
  259. }
  260. /**
  261. * Create and setup QLabel lblResponseSubcode
  262. * @param string $strControlId optional ControlId to use
  263. * @return QLabel
  264. */
  265. public function lblResponseSubcode_Create($strControlId = null) {
  266. $this->lblResponseSubcode = new QLabel($this->objParentObject, $strControlId);
  267. $this->lblResponseSubcode->Name = QApplication::Translate('Response Subcode');
  268. $this->lblResponseSubcode->Text = $this->objAuthorizeNetTransaction->ResponseSubcode;
  269. return $this->lblResponseSubcode;
  270. }
  271. /**
  272. * Create and setup QTextBox txtResponseReasonCode
  273. * @param string $strControlId optional ControlId to use
  274. * @return QTextBox
  275. */
  276. public function txtResponseReasonCode_Create($strControlId = null) {
  277. $this->txtResponseReasonCode = new QTextBox($this->objParentObject, $strControlId);
  278. $this->txtResponseReasonCode->Name = QApplication::Translate('Response Reason Code');
  279. $this->txtResponseReasonCode->Text = $this->objAuthorizeNetTransaction->ResponseReasonCode;
  280. $this->txtResponseReasonCode->MaxLength = AuthorizeNetTransaction::ResponseReasonCodeMaxLength;
  281. return $this->txtResponseReasonCode;
  282. }
  283. /**
  284. * Create and setup QLabel lblResponseReasonCode
  285. * @param string $strControlId optional ControlId to use
  286. * @return QLabel
  287. */
  288. public function lblResponseReasonCode_Create($strControlId = null) {
  289. $this->lblResponseReasonCode = new QLabel($this->objParentObject, $strControlId);
  290. $this->lblResponseReasonCode->Name = QApplication::Translate('Response Reason Code');
  291. $this->lblResponseReasonCode->Text = $this->objAuthorizeNetTransaction->ResponseReasonCode;
  292. return $this->lblResponseReasonCode;
  293. }
  294. /**
  295. * Create and setup QTextBox txtResponseReasonText
  296. * @param string $strControlId optional ControlId to use
  297. * @return QTextBox
  298. */
  299. public function txtResponseReasonText_Create($strControlId = null) {
  300. $this->txtResponseReasonText = new QTextBox($this->objParentObject, $strControlId);
  301. $this->txtResponseReasonText->Name = QApplication::Translate('Response Reason Text');
  302. $this->txtResponseReasonText->Text = $this->objAuthorizeNetTransaction->ResponseReasonText;
  303. $this->txtResponseReasonText->TextMode = QTextMode::MultiLine;
  304. return $this->txtResponseReasonText;
  305. }
  306. /**
  307. * Create and setup QLabel lblResponseReasonText
  308. * @param string $strControlId optional ControlId to use
  309. * @return QLabel
  310. */
  311. public function lblResponseReasonText_Create($strControlId = null) {
  312. $this->lblResponseReasonText = new QLabel($this->objParentObject, $strControlId);
  313. $this->lblResponseReasonText->Name = QApplication::Translate('Response Reason Text');
  314. $this->lblResponseReasonText->Text = $this->objAuthorizeNetTransaction->ResponseReasonText;
  315. return $this->lblResponseReasonText;
  316. }
  317. /**
  318. * Create and setup QTextBox txtAuthorizationCode
  319. * @param string $strControlId optional ControlId to use
  320. * @return QTextBox
  321. */
  322. public function txtAuthorizationCode_Create($strControlId = null) {
  323. $this->txtAuthorizationCode = new QTextBox($this->objParentObject, $strControlId);
  324. $this->txtAuthorizationCode->Name = QApplication::Translate('Authorization Code');
  325. $this->txtAuthorizationCode->Text = $this->objAuthorizeNetTransaction->AuthorizationCode;
  326. $this->txtAuthorizationCode->MaxLength = AuthorizeNetTransaction::AuthorizationCodeMaxLength;
  327. return $this->txtAuthorizationCode;
  328. }
  329. /**
  330. * Create and setup QLabel lblAuthorizationCode
  331. * @param string $strControlId optional ControlId to use
  332. * @return QLabel
  333. */
  334. public function lblAuthorizationCode_Create($strControlId = null) {
  335. $this->lblAuthorizationCode = new QLabel($this->objParentObject, $strControlId);
  336. $this->lblAuthorizationCode->Name = QApplication::Translate('Authorization Code');
  337. $this->lblAuthorizationCode->Text = $this->objAuthorizeNetTransaction->AuthorizationCode;
  338. return $this->lblAuthorizationCode;
  339. }
  340. /**
  341. * Create and setup QTextBox txtTransactionId
  342. * @param string $strControlId optional ControlId to use
  343. * @return QTextBox
  344. */
  345. public function txtTransactionId_Create($strControlId = null) {
  346. $this->txtTransactionId = new QTextBox($this->objParentObject, $strControlId);
  347. $this->txtTransactionId->Name = QApplication::Translate('Transaction Id');
  348. $this->txtTransactionId->Text = $this->objAuthorizeNetTransaction->TransactionId;
  349. $this->txtTransactionId->MaxLength = AuthorizeNetTransaction::TransactionIdMaxLength;
  350. return $this->txtTransactionId;
  351. }
  352. /**
  353. * Create and setup QLabel lblTransactionId
  354. * @param string $strControlId optional ControlId to use
  355. * @return QLabel
  356. */
  357. public function lblTransactionId_Create($strControlId = null) {
  358. $this->lblTransactionId = new QLabel($this->objParentObject, $strControlId);
  359. $this->lblTransactionId->Name = QApplication::Translate('Transaction Id');
  360. $this->lblTransactionId->Text = $this->objAuthorizeNetTransaction->TransactionId;
  361. return $this->lblTransactionId;
  362. }
  363. /**
  364. * Create and setup QTextBox txtTransactionType
  365. * @param string $strControlId optional ControlId to use
  366. * @return QTextBox
  367. */
  368. public function txtTransactionType_Create($strControlId = null) {
  369. $this->txtTransactionType = new QTextBox($this->objParentObject, $strControlId);
  370. $this->txtTransactionType->Name = QApplication::Translate('Transaction Type');
  371. $this->txtTransactionType->Text = $this->objAuthorizeNetTransaction->TransactionType;
  372. $this->txtTransactionType->MaxLength = AuthorizeNetTransaction::TransactionTypeMaxLength;
  373. return $this->txtTransactionType;
  374. }
  375. /**
  376. * Create and setup QLabel lblTransactionType
  377. * @param string $strControlId optional ControlId to use
  378. * @return QLabel
  379. */
  380. public function lblTransactionType_Create($strControlId = null) {
  381. $this->lblTransactionType = new QLabel($this->objParentObject, $strControlId);
  382. $this->lblTransactionType->Name = QApplication::Translate('Transaction Type');
  383. $this->lblTransactionType->Text = $this->objAuthorizeNetTransaction->TransactionType;
  384. return $this->lblTransactionType;
  385. }
  386. /**
  387. * Create and setup QFloatTextBox txtAmount
  388. * @param string $strControlId optional ControlId to use
  389. * @return QFloatTextBox
  390. */
  391. public function txtAmount_Create($strControlId = null) {
  392. $this->txtAmount = new QFloatTextBox($this->objParentObject, $strControlId);
  393. $this->txtAmount->Name = QApplication::Translate('Amount');
  394. $this->txtAmount->Text = $this->objAuthorizeNetTransaction->Amount;
  395. return $this->txtAmount;
  396. }
  397. /**
  398. * Create and setup QLabel lblAmount
  399. * @param string $strControlId optional ControlId to use
  400. * @param string $strFormat optional sprintf format to use
  401. * @return QLabel
  402. */
  403. public function lblAmount_Create($strControlId = null, $strFormat = null) {
  404. $this->lblAmount = new QLabel($this->objParentObject, $strControlId);
  405. $this->lblAmount->Name = QApplication::Translate('Amount');
  406. $this->lblAmount->Text = $this->objAuthorizeNetTransaction->Amount;
  407. $this->lblAmount->Format = $strFormat;
  408. return $this->lblAmount;
  409. }
  410. /**
  411. * Create and setup QTextBox txtAvsResponseCode
  412. * @param string $strControlId optional ControlId to use
  413. * @return QTextBox
  414. */
  415. public function txtAvsResponseCode_Create($strControlId = null) {
  416. $this->txtAvsResponseCode = new QTextBox($this->objParentObject, $strControlId);
  417. $this->txtAvsResponseCode->Name = QApplication::Translate('Avs Response Code');
  418. $this->txtAvsResponseCode->Text = $this->objAuthorizeNetTransaction->AvsResponseCode;
  419. $this->txtAvsResponseCode->MaxLength = AuthorizeNetTransaction::AvsResponseCodeMaxLength;
  420. return $this->txtAvsResponseCode;
  421. }
  422. /**
  423. * Create and setup QLabel lblAvsResponseCode
  424. * @param string $strControlId optional ControlId to use
  425. * @return QLabel
  426. */
  427. public function lblAvsResponseCode_Create($strControlId = null) {
  428. $this->lblAvsResponseCode = new QLabel($this->objParentObject, $strControlId);
  429. $this->lblAvsResponseCode->Name = QApplication::Translate('Avs Response Code');
  430. $this->lblAvsResponseCode->Text = $this->objAuthorizeNetTransaction->AvsResponseCode;
  431. return $this->lblAvsResponseCode;
  432. }
  433. /**
  434. * Create and setup QTextBox txtCcvResponseCode
  435. * @param string $strControlId optional ControlId to use
  436. * @return QTextBox
  437. */
  438. public function txtCcvResponseCode_Create($strControlId = null) {
  439. $this->txtCcvResponseCode = new QTextBox($this->objParentObject, $strControlId);
  440. $this->txtCcvResponseCode->Name = QApplication::Translate('Ccv Response Code');
  441. $this->txtCcvResponseCode->Text = $this->objAuthorizeNetTransaction->CcvResponseCode;
  442. $this->txtCcvResponseCode->MaxLength = AuthorizeNetTransaction::CcvResponseCodeMaxLength;
  443. return $this->txtCcvResponseCode;
  444. }
  445. /**
  446. * Create and setup QLabel lblCcvResponseCode
  447. * @param string $strControlId optional ControlId to use
  448. * @return QLabel
  449. */
  450. public function lblCcvResponseCode_Create($strControlId = null) {
  451. $this->lblCcvResponseCode = new QLabel($this->objParentObject, $strControlId);
  452. $this->lblCcvResponseCode->Name = QApplication::Translate('Ccv Response Code');
  453. $this->lblCcvResponseCode->Text = $this->objAuthorizeNetTransaction->CcvResponseCode;
  454. return $this->lblCcvResponseCode;
  455. }
  456. /**
  457. * Create and setup QTextBox txtCavResponseCode
  458. * @param string $strControlId optional ControlId to use
  459. * @return QTextBox
  460. */
  461. public function txtCavResponseCode_Create($strControlId = null) {
  462. $this->txtCavResponseCode = new QTextBox($this->objParentObject, $strControlId);
  463. $this->txtCavResponseCode->Name = QApplication::Translate('Cav Response Code');
  464. $this->txtCavResponseCode->Text = $this->objAuthorizeNetTransaction->CavResponseCode;
  465. $this->txtCavResponseCode->MaxLength = AuthorizeNetTransaction::CavResponseCodeMaxLength;
  466. return $this->txtCavResponseCode;
  467. }
  468. /**
  469. * Create and setup QLabel lblCavResponseCode
  470. * @param string $strControlId optional ControlId to use
  471. * @return QLabel
  472. */
  473. public function lblCavResponseCode_Create($strControlId = null) {
  474. $this->lblCavResponseCode = new QLabel($this->objParentObject, $strControlId);
  475. $this->lblCavResponseCode->Name = QApplication::Translate('Cav Response Code');
  476. $this->lblCavResponseCode->Text = $this->objAuthorizeNetTransaction->CavResponseCode;
  477. return $this->lblCavResponseCode;
  478. }
  479. /**
  480. * Refresh this MetaControl with Data from the local AuthorizeNetTransaction object.
  481. * @param boolean $blnReload reload AuthorizeNetTransaction from the database
  482. * @return void
  483. */
  484. public function Refresh($blnReload = false) {
  485. if ($blnReload)
  486. $this->objAuthorizeNetTransaction->Reload();
  487. if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objAuthorizeNetTransaction->Id;
  488. if ($this->lstOrder) {
  489. $this->lstOrder->RemoveAllItems();
  490. if (!$this->blnEditMode)
  491. $this->lstOrder->AddItem(QApplication::Translate('- Select One -'), null);
  492. $objOrderArray = Order::LoadAll();
  493. if ($objOrderArray) foreach ($objOrderArray as $objOrder) {
  494. $objListItem = new QListItem($objOrder->__toString(), $objOrder->Id);
  495. if (($this->objAuthorizeNetTransaction->Order) && ($this->objAuthorizeNetTransaction->Order->Id == $objOrder->Id))
  496. $objListItem->Selected = true;
  497. $this->lstOrder->AddItem($objListItem);
  498. }
  499. }
  500. if ($this->lblOrderId) $this->lblOrderId->Text = ($this->objAuthorizeNetTransaction->Order) ? $this->objAuthorizeNetTransaction->Order->__toString() : null;
  501. if ($this->lblCreationDate) if ($this->blnEditMode) $this->lblCreationDate->Text = $this->objAuthorizeNetTransaction->CreationDate;
  502. if ($this->txtResponseCode) $this->txtResponseCode->Text = $this->objAuthorizeNetTransaction->ResponseCode;
  503. if ($this->lblResponseCode) $this->lblResponseCode->Text = $this->objAuthorizeNetTransaction->ResponseCode;
  504. if ($this->txtResponseSubcode) $this->txtResponseSubcode->Text = $this->objAuthorizeNetTransaction->ResponseSubcode;
  505. if ($this->lblResponseSubcode) $this->lblResponseSubcode->Text = $this->objAuthorizeNetTransaction->ResponseSubcode;
  506. if ($this->txtResponseReasonCode) $this->txtResponseReasonCode->Text = $this->objAuthorizeNetTransaction->ResponseReasonCode;
  507. if ($this->lblResponseReasonCode) $this->lblResponseReasonCode->Text = $this->objAuthorizeNetTransaction->ResponseReasonCode;
  508. if ($this->txtResponseReasonText) $this->txtResponseReasonText->Text = $this->objAuthorizeNetTransaction->ResponseReasonText;
  509. if ($this->lblResponseReasonText) $this->lblResponseReasonText->Text = $this->objAuthorizeNetTransaction->ResponseReasonText;
  510. if ($this->txtAuthorizationCode) $this->txtAuthorizationCode->Text = $this->objAuthorizeNetTransaction->AuthorizationCode;
  511. if ($this->lblAuthorizationCode) $this->lblAuthorizationCode->Text = $this->objAuthorizeNetTransaction->AuthorizationCode;
  512. if ($this->txtTransactionId) $this->txtTransactionId->Text = $this->objAuthorizeNetTransaction->TransactionId;
  513. if ($this->lblTransactionId) $this->lblTransactionId->Text = $this->objAuthorizeNetTransaction->TransactionId;
  514. if ($this->txtTransactionType) $this->txtTransactionType->Text = $this->objAuthorizeNetTransaction->TransactionType;
  515. if ($this->lblTransactionType) $this->lblTransactionType->Text = $this->objAuthorizeNetTransaction->TransactionType;
  516. if ($this->txtAmount) $this->txtAmount->Text = $this->objAuthorizeNetTransaction->Amount;
  517. if ($this->lblAmount) $this->lblAmount->Text = $this->objAuthorizeNetTransaction->Amount;
  518. if ($this->txtAvsResponseCode) $this->txtAvsResponseCode->Text = $this->objAuthorizeNetTransaction->AvsResponseCode;
  519. if ($this->lblAvsResponseCode) $this->lblAvsResponseCode->Text = $this->objAuthorizeNetTransaction->AvsResponseCode;
  520. if ($this->txtCcvResponseCode) $this->txtCcvResponseCode->Text = $this->objAuthorizeNetTransaction->CcvResponseCode;
  521. if ($this->lblCcvResponseCode) $this->lblCcvResponseCode->Text = $this->objAuthorizeNetTransaction->CcvResponseCode;
  522. if ($this->txtCavResponseCode) $this->txtCavResponseCode->Text = $this->objAuthorizeNetTransaction->CavResponseCode;
  523. if ($this->lblCavResponseCode) $this->lblCavResponseCode->Text = $this->objAuthorizeNetTransaction->CavResponseCode;
  524. }
  525. ///////////////////////////////////////////////
  526. // PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
  527. ///////////////////////////////////////////////
  528. ///////////////////////////////////////////////
  529. // PUBLIC AUTHORIZENETTRANSACTION OBJECT MANIPULATORS
  530. ///////////////////////////////////////////////
  531. /**
  532. * This will save this object's AuthorizeNetTransaction instance,
  533. * updating only the fields which have had a control created for it.
  534. */
  535. public function SaveAuthorizeNetTransaction() {
  536. try {
  537. // Update any fields for controls that have been created
  538. if ($this->lstOrder) $this->objAuthorizeNetTransaction->OrderId = $this->lstOrder->SelectedValue;
  539. if ($this->txtResponseCode) $this->objAuthorizeNetTransaction->ResponseCode = $this->txtResponseCode->Text;
  540. if ($this->txtResponseSubcode) $this->objAuthorizeNetTransaction->ResponseSubcode = $this->txtResponseSubcode->Text;
  541. if ($this->txtResponseReasonCode) $this->objAuthorizeNetTransaction->ResponseReasonCode = $this->txtResponseReasonCode->Text;
  542. if ($this->txtResponseReasonText) $this->objAuthorizeNetTransaction->ResponseReasonText = $this->txtResponseReasonText->Text;
  543. if ($this->txtAuthorizationCode) $this->objAuthorizeNetTransaction->AuthorizationCode = $this->txtAuthorizationCode->Text;
  544. if ($this->txtTransactionId) $this->objAuthorizeNetTransaction->TransactionId = $this->txtTransactionId->Text;
  545. if ($this->txtTransactionType) $this->objAuthorizeNetTransaction->TransactionType = $this->txtTransactionType->Text;
  546. if ($this->txtAmount) $this->objAuthorizeNetTransaction->Amount = $this->txtAmount->Text;
  547. if ($this->txtAvsResponseCode) $this->objAuthorizeNetTransaction->AvsResponseCode = $this->txtAvsResponseCode->Text;
  548. if ($this->txtCcvResponseCode) $this->objAuthorizeNetTransaction->CcvResponseCode = $this->txtCcvResponseCode->Text;
  549. if ($this->txtCavResponseCode) $this->objAuthorizeNetTransaction->CavResponseCode = $this->txtCavResponseCode->Text;
  550. // Update any UniqueReverseReferences (if any) for controls that have been created for it
  551. // Save the AuthorizeNetTransaction object
  552. $this->objAuthorizeNetTransaction->Save();
  553. // Finally, update any ManyToManyReferences (if any)
  554. } catch (QCallerException $objExc) {
  555. $objExc->IncrementOffset();
  556. throw $objExc;
  557. }
  558. }
  559. /**
  560. * This will DELETE this object's AuthorizeNetTransaction instance from the database.
  561. * It will also unassociate itself from any ManyToManyReferences.
  562. */
  563. public function DeleteAuthorizeNetTransaction() {
  564. $this->objAuthorizeNetTransaction->Delete();
  565. }
  566. ///////////////////////////////////////////////
  567. // PUBLIC GETTERS and SETTERS
  568. ///////////////////////////////////////////////
  569. /**
  570. * Override method to perform a property "Get"
  571. * This will get the value of $strName
  572. *
  573. * @param string $strName Name of the property to get
  574. * @return mixed
  575. */
  576. public function __get($strName) {
  577. switch ($strName) {
  578. // General MetaControlVariables
  579. case 'AuthorizeNetTransaction': return $this->objAuthorizeNetTransaction;
  580. case 'TitleVerb': return $this->strTitleVerb;
  581. case 'EditMode': return $this->blnEditMode;
  582. // Controls that point to AuthorizeNetTransaction fields -- will be created dynamically if not yet created
  583. case 'IdControl':
  584. if (!$this->lblId) return $this->lblId_Create();
  585. return $this->lblId;
  586. case 'IdLabel':
  587. if (!$this->lblId) return $this->lblId_Create();
  588. return $this->lblId;
  589. case 'OrderIdControl':
  590. if (!$this->lstOrder) return $this->lstOrder_Create();
  591. return $this->lstOrder;
  592. case 'OrderIdLabel':
  593. if (!$this->lblOrderId) return $this->lblOrderId_Create();
  594. return $this->lblOrderId;
  595. case 'CreationDateControl':
  596. if (!$this->lblCreationDate) return $this->lblCreationDate_Create();
  597. return $this->lblCreationDate;
  598. case 'CreationDateLabel':
  599. if (!$this->lblCreationDate) return $this->lblCreationDate_Create();
  600. return $this->lblCreationDate;
  601. case 'ResponseCodeControl':
  602. if (!$this->txtResponseCode) return $this->txtResponseCode_Create();
  603. return $this->txtResponseCode;
  604. case 'ResponseCodeLabel':
  605. if (!$this->lblResponseCode) return $this->lblResponseCode_Create();
  606. return $this->lblResponseCode;
  607. case 'ResponseSubcodeControl':
  608. if (!$this->txtResponseSubcode) return $this->txtResponseSubcode_Create();
  609. return $this->txtResponseSubcode;
  610. case 'ResponseSubcodeLabel':
  611. if (!$this->lblResponseSubcode) return $this->lblResponseSubcode_Create();
  612. return $this->lblResponseSubcode;
  613. case 'ResponseReasonCodeControl':
  614. if (!$this->txtResponseReasonCode) return $this->txtResponseReasonCode_Create();
  615. return $this->txtResponseReasonCode;
  616. case 'ResponseReasonCodeLabel':
  617. if (!$this->lblResponseReasonCode) return $this->lblResponseReasonCode_Create();
  618. return $this->lblResponseReasonCode;
  619. case 'ResponseReasonTextControl':
  620. if (!$this->txtResponseReasonText) return $this->txtResponseReasonText_Create();
  621. return $this->txtResponseReasonText;
  622. case 'ResponseReasonTextLabel':
  623. if (!$this->lblResponseReasonText) return $this->lblResponseReasonText_Create();
  624. return $this->lblResponseReasonText;
  625. case 'AuthorizationCodeControl':
  626. if (!$this->txtAuthorizationCode) return $this->txtAuthorizationCode_Create();
  627. return $this->txtAuthorizationCode;
  628. case 'AuthorizationCodeLabel':
  629. if (!$this->lblAuthorizationCode) return $this->lblAuthorizationCode_Create();
  630. return $this->lblAuthorizationCode;
  631. case 'TransactionIdControl':
  632. if (!$this->txtTransactionId) return $this->txtTransactionId_Create();
  633. return $this->txtTransactionId;
  634. case 'TransactionIdLabel':
  635. if (!$this->lblTransactionId) return $this->lblTransactionId_Create();
  636. return $this->lblTransactionId;
  637. case 'TransactionTypeControl':
  638. if (!$this->txtTransactionType) return $this->txtTransactionType_Create();
  639. return $this->txtTransactionType;
  640. case 'TransactionTypeLabel':
  641. if (!$this->lblTransactionType) return $this->lblTransactionType_Create();
  642. return $this->lblTransactionType;
  643. case 'AmountControl':
  644. if (!$this->txtAmount) return $this->txtAmount_Create();
  645. return $this->txtAmount;
  646. case 'AmountLabel':
  647. if (!$this->lblAmount) return $this->lblAmount_Create();
  648. return $this->lblAmount;
  649. case 'AvsResponseCodeControl':
  650. if (!$this->txtAvsResponseCode) return $this->txtAvsResponseCode_Create();
  651. return $this->txtAvsResponseCode;
  652. case 'AvsResponseCodeLabel':
  653. if (!$this->lblAvsResponseCode) return $this->lblAvsResponseCode_Create();
  654. return $this->lblAvsResponseCode;
  655. case 'CcvResponseCodeControl':
  656. if (!$this->txtCcvResponseCode) return $this->txtCcvResponseCode_Create();
  657. return $this->txtCcvResponseCode;
  658. case 'CcvResponseCodeLabel':
  659. if (!$this->lblCcvResponseCode) return $this->lblCcvResponseCode_Create();
  660. return $this->lblCcvResponseCode;
  661. case 'CavResponseCodeControl':
  662. if (!$this->txtCavResponseCode) return $this->txtCavResponseCode_Create();
  663. return $this->txtCavResponseCode;
  664. case 'CavResponseCodeLabel':
  665. if (!$this->lblCavResponseCode) return $this->lblCavResponseCode_Create();
  666. return $this->lblCavResponseCode;
  667. default:
  668. try {
  669. return parent::__get($strName);
  670. } catch (QCallerException $objExc) {
  671. $objExc->IncrementOffset();
  672. throw $objExc;
  673. }
  674. }
  675. }
  676. /**
  677. * Override method to perform a property "Set"
  678. * This will set the property $strName to be $mixValue
  679. *
  680. * @param string $strName Name of the property to set
  681. * @param string $mixValue New value of the property
  682. * @return mixed
  683. */
  684. public function __set($strName, $mixValue) {
  685. try {
  686. switch ($strName) {
  687. // Controls that point to AuthorizeNetTransaction fields
  688. case 'IdControl':
  689. return ($this->lblId = QType::Cast($mixValue, 'QControl'));
  690. case 'OrderIdControl':
  691. return ($this->lstOrder = QType::Cast($mixValue, 'QControl'));
  692. case 'CreationDateControl':
  693. return ($this->lblCreationDate = QType::Cast($mixValue, 'QControl'));
  694. case 'ResponseCodeControl':
  695. return ($this->txtResponseCode = QType::Cast($mixValue, 'QControl'));
  696. case 'ResponseSubcodeControl':
  697. return ($this->txtResponseSubcode = QType::Cast($mixValue, 'QControl'));
  698. case 'ResponseReasonCodeControl':
  699. return ($this->txtResponseReasonCode = QType::Cast($mixValue, 'QControl'));
  700. case 'ResponseReasonTextControl':
  701. return ($this->txtResponseReasonText = QType::Cast($mixValue, 'QControl'));
  702. case 'AuthorizationCodeControl':
  703. return ($this->txtAuthorizationCode = QType::Cast($mixValue, 'QControl'));
  704. case 'TransactionIdControl':
  705. return ($this->txtTransactionId = QType::Cast($mixValue, 'QControl'));
  706. case 'TransactionTypeControl':
  707. return ($this->txtTransactionType = QType::Cast($mixValue, 'QControl'));
  708. case 'AmountControl':
  709. return ($this->txtAmount = QType::Cast($mixValue, 'QControl'));
  710. case 'AvsResponseCodeControl':
  711. return ($this->txtAvsResponseCode = QType::Cast($mixValue, 'QControl'));
  712. case 'CcvResponseCodeControl':
  713. return ($this->txtCcvResponseCode = QType::Cast($mixValue, 'QControl'));
  714. case 'CavResponseCodeControl':
  715. return ($this->txtCavResponseCode = QType::Cast($mixValue, 'QControl'));
  716. default:
  717. return parent::__set($strName, $mixValue);
  718. }
  719. } catch (QCallerException $objExc) {
  720. $objExc->IncrementOffset();
  721. throw $objExc;
  722. }
  723. }
  724. }
  725. ?>