-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completed supporting pre checkout query API object
- Loading branch information
1 parent
7696ef6
commit 76b4012
Showing
6 changed files
with
197 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
namespace Formapro\TelegramBot; | ||
|
||
use function Makasim\Values\get_value; | ||
use function Makasim\Values\set_value; | ||
|
||
class AnswerPreCheckoutQuery | ||
{ | ||
private $values = []; | ||
|
||
public function __construct(string $preCheckoutQueryId, bool $ok) | ||
{ | ||
set_value($this, 'pre_checkout_query_id', $preCheckoutQueryId); | ||
set_value($this, 'ok', $ok); | ||
} | ||
|
||
public function getOk(): bool | ||
{ | ||
return get_value($this, 'ok'); | ||
} | ||
|
||
public function getErrorMessage(): ?string | ||
{ | ||
return get_value($this, 'error_message'); | ||
} | ||
|
||
public function setErrorMessage(?string $errorMessage): void | ||
{ | ||
set_value($this, 'error_message', $errorMessage); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
namespace Formapro\TelegramBot; | ||
|
||
use function Makasim\Values\get_object; | ||
use function Makasim\Values\get_value; | ||
|
||
class OrderInfo | ||
{ | ||
private $values = []; | ||
|
||
private $objects = []; | ||
|
||
public function getName(): ?string | ||
{ | ||
return get_value($this, 'name'); | ||
} | ||
|
||
public function setName(?string $name): void | ||
{ | ||
set_value($this, 'name', $name); | ||
} | ||
|
||
public function getPhoneNumber(): ?string | ||
{ | ||
return get_value($this, 'phone_number'); | ||
} | ||
|
||
public function setPhoneNumber(?string $phoneNumber): void | ||
{ | ||
set_value($this, 'phone_number', $phoneNumber); | ||
} | ||
|
||
public function getEmail(): ?string | ||
{ | ||
return get_value($this, 'email'); | ||
} | ||
|
||
public function setEmail(?string $email): void | ||
{ | ||
set_value($this, 'email', $email); | ||
} | ||
|
||
public function getShippingAddress(): ?ShippingAddress | ||
{ | ||
return get_object($this, 'shipping_address', ShippingAddress::class); | ||
} | ||
|
||
public function setShippingAddress(?ShippingAddress $shippingAddress): ?ShippingAddress | ||
{ | ||
set_object($this, 'shipping_address', $shippingAddress); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
namespace Formapro\TelegramBot; | ||
|
||
use function Makasim\Values\get_object; | ||
use function Makasim\Values\get_value; | ||
use function Makasim\Values\set_value; | ||
|
||
class PreCheckoutQuery | ||
{ | ||
private $values = []; | ||
|
||
private $objects = []; | ||
|
||
public function getId(): string | ||
{ | ||
return get_value($this, 'id'); | ||
} | ||
|
||
public function getFrom(): User | ||
{ | ||
return get_object($this, 'from', User::class); | ||
} | ||
|
||
public function getCurrency(): string | ||
{ | ||
return get_value($this, 'currency'); | ||
} | ||
|
||
public function getTotalAmount(): int | ||
{ | ||
return get_value($this, 'total_amount'); | ||
} | ||
|
||
public function getInvoicePayload(): string | ||
{ | ||
return get_value($this, 'invoice_payload'); | ||
} | ||
|
||
public function getShippingOptionId(): ?string | ||
{ | ||
return get_value($this, 'shipping_option_id'); | ||
} | ||
|
||
public function setShippingOptionId(?string $shippingOptionId): void | ||
{ | ||
set_value($this, 'shipping_option_id', $shippingOptionId); | ||
} | ||
|
||
public function getOrderInfo(): ?OrderInfo | ||
{ | ||
return get_object($this, 'order_info', OrderInfo::class); | ||
} | ||
|
||
public function setOrderInfo(?OrderInfo $orderInfo): void | ||
{ | ||
set_object($this, 'order_info', $orderInfo); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace Formapro\TelegramBot; | ||
|
||
use function Makasim\Values\get_object; | ||
use function Makasim\Values\get_value; | ||
|
||
class ShippingAddress | ||
{ | ||
private $values = []; | ||
|
||
private $objects = []; | ||
|
||
public function getCountryCode(): string | ||
{ | ||
return get_value($this, 'country_code'); | ||
} | ||
|
||
public function getState(): string | ||
{ | ||
return get_value($this, 'state'); | ||
} | ||
|
||
public function getCity(): string | ||
{ | ||
return get_value($this, 'city'); | ||
} | ||
|
||
public function getStreetLine1(): string | ||
{ | ||
return get_object($this, 'street_line1'); | ||
} | ||
|
||
public function getStreetLine2(): string | ||
{ | ||
return get_object($this, 'street_line2'); | ||
} | ||
|
||
public function getPostCode(): string | ||
{ | ||
return get_object($this, 'post_code'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters