From 1bbaac4b3e5bfee066c88776f1bff7353ab479bf Mon Sep 17 00:00:00 2001 From: Ivan Stasiuk Date: Tue, 27 Feb 2024 23:19:06 +0000 Subject: [PATCH] fix: use UploadData --- src/Client.php | 2 +- src/Gen/Type/UploadData.php | 104 ++++++++++++++++++++++++++++++++++-- 2 files changed, 102 insertions(+), 4 deletions(-) diff --git a/src/Client.php b/src/Client.php index c4b2c8c..a94218a 100644 --- a/src/Client.php +++ b/src/Client.php @@ -85,7 +85,6 @@ public function send(TransactionInterface $transaction): ?Response return $this->soap->sendRequest(new SendRequest( (new UploadData()) - ->withClientInfo($user) ->withTransactionRequest( (new ArrayOfTransaction())->withTransaction((new Transaction()) ->withAmount((string)$transaction->getAmount()) @@ -96,6 +95,7 @@ public function send(TransactionInterface $transaction): ?Response ->withTransactionRef($transaction->getReference()) ->withPaymentDueDate($transaction->getDueDate()->format('Y-m-d'))) ) + ->withClientInfo($user) ->withMAC($mac) ->withUseSingleDebitMultipleCredit(false) ))->getSendRequestResult(); diff --git a/src/Gen/Type/UploadData.php b/src/Gen/Type/UploadData.php index d237081..4d6b43b 100644 --- a/src/Gen/Type/UploadData.php +++ b/src/Gen/Type/UploadData.php @@ -2,15 +2,113 @@ namespace BrokeYourBike\ZenithBankCIB\Gen\Type; -use \BrokeYourBike\ZenithBankCIB\Gen\Type\GenericUploadData; - -class UploadData extends GenericUploadData +class UploadData { + /** + * @var null | string + */ + private ?string $BulkDebitReference; + + /** + * @var null | \BrokeYourBike\ZenithBankCIB\Gen\Type\User + */ + private ?\BrokeYourBike\ZenithBankCIB\Gen\Type\User $ClientInfo; + + /** + * @var null | string + */ + private ?string $MAC; + + /** + * @var null | bool + */ + private ?bool $UseSingleDebitMultipleCredit; + /** * @var null | \BrokeYourBike\ZenithBankCIB\Gen\Type\ArrayOfTransaction */ private ?\BrokeYourBike\ZenithBankCIB\Gen\Type\ArrayOfTransaction $TransactionRequest; + /** + * @return null | string + */ + public function getBulkDebitReference() : ?string + { + return $this->BulkDebitReference; + } + + /** + * @param null | string $BulkDebitReference + * @return static + */ + public function withBulkDebitReference(?string $BulkDebitReference) : static + { + $new = clone $this; + $new->BulkDebitReference = $BulkDebitReference; + + return $new; + } + + /** + * @return null | \BrokeYourBike\ZenithBankCIB\Gen\Type\User + */ + public function getClientInfo() : ?\BrokeYourBike\ZenithBankCIB\Gen\Type\User + { + return $this->ClientInfo; + } + + /** + * @param null | \BrokeYourBike\ZenithBankCIB\Gen\Type\User $ClientInfo + * @return static + */ + public function withClientInfo(?\BrokeYourBike\ZenithBankCIB\Gen\Type\User $ClientInfo) : static + { + $new = clone $this; + $new->ClientInfo = $ClientInfo; + + return $new; + } + + /** + * @return null | string + */ + public function getMAC() : ?string + { + return $this->MAC; + } + + /** + * @param null | string $MAC + * @return static + */ + public function withMAC(?string $MAC) : static + { + $new = clone $this; + $new->MAC = $MAC; + + return $new; + } + + /** + * @return null | bool + */ + public function getUseSingleDebitMultipleCredit() : ?bool + { + return $this->UseSingleDebitMultipleCredit; + } + + /** + * @param null | bool $UseSingleDebitMultipleCredit + * @return static + */ + public function withUseSingleDebitMultipleCredit(?bool $UseSingleDebitMultipleCredit) : static + { + $new = clone $this; + $new->UseSingleDebitMultipleCredit = $UseSingleDebitMultipleCredit; + + return $new; + } + /** * @return null | \BrokeYourBike\ZenithBankCIB\Gen\Type\ArrayOfTransaction */