mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +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
|
@ -253,7 +253,18 @@ class AxoGateway extends WC_Payment_Gateway {
|
|||
|
||||
$order = $this->create_paypal_order( $wc_order, $token );
|
||||
|
||||
$this->order_processor->process_captured_and_authorized( $wc_order, $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_captured_and_authorized( $wc_order, $order );
|
||||
}
|
||||
} catch ( Exception $exception ) {
|
||||
return $this->handle_payment_failure( $wc_order, $exception );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue