checkout->has_active_session() ) { wp_enqueue_script( 'wc-gateway-ppec-order-review', wc_gateway_ppec()->plugin_url . 'assets/js/wc-gateway-ppec-order-review.js', array( 'jquery' ), wc_gateway_ppec()->version, true ); } } /** * Save data necessary for authorizing payment to session, in order to * go ahead with processing payment and bypass redirecting to PayPal. * * @param int $order_id Order ID * * @return array */ public function process_payment( $order_id ) { if ( isset( $_POST['payerID'] ) && isset( $_POST['paymentToken'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing $session = WC()->session->get( 'paypal', new stdClass() ); $session->checkout_completed = true; $session->payer_id = $_POST['payerID']; // phpcs:ignore WordPress.Security.NonceVerification.Missing,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.MissingUnslash $session->token = $_POST['paymentToken']; // phpcs:ignore WordPress.Security.NonceVerification.Missing,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.MissingUnslash WC()->session->set( 'paypal', $session ); } return parent::process_payment( $order_id ); } }