PluginProbe
Texty – SMS Notification for WordPress, WooCommerce, Dokan and more / 1.1
Texty – SMS Notification for WordPress, WooCommerce, Dokan and more v1.1
2.0.2 trunk 0.2 1.0 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 2.0.0 2.0.1
texty / includes / Gateways / Fake.php

Fake.php in Texty – SMS Notification for WordPress, WooCommerce, Dokan and more 1.1, at includes/Gateways/Fake.php

76 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Texty\Gateways;
4
5 use WP_Error;
6
7 /**
8 * Twilio Class
9 *
10 * @see https://www.twilio.com/docs/sms/api/message
11 */
12 class Fake implements GatewayInterface {
13
14 /**
15 * Get the name
16 *
17 * @return string
18 */
19 public function name() {
20 return __( 'Fake Gateway', 'texty' );
21 }
22
23 /**
24 * Get the name
25 *
26 * @return string
27 */
28 public function description() {
29 return __( 'This is a fake gateway that logs the messages to <code>debug.log</code> file without sending the actual SMS.', 'texty' );
30 }
31
32 /**
33 * Get the logo
34 *
35 * @return string
36 */
37 public function logo() {
38 return TEXTY_URL . '/assets/images/logo.svg';
39 }
40
41 /**
42 * Get the settings
43 *
44 * @return array
45 */
46 public function get_settings() {
47 return [];
48 }
49
50 /**
51 * Send SMS
52 *
53 * @param string $to
54 * @param string $message
55 *
56 * @return WP_Error|true
57 */
58 public function send( $to, $message ) {
59 $message = sprintf( 'To: %s; Message: %s', $to, $message );
60 error_log( $message );
61
62 return true;
63 }
64
65 /**
66 * Validate a REST API request
67 *
68 * @param WP_REST_Request $request
69 *
70 * @return WP_Error|true
71 */
72 public function validate( $request ) {
73 return [];
74 }
75 }
76