mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Moved code for payment process order to subscriptions module by adding a new filter
This commit is contained in:
parent
b0a5d9b3c4
commit
99ca470d3f
10 changed files with 127 additions and 34 deletions
|
@ -230,7 +230,18 @@ class CheckoutOrderApproved implements RequestHandler {
|
|||
}
|
||||
|
||||
try {
|
||||
$this->order_processor->process( $wc_order );
|
||||
/**
|
||||
* This filter controls if the method 'precess()' from OrderProcessor will be called.
|
||||
* So you can implement your own for example on subscriptions
|
||||
*
|
||||
* - true bool controls execution of 'OrderProcessor::precess()'
|
||||
* @var $this \WC_Payment_Gateway
|
||||
* @var $wc_order \WC_Order
|
||||
*/
|
||||
$process = apply_filters( 'woocommerce_paypal_payments_before_order_process', true, $this, $wc_order );
|
||||
if ( $process ) {
|
||||
$this->order_processor->process( $wc_order );
|
||||
}
|
||||
} catch ( RuntimeException $exception ) {
|
||||
return $this->failure_response(
|
||||
sprintf(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue