-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into add/pay-for-order-tracks
- Loading branch information
Showing
17 changed files
with
524 additions
and
124 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,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Improve multi-currency compatibility with WooCommerce Deposits |
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,4 @@ | ||
Significance: minor | ||
Type: dev | ||
|
||
Added authentication required state |
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
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
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
14 changes: 14 additions & 0 deletions
14
src/Internal/Payment/State/AuthenticationRequiredState.php
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,14 @@ | ||
<?php | ||
/** | ||
* Class AuthenticationRequiredState | ||
* | ||
* @package WooCommerce\Payments | ||
*/ | ||
|
||
namespace WCPay\Internal\Payment\State; | ||
|
||
/** | ||
* The state, which indicates that the payment requires authentication (3DS). | ||
*/ | ||
class AuthenticationRequiredState extends AbstractPaymentState { | ||
} |
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,58 @@ | ||
<?php | ||
/** | ||
* Class ProcessedState | ||
* | ||
* @package WooCommerce\Payments | ||
*/ | ||
|
||
namespace WCPay\Internal\Payment\State; | ||
|
||
use WCPay\Exceptions\Order_Not_Found_Exception; | ||
use WCPay\Internal\Payment\Exception\StateTransitionException; | ||
use WCPay\Internal\Service\OrderService; | ||
use WCPay\Vendor\League\Container\Exception\ContainerException; | ||
|
||
/** | ||
* This state is used when payment is completed on the server, and we need to update date on the plugin side. | ||
*/ | ||
class ProcessedState extends AbstractPaymentState { | ||
/** | ||
* Order service. | ||
* | ||
* @var OrderService | ||
*/ | ||
private $order_service; | ||
|
||
/** | ||
* Class constructor, only meant for storing dependencies. | ||
* | ||
* @param StateFactory $state_factory Factory for payment states. | ||
* @param OrderService $order_service Service for order-related actions. | ||
*/ | ||
public function __construct( | ||
StateFactory $state_factory, | ||
OrderService $order_service | ||
) { | ||
parent::__construct( $state_factory ); | ||
|
||
$this->order_service = $order_service; | ||
} | ||
|
||
/** | ||
* Complete processing. | ||
* | ||
* @return AbstractPaymentState | ||
* @throws Order_Not_Found_Exception | ||
* @throws StateTransitionException | ||
* @throws ContainerException | ||
*/ | ||
public function complete_processing() { | ||
$context = $this->get_context(); | ||
|
||
// Complete processing. | ||
$this->order_service->update_order_from_successful_intent( $context->get_order_id(), $context->get_intent(), $context ); | ||
|
||
// If everything went well, transition to the completed state. | ||
return $this->create_state( CompletedState::class ); | ||
} | ||
} |
Oops, something went wrong.