Payment_DTA
[ class tree: Payment_DTA ] [ index: Payment_DTA ] [ all elements ]

Source for file example_debit.php

Documentation is available at example_debit.php

  1. <?php
  2.  
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 2003-2005 Hermann Stainer, Web-Gear                    |
  7. // | http://www.web-gear.com/                                             |
  8. // | All rights reserved.                                                 |
  9. // +----------------------------------------------------------------------+
  10. // | Payment_DTA example:                                                 |
  11. // | Example of creating a DTA debit file with one transaction.           |
  12. // |                                                                      |
  13. // +----------------------------------------------------------------------+
  14. // | Author: Hermann Stainer <hs@web-gear.com>                            |
  15. // +----------------------------------------------------------------------+
  16. //
  17. // $Id: example_debit.php,v 1.1 2008/11/06 09:15:48 kguest Exp $
  18.  
  19.  
  20.  
  21. require_once("Payment/DTA.php");
  22.  
  23.  
  24. /**
  25. * Initialize new DTA file.
  26. * In this example the file contains debits.
  27. * This means that in an exchange the sender is the person, who gets the money
  28. * and the receiver is the person who has to pay.
  29. * You always have to differentiate between the DTA FILE SENDER and the MONEY SENDER.
  30. */
  31.  
  32. $dta_file = new DTA(DTA_DEBIT);
  33.  
  34. /**
  35. * Set file sender. This is also the default sender for transactions.
  36. */
  37.  
  38. $dta_file->setAccountFileSender(array(
  39.     "name"           => "Michael Mustermann",
  40.     "bank_code"      => 11112222,
  41.     "account_number" => 87654321
  42. ));
  43.  
  44. /**
  45. * Add transaction.
  46. */
  47.  
  48. $dta_file->addExchange(
  49.     array(
  50.         "name"           => "Franz Mueller",    // Name of account owner.
  51.         "bank_code"      => 33334444,           // Bank code.
  52.         "account_number" => 13579000,           // Account number.
  53.     ),
  54.     12.01,                                      // Amount of money.
  55.     array(                                      // Description of the transaction ("Verwendungszweck").
  56.         "Bill Nr. 01234",
  57.         "Information"
  58.     )
  59. );
  60.  
  61. /**
  62. * Output DTA-File.
  63. */
  64.  
  65. echo $dta_file->getFileContent();
  66.  
  67. /**
  68. * Write DTA-File.
  69. */
  70.  
  71. // $dta_file->saveFile("DTAUS0");
  72.  
  73. ?>

Documentation generated on Mon, 11 Mar 2019 15:28:52 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.