Skip to content

Commit

Permalink
Merge pull request #33 from yoomoney/release/v2.2.7
Browse files Browse the repository at this point in the history
* Проверка статуса платежа при редиректе в магазин
* Обновлен SDK до версии 2.2.7
  • Loading branch information
SaShaSpi authored Mar 10, 2022
2 parents dde18bd + 1422c60 commit 6f513dc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### v2.2.7 от 09.03.2022
* Проверка статуса платежа при редиректе в магазин
* Обновлен SDK до версии 2.2.7

### v2.2.6 от 11.02.2022
* Добавление дополнительной проверки при отправке второго чека

Expand Down
5 changes: 4 additions & 1 deletion src/Plugin/Commerce/PaymentGateway/YooKassa.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
*/
class YooKassa extends OffsitePaymentGatewayBase
{
const YOOMONEY_MODULE_VERSION = '2.2.6';
const YOOMONEY_MODULE_VERSION = '2.2.7';

/**
* @var Client apiClient
Expand Down Expand Up @@ -501,6 +501,9 @@ public function onReturn(OrderInterface $order, Request $request)
$paymentInfoResponse = $apiClient->capturePayment($captureRequest, $paymentId);
$this->log('Payment info after capture: ' . json_encode($paymentInfoResponse));
}
if ($payment->getState()->getString() !== 'new') {
return;
}
if ($paymentInfoResponse->status == PaymentStatus::SUCCEEDED) {
$payment->setRemoteState($paymentInfoResponse->status);
$payment->setState('completed');
Expand Down
2 changes: 1 addition & 1 deletion yookassa.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ billing_validation:

yookassa-sdk-php:
remote: https://github.com/yoomoney/yookassa-sdk-php
version: "2.2.4"
version: "2.2.7"
license:
name: MIT
url: https://github.com/yoomoney/yookassa-sdk-php/blob/master/LICENSE.md
Expand Down

0 comments on commit 6f513dc

Please sign in to comment.