Skip to content

Commit

Permalink
Bot API 7.7
Browse files Browse the repository at this point in the history
  • Loading branch information
luzrain committed Jul 21, 2024
1 parent d428b62 commit 8ebb941
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PHP Wrapper for Telegram Bot API

[![Bot Api 7.6](https://img.shields.io/badge/Bot%20API-7.6-0088cc.svg?style=flat)](https://core.telegram.org/bots/api-changelog#july-1-2024)
[![Bot Api 7.7](https://img.shields.io/badge/Bot%20API-7.7-0088cc.svg?style=flat)](https://core.telegram.org/bots/api-changelog#july-7-2024)
[![PHP >=8.2](https://img.shields.io/badge/PHP->=8.2-777bb3.svg?style=flat)](https://www.php.net/releases/8.2/en.php)
[![Tests Status](https://img.shields.io/github/actions/workflow/status/luzrain/telegram-bot-api/tests.yaml?branch=master)](../../actions/workflows/tests.yaml)

Expand Down
6 changes: 6 additions & 0 deletions src/Type/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Luzrain\TelegramBotApi\Type\Games\Game;
use Luzrain\TelegramBotApi\Type\Passport\PassportData;
use Luzrain\TelegramBotApi\Type\Payments\Invoice;
use Luzrain\TelegramBotApi\Type\Payments\RefundedPayment;
use Luzrain\TelegramBotApi\Type\Payments\SuccessfulPayment;
use Luzrain\TelegramBotApi\Type\Stickers\Sticker;

Expand Down Expand Up @@ -356,6 +357,11 @@ protected function __construct(
*/
public SuccessfulPayment|null $successfulPayment = null,

/**
* Optional. Message is a service message about a refunded payment, information about the payment.
*/
public RefundedPayment|null $refundedPayment = null,

/**
* Optional. Service message: users were shared with the bot
*/
Expand Down
43 changes: 43 additions & 0 deletions src/Type/Payments/RefundedPayment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

declare(strict_types=1);

namespace Luzrain\TelegramBotApi\Type\Payments;

use Luzrain\TelegramBotApi\Type;

/**
* This object contains basic information about a refunded payment.
*/
final readonly class RefundedPayment extends Type
{
public function __construct(
/**
* Three-letter ISO 4217 currency code, or "XTR" for payments in Telegram Stars. Currently, always "XTR"
*/
public string $currency,

/**
* Total refunded price in the smallest units of the currency (integer, not float/double).
* For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json,
* it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
*/
public int $totalAmount,

/**
* Bot-specified invoice payload
*/
public string $invoicePayload,

/**
* Telegram payment identifier
*/
public string $telegramPaymentChargeId,

/**
* Optional. Provider payment identifier
*/
public string|null $providerPaymentChargeId = null,
) {
}
}

0 comments on commit 8ebb941

Please sign in to comment.