22
33namespace EbicsApi \Ebics \Builders \Request ;
44
5- use EbicsApi \Ebics \Contracts \SignatureDataInterface ;
6- use EbicsApi \Ebics \Services \CryptService ;
7- use EbicsApi \Ebics \Services \ZipService ;
85use Closure ;
96use DOMDocument ;
107use DOMElement ;
8+ use EbicsApi \Ebics \Contracts \SignatureDataInterface ;
9+ use EbicsApi \Ebics \Services \CryptService ;
10+ use EbicsApi \Ebics \Services \ZipService ;
1111
1212/**
1313 * Class DataTransferBuilder builder for request container.
@@ -22,11 +22,11 @@ abstract class DataTransferBuilder
2222 protected ZipService $ zipService ;
2323 protected CryptService $ cryptService ;
2424
25- public function __construct (?DOMDocument $ dom = null )
25+ public function __construct (ZipService $ zipService , CryptService $ cryptService , ?DOMDocument $ dom = null )
2626 {
2727 $ this ->dom = $ dom ;
28- $ this ->zipService = new ZipService () ;
29- $ this ->cryptService = new CryptService () ;
28+ $ this ->zipService = $ zipService ;
29+ $ this ->cryptService = $ cryptService ;
3030 }
3131
3232 public function createInstance (): DataTransferBuilder
@@ -62,7 +62,7 @@ public function addOrderData(string $orderData = null, string $transactionKey =
6262
6363 public function addDataEncryptionInfo (Closure $ callable = null ): DataTransferBuilder
6464 {
65- $ dataEncryptionInfoBuilder = new DataEncryptionInfoBuilder ($ this ->dom );
65+ $ dataEncryptionInfoBuilder = new DataEncryptionInfoBuilder ($ this ->cryptService , $ this -> dom );
6666 $ this ->instance ->appendChild ($ dataEncryptionInfoBuilder ->createInstance ()->getInstance ());
6767
6868 call_user_func ($ callable , $ dataEncryptionInfoBuilder );
0 commit comments