Actions
4 years ago
DataTransferObjects
4 years ago
Exceptions
4 years ago
Gateways
4 years ago
PayPalCommerce
4 years ago
Stripe
4 years ago
resources
4 years ago
PaymentGateway.php
4 years ago
PaypalSettingPage.php
4 years ago
ServiceProvider.php
4 years ago
SettingPage.php
4 years ago
ServiceProvider.php
55 lines
| 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 |