Skip to content

Commit

Permalink
Merge pull request #3 from HaiD84/viber_callback
Browse files Browse the repository at this point in the history
callbackUrl for viber
  • Loading branch information
luza authored Sep 2, 2022
2 parents 74346ed + 1be3775 commit 6402e9d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Dto/ViberSendRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ class ViberSendRequest
*/
private $dateSend;

/**
* @var string|null
*/
private $callbackUrl;

/**
* @var string|null
*/
Expand Down Expand Up @@ -158,6 +163,7 @@ public function toArray(): array
'textButton' => $this->textButton,
'linkButton' => $this->linkButton,
'dateSend' => $this->dateSend,
'callbackUrl' => $this->callbackUrl,
'signSms' => $this->signSms,
'textSms' => $this->textSms,
'priceSms' => $this->priceSms,
Expand Down Expand Up @@ -209,6 +215,13 @@ public function setDateSend(?\DateTimeInterface $dateSend): self
return $this;
}

public function setCallbackUrl(?string $callbackUrl): self
{
$this->callbackUrl = $callbackUrl;

return $this;
}

public function setSignSms(?string $signSms): self
{
$this->signSms = $signSms;
Expand Down
2 changes: 2 additions & 0 deletions tests/Dto/ViberSendRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function testFullDataWithSmsCascade(): void
->setTextButton('see more')
->setLinkButton('https://your.site')
->setDateSend(new \DateTime('2022-08-11 12:00:00', new \DateTimeZone('Europe/Moscow')))
->setCallbackUrl('https://your.site/webhook?key=value')
->setSignSms('SMS Aero')
->setTextSms('sms message')
->setPriceSms(10)
Expand All @@ -32,6 +33,7 @@ public function testFullDataWithSmsCascade(): void
'textButton' => 'see more',
'linkButton' => 'https://your.site',
'dateSend' => 1660208400,
'callbackUrl' => 'https://your.site/webhook?key=value',
'signSms' => 'SMS Aero',
'textSms' => 'sms message',
'priceSms' => 10,
Expand Down

0 comments on commit 6402e9d

Please sign in to comment.