PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.19.5
GiveWP – Donation Plugin and Fundraising Platform v2.19.5
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 / PaymentGateways / ServiceProvider.php
ServiceProvider.php
55 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\PaymentGateways;
4
5 use Give\Framework\Migrations\MigrationsRegister;
6 use Give\Framework\PaymentGateways\PaymentGatewayRegister;
7 use Give\Framework\PaymentGateways\Routes\GatewayRoute;
8 use Give\Helpers\Hooks;
9 use Give\LegacyPaymentGateways\Actions\RegisterPaymentGatewaySettingsList;
10 use Give\PaymentGateways\Actions\RegisterPaymentGateways;
11 use Give\PaymentGateways\Gateways\PayPalStandard\Webhooks\WebhookRegister;
12 use Give\PaymentGateways\Gateways\Stripe\CheckoutGateway;
13 use Give\PaymentGateways\Gateways\Stripe\Controllers\UpdateStatementDescriptorAjaxRequestController;
14 use Give\PaymentGateways\Gateways\Stripe\Migrations\AddStatementDescriptorToStripeAccounts;
15 use Give\ServiceProviders\ServiceProvider as ServiceProviderInterface;
16
17 /**
18 * Class ServiceProvider - PaymentGateways
19 *
20 * The Service Provider for loading the Payment Gateways for Payment Flow 2.0
21 *
22 * @since 2.18.0
23 */
24 class ServiceProvider implements ServiceProviderInterface
25 {
26 /**
27 * @inheritDoc
28 */
29 public function register()
30 {
31 give()->singleton(PaymentGatewayRegister::class);
32 give()->singleton(WebhookRegister::class);
33 }
34
35 /**
36 * @inheritDoc
37 */
38 public function boot()
39 {
40 Hooks::addFilter('give_register_gateway', RegisterPaymentGateways::class);
41 Hooks::addFilter('give_payment_gateways', RegisterPaymentGatewaySettingsList::class);
42 Hooks::addAction('template_redirect', GatewayRoute::class);
43 Hooks::addAction('wp_ajax_edit_stripe_account_statement_descriptor', UpdateStatementDescriptorAjaxRequestController::class);
44
45 give(MigrationsRegister::class)
46 ->addMigration(AddStatementDescriptorToStripeAccounts::class);
47
48 /**
49 * Stripe Checkout Redirect Handler
50 */
51 Hooks::addAction('wp_footer', CheckoutGateway::class, 'maybeHandleRedirect', 99999);
52 Hooks::addAction('give_embed_footer', CheckoutGateway::class, 'maybeHandleRedirect', 99999);
53 }
54 }
55