mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
⏪️ Remove unnecessary endpoint, restore URL
Those changes are not relevant for 3DS integration
This commit is contained in:
parent
b85d1a5806
commit
ea23cf743a
4 changed files with 2 additions and 25 deletions
|
@ -14,7 +14,6 @@ const initiateRedirect = ( successUrl ) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const onApprove = ( context, errorHandler ) => {
|
const onApprove = ( context, errorHandler ) => {
|
||||||
console.log( 'onApprove' );
|
|
||||||
return ( data, actions ) => {
|
return ( data, actions ) => {
|
||||||
const canCreateOrder =
|
const canCreateOrder =
|
||||||
! context.config.vaultingEnabled || data.paymentSource !== 'venmo';
|
! context.config.vaultingEnabled || data.paymentSource !== 'venmo';
|
||||||
|
@ -49,6 +48,7 @@ const onApprove = ( context, errorHandler ) => {
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const orderReceivedUrl = approveData.data?.order_received_url;
|
||||||
initiateRedirect( orderReceivedUrl || context.config.redirect );
|
initiateRedirect( orderReceivedUrl || context.config.redirect );
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,7 +10,6 @@ declare(strict_types=1);
|
||||||
namespace WooCommerce\PayPalCommerce\Button;
|
namespace WooCommerce\PayPalCommerce\Button;
|
||||||
|
|
||||||
use WooCommerce\PayPalCommerce\Button\Endpoint\ApproveSubscriptionEndpoint;
|
use WooCommerce\PayPalCommerce\Button\Endpoint\ApproveSubscriptionEndpoint;
|
||||||
use WooCommerce\PayPalCommerce\Button\Endpoint\CaptureOrderEndpoint;
|
|
||||||
use WooCommerce\PayPalCommerce\Button\Endpoint\CartScriptParamsEndpoint;
|
use WooCommerce\PayPalCommerce\Button\Endpoint\CartScriptParamsEndpoint;
|
||||||
use WooCommerce\PayPalCommerce\Button\Endpoint\GetOrderEndpoint;
|
use WooCommerce\PayPalCommerce\Button\Endpoint\GetOrderEndpoint;
|
||||||
use WooCommerce\PayPalCommerce\Button\Endpoint\SimulateCartEndpoint;
|
use WooCommerce\PayPalCommerce\Button\Endpoint\SimulateCartEndpoint;
|
||||||
|
@ -290,13 +289,6 @@ return array(
|
||||||
$container->get( 'api.endpoint.order' )
|
$container->get( 'api.endpoint.order' )
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
'button.endpoint.capture-order' => static function( ContainerInterface $container ): CaptureOrderEndpoint {
|
|
||||||
return new CaptureOrderEndpoint(
|
|
||||||
$container->get( 'button.request-data' ),
|
|
||||||
$container->get( 'api.endpoint.order' ),
|
|
||||||
$container->get( 'button.helper.wc-order-creator' ),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
'button.checkout-form-saver' => static function ( ContainerInterface $container ): CheckoutFormSaver {
|
'button.checkout-form-saver' => static function ( ContainerInterface $container ): CheckoutFormSaver {
|
||||||
return new CheckoutFormSaver(
|
return new CheckoutFormSaver(
|
||||||
$container->get( 'session.handler' )
|
$container->get( 'session.handler' )
|
||||||
|
|
|
@ -1145,7 +1145,7 @@ document.querySelector("#payment").before(document.querySelector(".ppcp-messages
|
||||||
'endpoint' => \WC_AJAX::get_endpoint( ChangeCartEndpoint::ENDPOINT ),
|
'endpoint' => \WC_AJAX::get_endpoint( ChangeCartEndpoint::ENDPOINT ),
|
||||||
'nonce' => wp_create_nonce( ChangeCartEndpoint::nonce() ),
|
'nonce' => wp_create_nonce( ChangeCartEndpoint::nonce() ),
|
||||||
),
|
),
|
||||||
'get_order' => array(
|
'get_order' => array(
|
||||||
'endpoint' => \WC_AJAX::get_endpoint( GetOrderEndpoint::ENDPOINT ),
|
'endpoint' => \WC_AJAX::get_endpoint( GetOrderEndpoint::ENDPOINT ),
|
||||||
'nonce' => wp_create_nonce( GetOrderEndpoint::nonce() ),
|
'nonce' => wp_create_nonce( GetOrderEndpoint::nonce() ),
|
||||||
),
|
),
|
||||||
|
@ -1153,10 +1153,6 @@ document.querySelector("#payment").before(document.querySelector(".ppcp-messages
|
||||||
'endpoint' => \WC_AJAX::get_endpoint( CreateOrderEndpoint::ENDPOINT ),
|
'endpoint' => \WC_AJAX::get_endpoint( CreateOrderEndpoint::ENDPOINT ),
|
||||||
'nonce' => wp_create_nonce( CreateOrderEndpoint::nonce() ),
|
'nonce' => wp_create_nonce( CreateOrderEndpoint::nonce() ),
|
||||||
),
|
),
|
||||||
'capture_order' => array(
|
|
||||||
'endpoint' => \WC_AJAX::get_endpoint( CaptureOrderEndpoint::ENDPOINT ),
|
|
||||||
'nonce' => wp_create_nonce( CaptureOrderEndpoint::nonce() ),
|
|
||||||
),
|
|
||||||
'approve_order' => array(
|
'approve_order' => array(
|
||||||
'endpoint' => \WC_AJAX::get_endpoint( ApproveOrderEndpoint::ENDPOINT ),
|
'endpoint' => \WC_AJAX::get_endpoint( ApproveOrderEndpoint::ENDPOINT ),
|
||||||
'nonce' => wp_create_nonce( ApproveOrderEndpoint::nonce() ),
|
'nonce' => wp_create_nonce( ApproveOrderEndpoint::nonce() ),
|
||||||
|
|
|
@ -10,7 +10,6 @@ declare(strict_types=1);
|
||||||
namespace WooCommerce\PayPalCommerce\Button;
|
namespace WooCommerce\PayPalCommerce\Button;
|
||||||
|
|
||||||
use WooCommerce\PayPalCommerce\Button\Endpoint\ApproveSubscriptionEndpoint;
|
use WooCommerce\PayPalCommerce\Button\Endpoint\ApproveSubscriptionEndpoint;
|
||||||
use WooCommerce\PayPalCommerce\Button\Endpoint\CaptureOrderEndpoint;
|
|
||||||
use WooCommerce\PayPalCommerce\Button\Endpoint\CartScriptParamsEndpoint;
|
use WooCommerce\PayPalCommerce\Button\Endpoint\CartScriptParamsEndpoint;
|
||||||
use WooCommerce\PayPalCommerce\Button\Endpoint\GetOrderEndpoint;
|
use WooCommerce\PayPalCommerce\Button\Endpoint\GetOrderEndpoint;
|
||||||
use WooCommerce\PayPalCommerce\Button\Endpoint\SaveCheckoutFormEndpoint;
|
use WooCommerce\PayPalCommerce\Button\Endpoint\SaveCheckoutFormEndpoint;
|
||||||
|
@ -189,16 +188,6 @@ class ButtonModule implements ServiceModule, ExtendingModule, ExecutableModule {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
add_action(
|
|
||||||
'wc_ajax_' . CaptureOrderEndpoint::ENDPOINT,
|
|
||||||
static function () use ( $container ) {
|
|
||||||
$endpoint = $container->get( 'button.endpoint.capture-order' );
|
|
||||||
assert( $endpoint instanceof GetOrderEndpoint );
|
|
||||||
|
|
||||||
$endpoint->handle_request();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
add_action(
|
add_action(
|
||||||
'wc_ajax_' . CreateOrderEndpoint::ENDPOINT,
|
'wc_ajax_' . CreateOrderEndpoint::ENDPOINT,
|
||||||
static function () use ( $container ) {
|
static function () use ( $container ) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue