💡 Remove dev-comments, clean up

This commit is contained in:
Philipp Stracker 2024-09-11 16:21:05 +02:00
parent db6b860b5f
commit a0d0a06dfd
No known key found for this signature in database

View file

@ -248,12 +248,7 @@ class AxoGateway extends WC_Payment_Gateway {
$wc_order->save();
}
/*
* TODO - in block checkout this is empty, which causes an API error.
* Expected a 36-char UUID, like "8216a7c6-63be-1760-7451-80a858d571be"
*/
// The `axo_nonce` is not a WP nonce, but a single use token generated by the JS SDK.
// The `axo_nonce` is not a WP nonce, but a card-token generated by the JS SDK.
// phpcs:ignore WordPress.Security.NonceVerification.Missing
$token = wc_clean( wp_unslash( $_POST['axo_nonce'] ?? '' ) );
@ -275,12 +270,12 @@ class AxoGateway extends WC_Payment_Gateway {
/**
* Create a new PayPal order from the existing WC_Order instance.
*
* @param WC_Order $wc_order The WooCommerce order to use as a base.
* @param string $single_use_token The single use token, generated by the JS SDK.
* @param WC_Order $wc_order The WooCommerce order to use as a base.
* @param string $payment_token The payment token, generated by the JS SDK.
*
* @return Order The PayPal order.
*/
protected function create_paypal_order( WC_Order $wc_order, string $single_use_token ) : Order {
protected function create_paypal_order( WC_Order $wc_order, string $payment_token ) : Order {
$purchase_unit = $this->purchase_unit_factory->from_wc_order( $wc_order );
$shipping_preference = $this->shipping_preference_factory->from_state(
@ -289,7 +284,7 @@ class AxoGateway extends WC_Payment_Gateway {
);
$payment_source_properties = (object) array(
'single_use_token' => $single_use_token,
'single_use_token' => $payment_token,
);
$payment_source = new PaymentSource(
@ -297,8 +292,7 @@ class AxoGateway extends WC_Payment_Gateway {
$payment_source_properties
);
// TODO - this request fails in block checkout. Need to investigate.
$order = $this->order_endpoint->create(
return $this->order_endpoint->create(
array( $purchase_unit ),
$shipping_preference,
null,
@ -309,8 +303,6 @@ class AxoGateway extends WC_Payment_Gateway {
array(),
$payment_source
);
return $order;
}
/**