PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.19.6
GiveWP – Donation Plugin and Fundraising Platform v2.19.6
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
71 lines 2.4 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\AddMissingTransactionIdForUncompletedDonations;
15 use Give\PaymentGateways\Gateways\Stripe\Migrations\AddStatementDescriptorToStripeAccounts;
16 use Give\PaymentGateways\PayPalCommerce\Migrations\RemoveLogWithCardInfo;
17 use Give\ServiceProviders\ServiceProvider as ServiceProviderInterface;
18
19 /**
20 * Class ServiceProvider - PaymentGateways
21 *
22 * The Service Provider for loading the Payment Gateways for Payment Flow 2.0
23 *
24 * @since 2.18.0
25 */
26 class ServiceProvider implements ServiceProviderInterface
27 {
28 /**
29 * @inheritDoc
30 */
31 public function register()
32 {
33 give()->singleton(PaymentGatewayRegister::class);
34 give()->singleton(WebhookRegister::class);
35 }
36
37 /**
38 * @inheritDoc
39 */
40 public function boot()
41 {
42 $this->registerMigrations();
43
44 Hooks::addFilter('give_register_gateway', RegisterPaymentGateways::class);
45 Hooks::addFilter('give_payment_gateways', RegisterPaymentGatewaySettingsList::class);
46 Hooks::addAction('template_redirect', GatewayRoute::class);
47 Hooks::addAction(
48 'wp_ajax_edit_stripe_account_statement_descriptor',
49 UpdateStatementDescriptorAjaxRequestController::class
50 );
51
52 /**
53 * Stripe Checkout Redirect Handler
54 */
55 Hooks::addAction('wp_footer', CheckoutGateway::class, 'maybeHandleRedirect', 99999);
56 Hooks::addAction('give_embed_footer', CheckoutGateway::class, 'maybeHandleRedirect', 99999);
57 }
58
59 /**
60 * @since 2.19.6
61 */
62 private function registerMigrations()
63 {
64 give(MigrationsRegister::class)->addMigrations([
65 AddStatementDescriptorToStripeAccounts::class,
66 AddMissingTransactionIdForUncompletedDonations::class,
67 RemoveLogWithCardInfo::class,
68 ]);
69 }
70 }
71