DigitickSepaTransferFileCustomerDirectDebitTransferFile

The WooCommerce Germanized Digitick Sepa TransferFile CustomerDirectDebitTransferFile class.

Defined (1)

The class is defined in the following location(s).

/includes/gateways/direct-debit/libraries/php-sepa-xml/TransferFile/CustomerDirectDebitTransferFile.php  
  1. class CustomerDirectDebitTransferFile extends BaseTransferFile 
  2. /** 
  3. * @param PaymentInformation $paymentInformation 
  4. */ 
  5. public function addPaymentInformation(PaymentInformation $paymentInformation) 
  6. $paymentInformation->setValidPaymentMethods(array('DD')); 
  7. $paymentInformation->setPaymentMethod('DD'); 
  8. parent::addPaymentInformation($paymentInformation); 
  9.  
  10. /** 
  11. * validate the transferfile 
  12. * @throws \Digitick\Sepa\Exception\InvalidTransferTypeException 
  13. */ 
  14. public function validate() 
  15. parent::validate(); 
  16. /** @var $payment PaymentInformation */ 
  17. foreach ($this->paymentInformations as $payment) { 
  18. if ((string)$payment->getSequenceType() === '') { 
  19. throw new InvalidTransferFileConfiguration('Payment must contain a SequenceType'); 
  20. if ((string)$payment->getCreditorId() === '') { 
  21. throw new InvalidTransferFileConfiguration('Payment must contain a CreditorSchemeId'); 
  22. foreach ($payment->getTransfers() as $transfer) { 
  23. if (!$transfer instanceof CustomerDirectDebitTransferInformation) { 
  24. throw new InvalidTransferTypeException('Transfers must be of type \Digitick\Sepa\TransferInformation\CustomerDirectDebitTransferInformation instead of: ' . get_class( 
  25. $transfer 
  26. ));