PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.13.1
GiveWP – Donation Plugin and Fundraising Platform v2.13.1
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / Route / PayPalWebhooks.php
PayPalWebhooks.php
40 lines 756 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\Route;
4
5 use Give\Controller\PayPalWebhooks as Controller;
6
7 class PayPalWebhooks implements Route {
8 /**
9 * @inheritDoc
10 */
11 public function init() {
12 add_action( 'wp', [ $this, 'callController' ] );
13 }
14
15 /**
16 * Calls the corresponding controller for the route in the appropriate context
17 *
18 * @since 2.8.0
19 */
20 public function callController() {
21 if ( isset( $_GET['give-listener'] ) && $_GET['give-listener'] === 'paypal-commerce' ) {
22 give( Controller::class )->handle();
23
24 http_response_code( 200 );
25 die();
26 }
27 }
28
29 /**
30 * Returns the route URL
31 *
32 * @since 2.8.0
33 *
34 * @return string
35 */
36 public function getRouteUrl() {
37 return get_site_url( null, 'index.php?give-listener=paypal-commerce', 'https' );
38 }
39 }
40