mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
don't store PP order in class properties
This commit is contained in:
parent
91adee26e4
commit
e0d59ce2a0
1 changed files with 2 additions and 13 deletions
|
@ -88,13 +88,6 @@ class CreateOrderEndpoint implements EndpointInterface {
|
||||||
*/
|
*/
|
||||||
private $early_order_handler;
|
private $early_order_handler;
|
||||||
|
|
||||||
/**
|
|
||||||
* The current PayPal order in a process.
|
|
||||||
*
|
|
||||||
* @var Order|null
|
|
||||||
*/
|
|
||||||
private $order;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data from the request.
|
* Data from the request.
|
||||||
*
|
*
|
||||||
|
@ -183,7 +176,7 @@ class CreateOrderEndpoint implements EndpointInterface {
|
||||||
$order = $this->create_paypal_order($wc_order);
|
$order = $this->create_paypal_order($wc_order);
|
||||||
|
|
||||||
if ( 'checkout' === $data['context'] ) {
|
if ( 'checkout' === $data['context'] ) {
|
||||||
$this->process_checkout_form( $data['form'], $order );
|
$this->process_checkout_form( $data['form'] );
|
||||||
}
|
}
|
||||||
if ( 'pay-now' === $data['context'] && get_option( 'woocommerce_terms_page_id', '' ) !== '' ) {
|
if ( 'pay-now' === $data['context'] && get_option( 'woocommerce_terms_page_id', '' ) !== '' ) {
|
||||||
$this->validate_paynow_form( $data['form'] );
|
$this->validate_paynow_form( $data['form'] );
|
||||||
|
@ -297,12 +290,10 @@ class CreateOrderEndpoint implements EndpointInterface {
|
||||||
* Prepare the Request parameter and process the checkout form and validate it.
|
* Prepare the Request parameter and process the checkout form and validate it.
|
||||||
*
|
*
|
||||||
* @param string $form_values The values of the form.
|
* @param string $form_values The values of the form.
|
||||||
* @param Order $order The Order.
|
|
||||||
*
|
*
|
||||||
* @throws \Exception On Error.
|
* @throws \Exception On Error.
|
||||||
*/
|
*/
|
||||||
private function process_checkout_form(string $form_values, Order $order ) {
|
private function process_checkout_form(string $form_values ) {
|
||||||
$this->order = $order;
|
|
||||||
$form_values = explode( '&', $form_values );
|
$form_values = explode( '&', $form_values );
|
||||||
|
|
||||||
$parsed_values = array();
|
$parsed_values = array();
|
||||||
|
@ -354,8 +345,6 @@ class CreateOrderEndpoint implements EndpointInterface {
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function after_checkout_validation( array $data, \WP_Error $errors ): array {
|
public function after_checkout_validation( array $data, \WP_Error $errors ): array {
|
||||||
|
|
||||||
$order = $this->order;
|
|
||||||
if ( ! $errors->errors ) {
|
if ( ! $errors->errors ) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue