Skip to content

Commit

Permalink
fix: use UploadData
Browse files Browse the repository at this point in the history
  • Loading branch information
brokeyourbike committed Feb 27, 2024
1 parent 69cf0f5 commit 1bbaac4
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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();
Expand Down
104 changes: 101 additions & 3 deletions src/Gen/Type/UploadData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 1bbaac4

Please sign in to comment.