1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php

class LastschriftPayment extends Payment {

  function getPaymentFormFields() {
    return new FieldSet(
      new TextField('lastschrift_kto_inhaber', 'Kontoinhaber:'),
      new TextField('lastschrift_kto_nr', 'Kontonummer:'),
      new TextField('lastschrift_kto_blz', 'Bankleitzahl:'),
      new TextField('lastschrift_kto_bank', 'Bankinstitut:')
    );
  }

  function getPaymentFormRequirements() {
    $jsCode = <<<JS
      require('lastschrift_kto_inhaber'),
      require('lastschrift_kto_nr'),
      require('lastschrift_kto_blz')

JS;
    $phpCode = '
      $this->requireField("lastschrift_kto_inhaber", $data);
      $this->requireField("lastschrift_kto_nr", $data);
      $this->requireField("lastschrift_kto_blz", $data);
      
    ';
    return array('js' => $jsCode, 'php' => $phpCode);
  }

  function ChequeContent() {
    if(class_exists('CheckoutPage')) {
      return DataObject::get_one('CheckoutPage')->ChequeMessage;
      }
    }



  function processPayment($data, $form) {
    $this->Status = 'Pending';
    $this->Message = '<p class="warningMessage">' . _t('ChequePayment.MESSAGE', 'Payment accepted via Cheque. Bitte beachten Sie das die Ware erst nach Zahlungseingang versendet wird.') . '</p>';

    $this->write();
    return new Payment_Success();
  }  

}
?>