PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.38
Timetics – Appointment Booking Calendar & Scheduling v1.0.38
1.0.62 1.0.63 1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 All 64 releases
← All changes | core/integrations/woocommerce/cart-api.php +2 -32 1.0.62 → 1.0.38 View file →
@@ -6,10 +6,8 @@
6 6 */
7 7
8 8 namespace Timetics\Core\Integrations\Woocommerce;
9 9
10 -defined( 'ABSPATH' ) || exit;
11 -
12 10 use Timetics\Base\Api;
13 11 use Timetics\Core\Appointments\Appointment;
14 12 use Timetics\Utils\Singleton;
15 13
@@ -67,38 +65,10 @@
67 65 public function set_up_woocommerce( $requst ) {
68 66 $data = json_decode( $requst->get_body(), true );
69 67
70 68 $booking_id = ! empty( $data['booking_id'] ) ? intval( $data['booking_id'] ) : 0;
71 - $token = ! empty( $data['security_token'] ) ? sanitize_text_field( $data['security_token'] ) : '';
72 -
73 - $booking = new \Timetics\Core\Bookings\Booking( $booking_id );
74 - // everything from the booking record itself once ownership is proven.
75 - if ( ! $booking_id || '' === $token || ! $booking->is_booking() ) {
76 - return new \WP_HTTP_Response(
77 - [
78 - 'success' => 0,
79 - 'status_code' => 404,
80 - 'message' => __( 'Invalid booking.', 'timetics' ),
81 - ],
82 - 404
83 - );
84 - }
85 -
86 - $stored = (string) $booking->get_security_token();
87 -
88 - if ( '' === $stored || ! hash_equals( $stored, $token ) ) {
89 - return new \WP_HTTP_Response(
90 - [
91 - 'success' => 0,
92 - 'status_code' => 403,
93 - 'message' => __( 'Invalid booking token.', 'timetics' ),
94 - ],
95 - 403
96 - );
97 - }
98 -
99 - $meeting_id = (int) $booking->get_appointment();
100 - $price = (int) $booking->get_total();
69 + $meeting_id = ! empty( $data['meeting_id'] ) ? intval( $data['meeting_id'] ) : 0;
70 + $price = ! empty( $data['price'] ) ? intval( $data['price'] ) : 0;
101 71
102 72 // Set session for timetics data for woocommerce.
103 73 WC()->session->set( 'timetics_data', [
104 74 'booking_id' => $booking_id,