Current Path : /storage/v11800/romasitenew/public_html/wp-content/plugins/simpl-checkout-woocommerce/includes/endpoints/ |
Linux v11800 5.3.0-1023-aws #25~18.04.1-Ubuntu SMP Fri Jun 5 15:19:18 UTC 2020 aarch64
|
Current File : /storage/v11800/romasitenew/public_html/wp-content/plugins/simpl-checkout-woocommerce/includes/endpoints/api.php |
<?php
add_action('rest_api_init', function () {
register_rest_route('simpl/v1', '/cart', array(
'methods' => 'POST',
'callback' => array(new SimplCheckoutCartController, 'create'),
'permission_callback' => function () {
return true;
}
));
register_rest_route('wc-simpl/v1', '/checkout', array(
'methods' => 'POST',
'callback' => array(new SimplCheckoutController, 'create'),
'permission_callback' => 'internal_authenticate'
));
register_rest_route('simpl/v1', '/events', array(
'methods' => 'POST',
'callback' => array(new SimplEventsController, 'publish_events'),
'permission_callback' => function () {
return true;
}
));
register_rest_route('wc-simpl/v1', '/checkout', array(
'methods' => 'PUT',
'callback' => array(new SimplCheckoutController, 'update'),
'permission_callback' => 'internal_authenticate'
));
register_rest_route('wc-simpl/v1', '/checkout', array(
'methods' => 'GET',
'callback' => array(new SimplCheckoutController, 'fetch'),
'permission_callback' => 'internal_authenticate'
));
register_rest_route('wc-simpl/v1', '/checkout/coupon', array(
'methods' => 'POST',
'callback' => array(new SimplCheckoutCouponController, 'apply'),
'permission_callback' => 'internal_authenticate'
));
register_rest_route('wc-simpl/v1', '/checkout/coupon', array(
'methods' => 'DELETE',
'callback' => array(new SimplCheckoutCouponController, 'remove'),
'permission_callback' => 'internal_authenticate'
));
register_rest_route('wc-simpl/v1', '/checkout/coupons', array(
'methods' => 'DELETE',
'callback' => array(new SimplCheckoutCouponController, 'remove_all'),
'permission_callback' => 'internal_authenticate'
));
register_rest_route('wc-simpl/v1', '/checkout/shipping-method', array(
'methods' => 'POST',
'callback' => array(new SimplCheckoutShippingController, 'set_shipping_method'),
'permission_callback' => 'internal_authenticate'
));
register_rest_route('wc-simpl/v1', '/order', array(
'methods' => 'GET',
'callback' => array(new SimplCheckoutOrderController, 'fetch'),
'permission_callback' => 'internal_authenticate'
));
register_rest_route('wc-simpl/v1', '/order', array(
'methods' => 'POST',
'callback' => array(new SimplCheckoutOrderController, 'create'),
'permission_callback' => 'internal_authenticate'
));
register_rest_route('wc-simpl/v1', '/authenticate_simpl', array(
'methods' => 'POST',
'callback' => 'authenticate_simpl',
'permission_callback' => function () {
return true;
}
));
register_rest_route('wc-simpl/v1', '/revert_authenticate_simpl', array(
'methods' => 'GET',
'callback' => 'revert_authorization_flag',
'permission_callback' => function () {
return true;
}
));
});