Skip to content

Commit

Permalink
Fixed #315 make sure bank transfers are set to processing
Browse files Browse the repository at this point in the history
  • Loading branch information
nfourtythree committed Feb 5, 2025
1 parent 9ed3694 commit d78870a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 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 bug where choosing bank transfer as a payment method wouldn’t complete an order. ([#315](https://github.com/craftcms/commerce-stripe/issues/315))

## 4.1.5.3 - 2025-02-05

- Fixed a PHP error that could occur when handling a webhook request.
Expand Down
7 changes: 7 additions & 0 deletions src/responses/PaymentIntentResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use craft\commerce\base\RequestResponseInterface;
use craft\commerce\errors\NotImplementedException;
use Stripe\PaymentIntent;
use Stripe\Refund;

class PaymentIntentResponse implements RequestResponseInterface
Expand Down Expand Up @@ -63,6 +64,12 @@ public function isProcessing(): bool
return true;
}

if (array_key_exists('object', $this->data) && $this->data['object'] == PaymentIntent::OBJECT_NAME
&& array_key_exists('next_action', $this->data) && is_array($this->data['next_action'])
&& array_key_exists('type', $this->data['next_action']) && $this->data['next_action']['type'] == 'display_bank_transfer_instructions') {
return true;
}

return false;
}

Expand Down

0 comments on commit d78870a

Please sign in to comment.