Skip to content

Commit

Permalink
Merge branch 'v3' into v4
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
nfourtythree committed Apr 9, 2024
2 parents 332a55b + 0918beb commit 391816b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Stripe for Craft Commerce

## Unreleased

- Fixed a PHP error that could occur when handling a webhook request. ([#294](https://github.com/craftcms/commerce-stripe/issues/294))

## 4.1.2.1 - 2024-03-28

- Fixed a bug where floating point rounding precision could cause payments/refunds to fail. ([#296](https://github.com/craftcms/commerce-stripe/pull/296))
Expand Down Expand Up @@ -59,6 +63,11 @@
- Deprecated creating new payment sources via the `commerce/subscriptions/subscribe` action.
- Fixed a bug where `craft\commerce\stripe\base\SubscriptionGateway::getSubscriptionPlans()` was returning incorrectly-formatted data.

## 3.1.2 - 2024-04-09

- Fixed a PHP error that could occur when handling a webhook request. ([#294](https://github.com/craftcms/commerce-stripe/issues/294))
- Plans’ data is now updated when the associated plan is updated in Stripe. ([#240](https://github.com/craftcms/commerce-stripe/issues/240))

## 3.1.1 - 2023-05-10

- Stripe customers’ default payment methods are now kept in sync with Craft users’ primary payment sources. ([#235](https://github.com/craftcms/commerce-stripe/issues/235))
Expand Down
4 changes: 3 additions & 1 deletion src/base/SubscriptionGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,9 @@ protected function handleInvoiceCreated(array $data): void
]));
}

$canBePaid = empty($stripeInvoice['paid']) && $stripeInvoice['billing'] === 'charge_automatically';
$stripeInvoiceBilling = isset($stripeInvoice['billing']) && $stripeInvoice['billing'] ? $stripeInvoice['billing'] : null;

$canBePaid = empty($stripeInvoice['paid']) && $stripeInvoiceBilling === 'charge_automatically';

if (StripePlugin::getInstance()->getSettings()->chargeInvoicesImmediately && $canBePaid) {
$invoice = $this->getStripeClient()->invoices->retrieve($stripeInvoice['id']);
Expand Down

0 comments on commit 391816b

Please sign in to comment.