PluginProbe
Bookit — Booking & Appointment Calendar / 2.6.0.5
Bookit — Booking & Appointment Calendar v2.6.0.5
2.6.0.5 2.6.0.4 2.6.0.3 2.6.0.2 2.6.0.1 2.6.0 trunk 1.2 1.2.2 1.2.3 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 All 62 releases
bookit / src / Bookit / Gateways / Contracts / Requests_Interface.php

Requests_Interface.php in Bookit — Booking & Appointment Calendar 2.6.0.5, at src/Bookit/Gateways/Contracts/Requests_Interface.php

121 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Bookit\Gateways\Contracts;
4
5 /**
6 * Requests Interface for gateways.
7 *
8 * @since 2.5.0
9 *
10 * @package Bookit\Gateways\Contracts;
11 */
12 interface Requests_Interface {
13
14 /**
15 * Send a GET request to the Stripe API.
16 *
17 * @since 2.5.0
18 *
19 * @param string $endpoint
20 * @param array $query_args
21 * @param array $request_arguments
22 * @param bool $raw
23 *
24 * @return array|null
25 */
26 public static function get( $endpoint, array $query_args = [], array $request_arguments = [], $raw = false );
27
28 /**
29 * Send a POST request.
30 *
31 * @since 2.5.0
32 *
33 * @param string $endpoint
34 * @param array $query_args
35 * @param array $request_arguments
36 * @param bool $raw
37 *
38 * @return array|null
39 */
40 public static function post( $endpoint, array $query_args = [], array $request_arguments = [], $raw = false );
41
42 /**
43 * Send a PATCH request to the Stripe API.
44 *
45 * @since 2.5.0
46 *
47 * @param string $endpoint
48 * @param array $query_args
49 * @param array $request_arguments
50 * @param bool $raw
51 *
52 * @return array|null
53 */
54 public static function patch( $endpoint, array $query_args = [], array $request_arguments = [], $raw = false );
55
56 /**
57 * Send a DELETE request to the Stripe API.
58 *
59 * @since 2.5.0
60 *
61 * @param string $endpoint
62 * @param array $query_args
63 * @param array $request_arguments
64 * @param bool $raw
65 *
66 * @return array|null
67 */
68 public static function delete( $endpoint, array $query_args = [], array $request_arguments = [], $raw = false );
69
70 /**
71 * Send a given method request to a given URL in the Stripe API.
72 *
73 * @since 2.5.0
74 *
75 * @param string $method
76 * @param string $url
77 * @param array $query_args
78 * @param array $request_arguments
79 * @param bool $raw
80 * @param int $retries Param used to determine the amount of time this particular request was retried.
81 *
82 * @return array|\WP_Error
83 */
84 public static function request( $method, $url, array $query_args = [], array $request_arguments = [], $raw = false, $retries = 0 );
85
86 /**
87 * Process Request responses to catch any error code and transform in a WP_Error.
88 * Returns the request array if no errors are found. Or a WP_Error object.
89 *
90 * @since 2.5.0
91 *
92 * @param array|\WP_Error $response Array of server data.
93 *
94 * @return array|\WP_Error
95 */
96 public static function process_response( $response );
97
98 /**
99 * Format user-facing errors to the list structure expected in the checkout script.
100 *
101 * @since 2.5.0
102 *
103 * @param \WP_Error $errors WP_Error instance.
104 *
105 * @return array[]
106 */
107 public static function prepare_errors_to_display( \WP_Error $errors );
108
109 /**
110 * Get REST API endpoint URL for requests.
111 *
112 * @since 2.5.0
113 *
114 * @param string $endpoint The endpoint path.
115 * @param array $query_args Query args appended to the URL.
116 *
117 * @return string The API URL.
118 *
119 */
120 public static function get_api_url( $endpoint, array $query_args = [] );
121 }