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

Source for file example_credit.php

Documentation is available at example_credit.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 credit file with one transaction.          |
  12. // |                                                                      |
  13. // +----------------------------------------------------------------------+
  14. // | Author: Hermann Stainer <hs@web-gear.com>                            |
  15. // +----------------------------------------------------------------------+
  16. //
  17. // $Id: example_credit.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 credits.
  27. * This means that in an exchange the sender is the person who pays money
  28. * to the receiver.
  29. */
  30.  
  31. $dta_file = new DTA(DTA_CREDIT);
  32.  
  33. /**
  34. * Set file sender. This is also the default sender for transactions.
  35. */
  36.  
  37. $dta_file->setAccountFileSender(array(
  38.     "name"           => "Michael Mustermann",
  39.     "bank_code"      => 11112222,
  40.     "account_number" => 654321
  41. ));
  42.  
  43. /**
  44. * Add transaction.
  45. */
  46.  
  47. $dta_file->addExchange(
  48.     array(
  49.         "name"           => "Franz Mueller",    // Name of account owner.
  50.         "bank_code"      => 33334444,           // Bank code.
  51.         "account_number" => 13579000,           // Account number.
  52.     ),
  53.     12.01,                                      // Amount of money.
  54.     array(                                      // Description of the transaction ("Verwendungszweck").
  55.         "Credit Nr. 01234",
  56.         "Information"
  57.     )
  58. );
  59.  
  60. /**
  61. * Output DTA-File.
  62. */
  63.  
  64. echo $dta_file->getFileContent();
  65.  
  66. /**
  67. * Write DTA-File.
  68. */
  69.  
  70. // $dta_file->saveFile("DTAUS0");
  71.  
  72. ?>

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